Debugging with GDB in Remote Emacs

I am trying to use gdb in emacs, I have gdb, but the first command I need to enter is for example:

target remote 192.168.1.1:1234 

for communication with the goal. I type this on (gdb) after I have output from gdb about versions. For some reason, gdb in emacs does not respond to this command and instead does nothing. It works fine on the command line in the shell, so I thought it would just work in emacs. Does anyone have any ideas as to why this will not work in emacs?

thanks for the help

+4
source share
2 answers

See the appropriate section of the tram documentation - you can use Tramp with gdb for remote debugging. For instance:

Mx GDB RET

Run gdb (like this): gdb --annotate = 3 / ssh: host: ~ / myprog RET

+2
source

what you really want is to run gdb as follows:

Mx gdb ret

gdb --annotate = 3 myprog

(gdb) target remote 192.168.1.1:1234

The key looks like -annotate = 3, I'm not sure what tramp is or why you want to use ssh for something (gdb will connect directly to the host that you pass it to), but this works for me. I had the same problem connecting qemu to localhost.

+1
source

All Articles