puremourning / vimspector

vimspector - A multi-language debugging system for Vim
http://puremourning.github.io/vimspector-web
Apache License 2.0
4.11k stars 175 forks source link

vscode-cpptools1.9.8 always asks me "all: Break on All C++ Exceptions (Y/N/default: N)? N". #621

Closed 0BananaBig0 closed 2 years ago

0BananaBig0 commented 2 years ago

Description

After update vscode-cpptools from 1.9.7 to 1.9.8, evertime I start the vimspector to debug my cpp codes or clear all breakpoints, it will ask me "all: Break on All C++ Exceptions (Y/N/default: N)? N". Although I changed my .vimspector.json file, this still happen.

Works in vim?

Reproducable in Vim

Works with clean config?

No

Sample project works?

No sample project for this filetype

Minimal Reproduction

List of steps to reproduce:

1, open vim 2, begin to debug

Expected Behaviour

Do not ask me "all: Break on All C++ Exceptions (Y/N/default: N)? N"

Actual Behaviour

Ask me "all: Break on All C++ Exceptions (Y/N/default: N)? N"

Additional information

vscode-cpptools1.9.7 has no this problem.

Installation Type

Plugin Manager (git clone)

Vimspector version

4e68dc10ba00a4990090872dce2b15127e28fe55

Debug Info

Vimspector Debug Info
--------------------------------------------------------------------------------
ConnectionType: job
Adapter: 
--------------------------------------------------------------------------------
{
  "attach": {
    "pidProperty": "processId",
    "pidSelect": "ask"
  },
  "command": [
    "/home/lwx/.vim/plugged/vimspector/gadgets/linux/vscode-cpptools/debugAdapters/bin/OpenDebugAD7"
  ],
  "configuration": {
    "args": [],
    "cwd": "/data/lwx/W",
    "environment": [],
    "type": "cppdbg"
  },
  "name": "cppdbg",
  "env": {},
  "cwd": "/data/lwx/W/src/W/E/A/L"
}
--------------------------------------------------------------------------------
Configuration: 
--------------------------------------------------------------------------------
{
  "adapter": "vscode-cpptools",
  "configuration": {
    "name": "cpp:launch",
    "stopAtEntry": true,
    "type": "cppdbg",
    "request": "launch",
    "program": "/data/lwx/W/bin/W",
    "args": [
      "-script",
      "/data/lwx/W/Y/P/T/a/scr/A"
    ],
    "cwd": "/data/lwx/W/Y/P/T/a/run",
    "environment": [],
    "externalConsole": true,
    "MIMode": "gdb",
    "breakpointers": {
      "exception": {
        "cpp_throw": "Y",
        "cpp_catch": "Y"
      }
    },
    "setupCommands": [
      {
        "description": "Enable pretty-printing for gdb",
        "text": "-enable-pretty-printing",
        "ignoreFailures": true
      }
    ]
  }
}
--------------------------------------------------------------------------------
API Prefix: 
Launch/Init: True / True
Workspace Root: /data/lwx/W
Launch Config: 
--------------------------------------------------------------------------------
{
  "args": [
    "-script",
    "/data/lwx/W/Y/P/T/a/scr/A"
  ],
  "cwd": "/data/lwx/W/Y/P/T/a/run",
  "environment": [],
  "type": "cppdbg",
  "name": "cpp:launch",
  "stopAtEntry": true,
  "request": "launch",
  "program": "/data/lwx/W/bin/W",
  "externalConsole": true,
  "MIMode": "gdb",
  "breakpointers": {
    "exception": {
      "cpp_throw": "Y",
      "cpp_catch": "Y"
    }
  },
  "setupCommands": [
    {
      "description": "Enable pretty-printing for gdb",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
    }
  ]
}
--------------------------------------------------------------------------------
Server Capabilities: 
--------------------------------------------------------------------------------
{
  "supportsConfigurationDoneRequest": true,
  "supportsFunctionBreakpoints": true,
  "supportsConditionalBreakpoints": true,
  "supportsEvaluateForHovers": true,
  "exceptionBreakpointFilters": [
    {
      "filter": "all",
      "label": "All C++ Exceptions",
      "default": false,
      "supportsCondition": true,
      "conditionDescription": "std::out_of_range,std::invalid_argument"
    }
  ],
  "supportsSetVariable": true,
  "supportsGotoTargetsRequest": true,
  "supportsCompletionsRequest": true,
  "completionTriggerCharacters": [],
  "supportsModulesRequest": true,
  "supportedChecksumAlgorithms": [],
  "supportsValueFormattingOptions": true,
  "supportsLogPoints": true,
  "supportsSetExpression": true,
  "supportsDataBreakpoints": true,
  "supportsReadMemoryRequest": true,
  "supportsDisassembleRequest": true,
  "supportsClipboardContext": true,
  "supportsSteppingGranularity": true,
  "supportsInstructionBreakpoints": true,
  "supportsExceptionFilterOptions": true
}
--------------------------------------------------------------------------------
Line Breakpoints: 
--------------------------------------------------------------------------------
{
  "/data/lwx/W/src/W/main.cpp": []
}
--------------------------------------------------------------------------------
Func Breakpoints: 
--------------------------------------------------------------------------------
[]
--------------------------------------------------------------------------------
Ex Breakpoints: 
--------------------------------------------------------------------------------
{
  "filters": []
}
--------------------------------------------------------------------------------

Log file

2022-07-12 16:08:18,613 - DEBUG - Message received: {'type': 'response', 'request_seq': 11, 'success': True, 'command': 'variables', 'body': {'variables': [{'name': 'app', 'value': '{...}', 'type': 'QCoreApplication', 'evaluateName': 'app', 'variablesReference': 0}, {'name': 'fcc_122', 'value': '{...}', 'type': 'profile::FCCHolder', 'evaluateName': 'fcc_122', 'variablesReference': 1002}, {'name': 'holder', 'value': '{...}', 'type': 'FuncTraceHolder', 'evaluateName': 'holder', 'variablesReference': 1003}, {'name': '__func__', 'value': '[5]', 'type': 'const char [5]', 'evaluateName': '__func__', 'variablesReference': 1004}, {'name': 'ret', 'value': '0', 'type': 'int', 'evaluateName': 'ret', 'variablesReference': 0, 'memoryReference': '0x0000000000000000'}, {'name': 'perfMmonitor', 'value': '0x14', 'type': 'PerformanceMonitorThread *', 'evaluateName': 'perfMmonitor', 'variablesReference': 1005, 'memoryReference': '0x0000000000000014'}, {'name': 'defer_174', 'value': '{...}', 'type': 'DeferHolder', 'evaluateName': 'defer_174', 'variablesReference': 1006}, {'name': 'argc', 'value': '3', 'type': 'int', 'evaluateName': 'argc', 'variablesReference': 0, 'memoryReference': '0x0000000000000003'}, {'name': 'argv', 'value': '0x7fffffffcee8', 'type': 'char **', 'evaluateName': 'argv', 'variablesReference': 1007, 'memoryReference': '0x00007fffffffcee8'}]}, 'seq': 212}

Vim version

# vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jul 11 2022 08:42:59)
Included patches: 1-49
Compiled by brooksj
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       +tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
+balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
+browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   +toolbar
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           +python/dyn        +viminfo
+cmdline_info      +libcall           +python3/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con_gui    +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            +X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       +xpm
+emacs_tags        -mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/data/lwx1182776/.bin/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/pixman-1 -I/usr/include/libdrm -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lselinux -lcanberra -lrt -lacl -lattr -ldl -L/usr/lib -llua -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib64 -ltcl8.5 -ldl -lpthread -lieee -lm -lruby -lpthread -lrt -ldl -lcrypt -lm -L/usr/lib64

Python version

No response

Neovim diagnostics

No response

Operating System

Linux dggpcotgpu00004 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Declaration

puremourning commented 2 years ago

