简体   繁体   English

在Emacs 23中使用gdb

[英]Using gdb in Emacs 23

I am trying to move from Emacs v22.3.1 to v23.1.1 and all was going well until I tried to run gdb using gud inside Emacs. 我正试图从Emacs v22.3.1迁移到v23.1.1并且一切顺利,直到我尝试使用Emacs中的gud运行gdb。

When I do meta-x gdb and give a command of 'gdb /my/executable/here' the window comes up fine, but when I type a command at the gdb prompt upon hitting return key to execute the command, nothing happens, status bar says 'Debugger:run' and the result is never shown. 当我执行meta-x gdb并命令'gdb / my / executable / here'时,窗口显示正常,但是当我按下返回键执行命令时在gdb提示符下键入命令时,没有任何反应,状态bar说'Debugger:run',结果从未显示过。 I can type 'ctrl-c ctrl-c' to kill the command and get the '(gdb)' prompt again, but another command just fails the same way. 我可以输入'ctrl-c ctrl-c'来终止命令并再次获得'(gdb)'提示,但是另一个命令也以同样的方式失败。

This is gdb v6.8 on Linux Centos v4 32bit. 这是Linux Centos v4 32bit上的gdb v6.8。

Has anyone else faced this issue? 还有其他人遇到过这个问题吗? What is the best way to proceed? 什么是最好的方法?

I attached to gdb from a prompt (not gud) and got this stack trace: 我从一个提示符(而不是gud)附加到gdb并得到了这个堆栈跟踪:

#0  0x00fd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x0020108d in poll () from /lib/tls/libc.so.6
#2  0x08111a07 in gdb_do_one_event (data=0x0) at event-loop.c:759
#3  0x0810f05f in catch_errors (func=0x8111970 <gdb_do_one_event>, func_args=0x0, errstring=0x8236200 "", mask=6) at exceptions.c:513
#4  0x080c25e7 in tui_command_loop (data=0x0) at .././gdb/tui/tui-interp.c:153
#5  0x0810f2cf in current_interp_command_loop () at interps.c:276
#6  0x0807f0b3 in captured_command_loop (data=0x0) at .././gdb/main.c:99
#7  0x0810f05f in catch_errors (func=0x807f0a8 <captured_command_loop>, func_args=0x0, errstring=0x8236200 "", mask=6) at exceptions.c:513
#8  0x0807f7eb in captured_main (data=0xbff00a60) at .././gdb/main.c:882
#9  0x0810f05f in catch_errors (func=0x807f0e0 <captured_main>, func_args=0xbff00a60, errstring=0x8236200 "", mask=6) at exceptions.c:513
#10 0x08080027 in gdb_main (args=0x7fffffff) at .././gdb/main.c:891
#11 0x0807f0a1 in main (argc=-4, argv=0xfffffffc) at gdb.c:33
#12 0x00153df3 in __libc_start_main () from /lib/tls/libc.so.6
#13 0x0807efdd in _start ()

Here's a wild guess: 这是一个疯狂的猜测:

Emacs's gud-mode requires that gdb gets run with annotations turned on so that it can properly parse the output. Emacs的gud-mode要求gdb在打开注释的情况下运行,以便它可以正确解析输出。 I've been bit by this when rewriting the default line emacs spits out after hitting Mx gdb. 当我在点击Mx gdb后重写默认行emacs spits out时,我一直都是这样做的。 Make sure that "--annotate=3" is included on your gdb command line and see if that helps. 确保gdb命令行中包含“--annotate = 3”,看看是否有帮助。

我在emacs-23中使用了gdb ...或者至少,我已经比你更远......当我尝试它时,堆栈窗口不会更新...我最终做的是使用emacs-23用于编辑(对于抗锯齿字体的好处),但使用emacs-22进行调试...你可以安装两个...

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

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