proc: avoid panic when call injection finishes before SetTarget - #4398
proc: avoid panic when call injection finishes before SetTarget#4398derekparker wants to merge 2 commits into
Conversation
|
I don't really see how this could be the problem. For us to get to Obviously the bug happens, so there must be a path that leads there (which I am not seeing), but to me it does not look like the path is this one. |
e14d7c0 to
3bb195f
Compare
|
ddaa59c to
3d88507
Compare
Post-Start mock drives premature RestoreRegisters and related cases so the empty-fncalls SetTarget panic can be reproduced without a live target. Broader eval-stack fuzzing is deferred to fix/eval-stack-fuzz.
Guard CallInjectionSetTarget against an empty fncalls stack and treat premature RestoreRegisters / unknown protocol register values as errors so evaluation fails cleanly instead of panicking (issues go-delve#4085, go-delve#4363).
3d88507 to
2cb971b
Compare
aarzilli
left a comment
There was a problem hiding this comment.
Good point. But then instead of targetSet it should be callInjectionCompleted that we check for in the case for debugCallRegRestoreRegisters, no?
| // Unknown protocol register value: do not continue blindly. Continuing | ||
| // without SetTarget can finish the call and then panic in | ||
| // evalCallInjectionSetTarget (see issues #4085, #4363). | ||
| fncall.err = unknownProtocolRegisterError(regval) |
There was a problem hiding this comment.
This could just be the fmt.Errorf call directly.
Guard CallInjectionSetTarget against an empty fncalls stack and treat premature RestoreRegisters / unknown protocol register values as errors so evaluation fails cleanly instead of panicking (issues #4085, #4363).