gdb seems to get in a bad state after trying to step a line or two, after hitting a breakpoint. Is there something specific I can do in Eclipse to fix this?
Repro:
- Start debug session in Eclipse, attached to remote target
- Set a breakpoint in Eclipse, then trigger it on target.
- The breakpoint is hit correctly in Eclipse. Now 'step over' a line or two.
Expected Result:
- 'step over' will execute one line, as you'd normally expect.
Actual Result:
- Instead of going to the next line number, it appears the program 'continues'. In the debug view in Eclipse, the tree displaying all threads minimizes them all, and they cannot be expanded to show the current stack. Also, the "step ..." buttons are no longer enabled, and the "pause" and "stop" buttons are able to be pressed. This implies the program is running, which is not expected, as we had previously pressed "step over". Looking on the target, it is not running, instead it is still paused.
- If we hit 'pause' in Eclipse, then open up the specific thread with the breakpoint, we can see the instruction pointer is back at the correct spot we expect it to be after hitting 'step over' previously. So, at first glance, it appears we just have a hiccup in our workflow, and need only to hit 'pause' and find our previous thread, whenever stepping doesn't behave right. But soon things just stop working...
I've been able to reproduce this problem without Eclipse, just using the command line gdb and remote gdbserver. The same behavior occurs. A hacky potential workaround there is -- once you've hit your breakpoint, 'set scheduler-locking on'. After that, you can step to your heart's content. But, I don't have a good understanding of what that's doing.
Anyone have any input?
Thanks.