I am following the tutorial Open GDB (within Emacs for added functionality) on Emacs 25.2.1 with Evil Spacemacs and Ivy (the commands gud-gdb and gdb get the same results):
SPC f f (counsel-find-file) Find file: tutorial/foo.c
SPC c C (compile) Compile command: gcc -g -o foo foo.c
SPC SPC M-x gud-gdb foo (match required)
SPC SPC M-x gud-gdb
Run gud-gdb (like this): gud-gdb foo
What does "like this" mean?
It opens GUD interaction buffer *gud-avg*
.
avg
is the name of a previous program I was trying to debug.
Update: the GUD interaction buffer now opens to *gud-foo*
.
Any how, the GUD interaction buffer did open, but it's broken:
(gdb) list
Undefined command: "-interpreter-exec". Try "help".
(gdb) help
Undefined command: "-interpreter-exec". Try "help".
M-x gdb
and notM-x gud-gdb
. Note, that the grand unified debugger is not that grand. You could also try realgud. – Tobias Jun 28 '17 at 20:58gdb
. Forgdb
the source of the error is pretty clear if you only use the command linegdb foo
. You are missing the command line argument-i=mi
. That argument says thatgdb
should provide the line based machine oriented text interface. It is unclear however why the emacs-commandgdb
does not include that command line argument in its default input. Did you edit the command line? The command line should readgdb -i=mi foo
instead ofgdb foo
. – Tobias Jun 29 '17 at 3:50