问题描述
我试图从Emacs v22.3.1移植到v23.1.1,一切进展顺利,直到我试图在Emacs内运行gdb。当我做meta-x gdb并给出一个'gdb / my / executable / here'的命令,窗口出来了,但是当我在gdb提示符下键入一个命令,按回车键执行命令,没有任何反应,状态栏说'Debugger:run',结果从未显示。我可以键入'ctrl-c ctrl-c'来杀死命令并再次获取'(gdb)'提示符,但是另一个命令就是以同样的方式失败。
这是Linux Centos v4 32bit上的gdb v6.8。
有没有人遇到这个问题?什么是最好的方法?
我从一个提示(不是gud)附加到gdb,并得到这个堆栈跟踪:
$ b来自/lib/ld-linux.so.2的_dl_sysinfo_int80()中的$ b $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ .so.6
#2 0xdb111a07在gdb_do_one_event(data = 0x0)在event-loop.c:759
#3 0x0810f05f在catch_errors(func = 0x8111970< gdb_do_one_event>,func_args = 0x0,errstring = 0x8236200,mask = 6)在exceptions.c:513
#4 0x080c25e7在tui_command_loop(data = 0x0)at .././gdb/tui/tui-interp.c:153
# 5 0x0810f2cf in current_interp_command_loop()在interps.c:276
#6 0x_807f0b3在taken_command_loop(data = 0x0)at .././gdb/main.c:99
#7 0x0810f05f在catch_errors(func =。×××××××××; ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain ain .c:882
#9 catch_errors中的0x0810f05f(func = 0x807f0e0< cap tries_main>,func_args = 0xbff00a60,errstring = 0x8236200,mask = 6)在exceptions.c:513
#10 0x08080027在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()
猜测:
Emacs的gud模式要求gdb运行,注释开启,以便它可以正确解析输出。在重写默认行emacs之后,我碰到过M-x gdb之后,我一直在这一点。确保您的gdb命令行中包含--annotate = 3,看看是否有帮助。
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.
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. 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.
This is gdb v6.8 on Linux Centos v4 32bit.
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:
#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. I've been bit by this when rewriting the default line emacs spits out after hitting M-x gdb. Make sure that "--annotate=3" is included on your gdb command line and see if that helps.
这篇关于在Emacs中使用gdb 23的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!