Using gdb in Emacs 23
Asked Answered
J

2

7

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 ()
Jerrold answered 30/9, 2009 at 1:17 Comment(0)
A
11

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.

Alage answered 30/9, 2009 at 13:49 Comment(5)
Yes, --annotate=3 is there by default.Jerrold
I use gdb in emacs-23.1 without any problems. What happens if you use text mode instead of graphical mode by using M-x gud-gdb? Be sure not to remove the --fullname option from the gdb command line.Alage
So is M-x gdb not supported anymore? Am I losing anything by doing M-x gud-gdb instead?Jerrold
M-x gdb is still supported, and I use it all the time. Your problem is indicative of not having annotations turned on (--annotate=3 on the gdb command line). With gud-gdb you don't get the "visual" features of gdb in emacs. This includes things like the dedicated stack and local variable buffers in "gdb many windows mode". Maybe something in your emacs configuration is breaking visual mode, have you tried starting emacs with "-q" switch to prevent loading your config file?Alage
Yes, I face the same issue when Emacs is started with -q and I have the --annotate=3 passed to gdb.Jerrold
S
1

I have used gdb in emacs-23... Or at least, I've gotten farther than you... When I tried it, the stack window wouldn't update... What I ended up doing was using emacs-23 for editing (for the anti-aliased font goodness), but using emacs-22 for debugging... You can have both installed...

Skeen answered 30/9, 2009 at 14:4 Comment(1)
Yes, that is what I'm doing (running both) but I was hoping to just have one running, as it is more efficient to have a unified system instead of being split across two executable instances of emacs.Jerrold

© 2022 - 2024 — McMap. All rights reserved.