在调试C++时,在Vimspector的调试窗口中没有看到变量Neovim的程序。断点集也看不到
我是使用vimspector的新诺沃姆调试的新手。当我设置断点并打开调试器时,我无法看到任何变量或看到断点本身。这里可能怎么了? vimspector debugger打开时,没有显示变量或断点点。
是我的.vimspector.json。
{
"configurations": {
"C - Launch": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"externalConsole": true,
"stopOnEntry": true,
"stopAtEntry": true,
"MIMode": "gdb",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/test"
}
}
}
}
下面
:set number
:set relativenumber
:set autoindent
:set tabstop=4
:set shiftwidth=4
:set smarttab
:set softtabstop=4
:set mouse=a
call plug#begin()
Plug 'voldikss/vim-browser-search'
Plug 'preservim/nerdtree'
Plug 'pineapplegiant/spaceduck', { 'branch': 'main' }
Plug 'https://github.com/tc50cal/vim-terminal'
Plug 'http://github.com/tpope/vim-surround' " Surrounding ysw)
Plug 'https://github.com/tpope/vim-commentary' " For Commenting gcc & gc
Plug 'https://github.com/vim-airline/vim-airline' " Status bar
Plug 'https://github.com/lifepillar/pgsql.vim'
Plug 'https://github.com/ap/vim-css-color' " CSS Color Preview
Plug 'https://github.com/rafi/awesome-vim-colorschemes' " Retro Scheme
Plug 'https://github.com/neoclide/coc.nvim' " Auto Completion
Plug 'https://github.com/ryanoasis/vim-devicons' " Developer Icons
Plug 'https://github.com/preservim/tagbar' " Tagbar for code navigation
Plug 'https://github.com/terryma/vim-multiple-cursors' " CTRL + N for multiple cursors
Plug 'https://github.com/puremourning/vimspector'
set encoding=UTF-8
call plug#end()
let g:vimspector_enable_mappings = 'HUMAN'
nmap <silent> <Leader>s <Plug>SearchNormal
vmap <silent> <Leader>s <Plug>SearchVisual
nnoremap <C-f> :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-l> :call CocActionAsync('jumpDefinition')<CR>
nmap <F8> :TagbarToggle<CR>
:set completeopt-=preview " For No Previews
let g:NERDTreeDirArrowExpandable="+"
let g:NERDTreeDirArrowCollapsible="~"
" --- Just Some Notes ---
" :PlugClean :PlugInstall :UpdateRemotePlugins
"
" :CocInstall coc-python
" :CocInstall coc-clangd
" :CocInstall coc-snippets
" :CocCommand snippets.edit... FOR EACH FILE TYPE
" air-line
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
inoremap <expr> <Tab> pumvisible() ? coc#_select_confirm() : "<Tab>"
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
colorscheme spaceduck
let g:vimspector_enable_mappings = 'HUMAN'
nnoremap <Leader>dd :call vimspector#Launch()<CR>
nnoremap <Leader>dx :call vimspector#Reset()<CR>
nnoremap <Leader>de :call vimspectorEval
nnoremap <Leader>dw :call vimspectorWatch
nnoremap <Leader>do :call vimspectorShowOutput
I am new to this Neovim debugging using Vimspector. When i set breakpoints and open debugger i am unable to see any variables or see breakpoints itself. What might be wrong here?
Vimspector Debugger when opened,showing no variables or break points.
Below is my .vimspector.json
{
"configurations": {
"C - Launch": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"externalConsole": true,
"stopOnEntry": true,
"stopAtEntry": true,
"MIMode": "gdb",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/test"
}
}
}
}
Below is my innit.vim code if needed:
:set number
:set relativenumber
:set autoindent
:set tabstop=4
:set shiftwidth=4
:set smarttab
:set softtabstop=4
:set mouse=a
call plug#begin()
Plug 'voldikss/vim-browser-search'
Plug 'preservim/nerdtree'
Plug 'pineapplegiant/spaceduck', { 'branch': 'main' }
Plug 'https://github.com/tc50cal/vim-terminal'
Plug 'http://github.com/tpope/vim-surround' " Surrounding ysw)
Plug 'https://github.com/tpope/vim-commentary' " For Commenting gcc & gc
Plug 'https://github.com/vim-airline/vim-airline' " Status bar
Plug 'https://github.com/lifepillar/pgsql.vim'
Plug 'https://github.com/ap/vim-css-color' " CSS Color Preview
Plug 'https://github.com/rafi/awesome-vim-colorschemes' " Retro Scheme
Plug 'https://github.com/neoclide/coc.nvim' " Auto Completion
Plug 'https://github.com/ryanoasis/vim-devicons' " Developer Icons
Plug 'https://github.com/preservim/tagbar' " Tagbar for code navigation
Plug 'https://github.com/terryma/vim-multiple-cursors' " CTRL + N for multiple cursors
Plug 'https://github.com/puremourning/vimspector'
set encoding=UTF-8
call plug#end()
let g:vimspector_enable_mappings = 'HUMAN'
nmap <silent> <Leader>s <Plug>SearchNormal
vmap <silent> <Leader>s <Plug>SearchVisual
nnoremap <C-f> :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-l> :call CocActionAsync('jumpDefinition')<CR>
nmap <F8> :TagbarToggle<CR>
:set completeopt-=preview " For No Previews
let g:NERDTreeDirArrowExpandable="+"
let g:NERDTreeDirArrowCollapsible="~"
" --- Just Some Notes ---
" :PlugClean :PlugInstall :UpdateRemotePlugins
"
" :CocInstall coc-python
" :CocInstall coc-clangd
" :CocInstall coc-snippets
" :CocCommand snippets.edit... FOR EACH FILE TYPE
" air-line
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
inoremap <expr> <Tab> pumvisible() ? coc#_select_confirm() : "<Tab>"
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
colorscheme spaceduck
let g:vimspector_enable_mappings = 'HUMAN'
nnoremap <Leader>dd :call vimspector#Launch()<CR>
nnoremap <Leader>dx :call vimspector#Reset()<CR>
nnoremap <Leader>de :call vimspectorEval
nnoremap <Leader>dw :call vimspectorWatch
nnoremap <Leader>do :call vimspectorShowOutput
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的问题与我一样,解决方案是:
与选项-G一起编译源代码以生成调试信息,例如。
GCC -G -O Test Test.c
。之后,Vimspector可及时正确。
您应该先尝试GDB,例如。
GDB测试
,无需选项-G,输出:This issue is same with me, solution is:
Compile source code with option -g to generate debug info, eg.
gcc -g -o test test.c
.after that Vimspector vairable diplay correctly.
You should try gdb first, eg.
gdb test
, gcc without option -g, output: