I have just discovered C-x C-a C-j (jump to cursor) when running gdb in emacs. I initially assumed that it was the equivalent of setting a break wherever the cursor is and continuing (c) to that statement. However I seem to be observing the behaviour that when using jump none of the intervening statements (between the prev breakpoint and the current cursor location) are being executed. Can anyone confirm or deny this?
I guess if it isn’t executing the statements it is equivalent to being able to comment out a block of code ‘from within’ the debugger, i.e. without having to go back into the src, explicitly comment out and then recompile. I can see that could be useful, but it definitely wasn’t what I was expecting.
If that is what’s happening then a follow up question would be is there a ‘continue to cursor’ command (where the intervening statements do get executed)?
I believe what you need is
C-x C-a C-u(M-x gud-until) instead ofM-x gud-jump. The latter, as the Emacs manual quite clearly states, simply