pyOCD icon indicating copy to clipboard operation
pyOCD copied to clipboard

Semihosting: How about halting debugger on SYS_EXIT?

Open rgrr opened this issue 1 year ago • 2 comments

OpenOCD behaves that way, that debugging is halted if the target issues SYS_EXIT (0x18).

Should be a oneliner if one knows the corresponding call.

And another idea which goes into the same direction: how about command line options to start the target in gdbserver mode and exit pyocd if SYS_EXIT is executed? This would allow very easy in target coverage testing.

rgrr avatar Mar 24 '23 18:03 rgrr

Hi @rgrr ,

We are using gdb command: continue & to start execution. & can make continue run in background and not blocking the gdb.

If you want to exit debuging, you can send interrupt.

We are using this way to get coverage data from target with pyocd.

Hoohaha avatar Mar 27 '23 03:03 Hoohaha

My idea is to omit gdb and do pyocd the job. After finding out, that pyocd is controllable via API there seem to be multiple ways to get to the goal. I guess I will expand the API examples section a bit.

Nevertheless, openocd behavior to halt debugging (as if there was a breakpoint) is TMO very helpful if in a debug session. Pyocd currently shows you a "running" target in gdb although effectively it has stopped at the BKPT.

rgrr avatar Mar 31 '23 07:03 rgrr