delve icon indicating copy to clipboard operation
delve copied to clipboard

Enable non-invasive debugging

Open ajwerner opened this issue 6 years ago • 1 comments
trafficstars

Using dlv attach to connect to a running process can be a powerful debugging tool when you catch unexpected conditions in the wild. it can be convenient to run an init script which attempts to be minimally invasive inside the host process. Consider the following init script:

break getPartLocked
continue
locals
clearall
exit

The hope of such an init script is to get in and out of the process as quickly as possible in an attempt to not disrupt the interesting state that brought you to attach the debugger in the first place. I'd love some mode where if delve finds itself with the process paused for some amount of time it just detaches gracefully. This can happen due now to a syntax error, or other error I suppose. Maybe just an error handling mode would go a long way.

Right now however the biggest problem with the above script is the need to furiously type n when the exit is reached in order to not tear down the attached process. One might expect that the -c flag for exit would allow a user to bypass the teardown prompt.

ajwerner avatar Apr 24 '19 02:04 ajwerner

I think this was implemented by 7151c6cbcc555c8d15a7f959adc37565d9aed6f2

aarzilli avatar Oct 16 '20 11:10 aarzilli

Closing, fixed by 7151c6c

aarzilli avatar Nov 21 '22 08:11 aarzilli