"breakpointers": {

Typo

0BananaBig0 commented 2 years ago

@puremourning Eventhoug I change "breakpointers" to "breakpoints" , this problem still occurs.

puremourning commented 2 years ago

just carefully read the documentation that explains how to configure exception breakpoints. You have it wrong in your config (in the wrong place), this is not a bug.

0BananaBig0 commented 2 years ago
Vimspector Debug Info
--------------------------------------------------------------------------------
ConnectionType: job
Adapter: 
--------------------------------------------------------------------------------
{
  "attach": {
    "pidProperty": "processId",
    "pidSelect": "ask"
  },
  "command": [
    "/home/lwx/.vim/plugged/vimspector/gadgets/linux/vscode-cpptools/debugAdapters/bin/OpenDebugAD7"
  ],
  "configuration": {
    "args": [],
    "cwd": "/data/lwx/W",
    "environment": [],
    "type": "cppdbg"
  },
  "name": "cppdbg",
  "env": {},
  "cwd": "/data/lwx/W/src/W/E/A/L"
}
--------------------------------------------------------------------------------
Configuration: 
--------------------------------------------------------------------------------
{
  "adapter": "vscode-cpptools",
  "variables": {},
  "configuration": {
    "name": "cpp:launch",
    "stopAtEntry": true,
    "type": "cppdbg",
    "request": "launch",
    "program": "/data/lwx/W/bin/W",
    "args": [
      "-script",
      "/data/lwx/W/Y/P/T/a/scr/A"
    ],
    "cwd": "/data/l/W/Y/P/T/a/run",
    "environment": [],
    "externalConsole": true,
    "MIMode": "gdb",
    "setupCommands": [
      {
        "description": "Enable pretty-printing for gdb",
        "text": "-enable-pretty-printing",
        "ignoreFailures": true
      }
    ]
  },
  "breakpoints": {
    "exception": {
      "cpp_throw": "Y",
      "cpp_catch": "Y"
    }
  }
}
--------------------------------------------------------------------------------
API Prefix: 
Launch/Init: True / True
Workspace Root: /data/lwx/W
Launch Config: 
--------------------------------------------------------------------------------
{
  "args": [
    "-script",
    "/data/lwx/W/Y/P/T/a/scr/A"
  ],
  "cwd": "/data/lwx/W/Y/P/T/a/run",
  "environment": [],
  "type": "cppdbg",
  "name": "cpp:launch",
  "stopAtEntry": true,
  "request": "launch",
  "program": "/data/lwx/W/bin/W",
  "externalConsole": true,
  "MIMode": "gdb",
  "setupCommands": [
    {
      "description": "Enable pretty-printing for gdb",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
    }
  ]
}
--------------------------------------------------------------------------------
Server Capabilities: 
--------------------------------------------------------------------------------
{
  "supportsConfigurationDoneRequest": true,
  "supportsFunctionBreakpoints": true,
  "supportsConditionalBreakpoints": true,
  "supportsEvaluateForHovers": true,
  "exceptionBreakpointFilters": [
    {
      "filter": "all",
      "label": "All C++ Exceptions",
      "default": false,
      "supportsCondition": true,
      "conditionDescription": "std::out_of_range,std::invalid_argument"
    }
  ],
  "supportsSetVariable": true,
  "supportsGotoTargetsRequest": true,
  "supportsCompletionsRequest": true,
  "completionTriggerCharacters": [],
  "supportsModulesRequest": true,
  "supportedChecksumAlgorithms": [],
  "supportsValueFormattingOptions": true,
  "supportsLogPoints": true,
  "supportsSetExpression": true,
  "supportsDataBreakpoints": true,
  "supportsReadMemoryRequest": true,
  "supportsDisassembleRequest": true,
  "supportsClipboardContext": true,
  "supportsSteppingGranularity": true,
  "supportsInstructionBreakpoints": true,
  "supportsExceptionFilterOptions": true
}
--------------------------------------------------------------------------------
Line Breakpoints: 
--------------------------------------------------------------------------------
{
  "/data/lwx/W/src/W/main.cpp": []
}
--------------------------------------------------------------------------------
Func Breakpoints: 
--------------------------------------------------------------------------------
[]
--------------------------------------------------------------------------------
Ex Breakpoints: 
--------------------------------------------------------------------------------
{
  "filters": []
}
--------------------------------------------------------------------------------

It still happens @puremourning

puremourning commented 2 years ago

Your exception specification is:

  "breakpoints": {
    "exception": {
      "cpp_throw": "Y",
      "cpp_catch": "Y"
    }
  }

the message you are receiving:

all: Break on All C++ Exceptions (Y/N/default: N)? N

Per the documentation:

Screenshot 2022-07-12 at 09 54 45

Your message has all at the beginning, so you need to use all as the key for the exception breakpoint configuration, e.g.:

  "breakpoints": {
    "exception": {
      "all": "N",
    }
  }

You now have all the required information copy/pasted by me, written and documented by me, and tested, by me. I hope you enjoy it.