cortex-debug icon indicating copy to clipboard operation
cortex-debug copied to clipboard

BMP: restart doesn't work

Open SaintGimp opened this issue 6 years ago • 0 comments

The restart command for the BMP doesn't behave as expected. When I invoke it, the program simply breaks wherever it happens to be executing without actually restarting.

I see that the restart command for the BMP currently runs this command: 'interpreter-exec console "SoftwareReset"'. The SoftwareReset command appears to be defined in gdbsupport.init. I'm not sure about the format of that file but I guess it's defining some register operations? In any case, it doesn't restart my program, at least not on my SAMD21 target.

I can work around the problem by adding this configuration option: "postRestartCommands": ["start"]. That invokes the built-in GDB command to (re)start the program, and works fine.

Without understanding much context, it seems to me that the BMP restart command should be changed to use start rather than SoftwareReset. It would be even better if the code could check the runToMain configuration option and use either start (start and run to main) or starti (start and stop at first instruction) as appropriate.

SaintGimp avatar Aug 18 '18 09:08 SaintGimp