简体   繁体   English

emacs gdb跳转到游标

[英]emacs gdb jump to cursor

I have just discovered Cx Ca Cj (jump to cursor) when running gdb in emacs. 我刚刚在emacs中运行gdb时发现了Cx Ca Cj (跳转到游标)。 I initially assumed that it was the equivalent of setting a break wherever the cursor is and continuing ( c ) to that statement. 我最初假设它相当于在光标所在的位置设置中断并继续( c )到该语句。 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. 但是我似乎正在观察当使用跳转时没有任何干预语句(在prev断点和当前光标位置之间)正在执行的行为。 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, ie without having to go back into the src, explicitly comment out and then recompile. 我想如果它没有执行语句,它相当于能够从调试器中注释掉一段代码,即无需返回到src,显式注释掉然后重新编译。 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 Cx Ca Cu ( Mx gud-until ) instead of Mx gud-jump . 我相信你需要的是Cx Ca CuMx gud-until )而不是Mx gud-jump The latter, as the Emacs manual quite clearly states, simply 后者,正如Emacs手册中明确指出的那样

transfers the program's execution point to the current line. 将程序的执行点传输到当前行。 In other words, the next line that the program executes will be the one where you gave the command [...] See the GDB manual entry regarding jump for details. 换句话说,程序执行的下一行将是您给出命令的那一行[...]有关详细信息,请参阅有关jump的GDB手册条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM