puremourning / vimspector

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

[Bug]: netcoredbg exception breakpoints are not working #830

Open mikeboiko opened 7 months ago

mikeboiko commented 7 months ago

Is your feature request related to a problem? Please describe. I can't get exception breakpoints to work with C# netcoredbg. Regular breakpoints are working just fine.

Describe the solution you'd like When an exception occurs, I would like vimspector to break on the offending line.

Describe alternatives you've considered

Additional context This is my .vimspector.json config file:

{
  "configurations": {
    "local-test": {
      "adapter": "netcoredbg",
      "variables": {
        "PID": {
          "shell": "bash -c 'pgrep dotnet | tail -n 1'"
        }
      },
      "default": true,
      "configuration": {
        "request": "attach",
        "processId": "${PID}"
      },
      "breakpoints": {
        "exception": {
          "user-unhandled": "Y"
        }
      }
    }
  }
}

When I run :VimspectorDebugInfo, I get:

--------------------------------------------------------------------------------
Server Capabilities: 
--------------------------------------------------------------------------------
{
  "exceptionBreakpointFilters": [
    {
      "filter": "user-unhandled",
      "label": "user-unhandled"
    },
    {
      "filter": "all",
      "label": "all"
    }
  ],
  "supportTerminateDebuggee": true,
  "supportsCancelRequest": true,
  "supportsConditionalBreakpoints": true,
  "supportsConfigurationDoneRequest": true,
  "supportsExceptionFilterOptions": true,
  "supportsExceptionInfoRequest": true,
  "supportsExceptionOptions": false,
  "supportsFunctionBreakpoints": true,
  "supportsSetExpression": true,
  "supportsSetVariable": true,
  "supportsTerminateRequest": true
}
--------------------------------------------------------------------------------
Line Breakpoints: 
--------------------------------------------------------------------------------
{}
--------------------------------------------------------------------------------
Func Breakpoints: 
--------------------------------------------------------------------------------
[]
--------------------------------------------------------------------------------
Ex Breakpoints: 
--------------------------------------------------------------------------------
{
  "filters": []
}
--------------------------------------------------------------------------------
puremourning commented 7 months ago

steps to repro:

  1. open support/test/csharp/Program.cs
  2. edit
    void PrintToast( int r ) {
      int this_round = ( max_bread - bread - r);
      if (this_round % 3 == 0) {
        throw new Exception( "No moar bread!" );
      }
      Console.WriteLine( this.toaster + ": " + this_round );
    }
  1. edit support/test/csharp/.vimspector.json and remove all breakpoints blocks
  2. F5

expect: you are asked to set breakpoint options "user-unhandled" and "all"

actual: nothin. the adapter breaks on exception, but you didn't get to control the behaviour.

Explanation: