Repository navigation
pkg/proc: add way to disable stop-on-error for breakpoint conditions - #4191
Conversation
Add a fake delve.catch function that can be used to wrap the expression of breakpoint conditions so that they do not stop if the expression can not be evaluated correctly. The main use case for this is that it's hard to set breakpoint conditions on interface variables that assume different types but it can also be useful in other cases (for example checking the value of a pointer-to-struct that sometimes is nil).
|
This is an interesting feature and I definitely see the use case. I'm wondering if a pseudo function is the right way to go here. Can we annotate the entire condition as being "no stop on error"? That does give the user less granularity over which parts of the expression they want to ignore errors for though. Also, |
The delve.catch function here is only allowed if it surrounds the entire expression. Were you thinking of something like a flag (that would then translate into a field of |
Add a fake delve.catch function that can be used to wrap the expression
of breakpoint conditions so that they do not stop if the expression can
not be evaluated correctly.
The main use case for this is that it's hard to set breakpoint
conditions on interface variables that assume different types but it
can also be useful in other cases (for example checking the value of a
pointer-to-struct that sometimes is nil).