Repository navigation
service/dap: Implement suspended breakpoints - #4075
Conversation
|
This is a draft because I'm not sure callbacks are the right approach. |
161731b to
6b055a5
Compare
6b055a5 to
1283a5d
Compare
|
I realized that the hack for setting the path of the breakpoint was totally unnecessary. Simply moving the Line and Source assignment behind |
1283a5d to
11c1a21
Compare
|
Some of the tests in |
This enables support for 'suspended' breakpoints, for example for a plugin that hasn't been loaded yet. Fixes go-delve#4074
11c1a21 to
c54ace9
Compare
| fmt.Fprintf(t.stdout, "\n") | ||
| } | ||
| case api.EventBreakpointMaterialized: | ||
| // Ignore |
There was a problem hiding this comment.
I think it would actually be a good idea to print to the terminal that certain breakpoints have been activated now that we have this plumbed through.
There was a problem hiding this comment.
I wasn't sure what to print so I went with "Breakpoint {id} materialized at {file}:{line} ({function})" with the function omitted if FunctionName is blank. As you can see below, the function name is maybe not helpful for plugins. I made the file path relative (if possible) because that seems nicer than printing out an absolute path.
firelizzard18
left a comment
There was a problem hiding this comment.
(nothing to say here)
| logger.Debugf("suspended breakpoint %d enabled", lbp.LogicalID) | ||
| } | ||
| if fn := t.BinInfo().eventsFn; fn != nil { | ||
| fn(&Event{ |
There was a problem hiding this comment.
@derekparker In enableBreakpointOnTarget, if len(addrs) == 0 does it make sense to say the breakpoint is enabled? When I was testing, I set the breakpoint on line 6 of plugin.go (in my dumb-plugin repo) and that breakpoint was not hit (I assume) because no address was found. In that case, notifying the front end that a breakpoint was materialized seems misleading.
| fmt.Fprintf(t.stdout, "\n") | ||
| } | ||
| case api.EventBreakpointMaterialized: | ||
| // Ignore |
There was a problem hiding this comment.
I wasn't sure what to print so I went with "Breakpoint {id} materialized at {file}:{line} ({function})" with the function omitted if FunctionName is blank. As you can see below, the function name is maybe not helpful for plugins. I made the file path relative (if possible) because that seems nicer than printing out an absolute path.
This enables support for 'suspended' breakpoints, for example for a plugin that hasn't been loaded yet.
Fixes #4074