4

i am trying to use gdb within emacs, i have gdb running but the first command i need to input is for example;

target remote 192.168.1.1:1234 

to communicate with the target. I type this in at (gdb) after I have some 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 a shell so i thought it would simply work in emacs aswell. Does anybody have any ideas as to why this would not work in emacs?

Thanks for your help

2 Answers 2

3

what you actually want is to run gdb like this:

M-x gdb ret

gdb --annotate=3 myprog

(gdb) target remote 192.168.1.1:1234

The key appears to be the --annotate=3, I am not sure what tramp is or why you would want to use ssh for anything (gdb will connect directly to the host you pass to it), but this works for me. I was having the same problem connecting to qemu running on localhost.

Sign up to request clarification or add additional context in comments.

1 Comment

extended-remote is generally better than just remote though
2

Have a look at the relevant section of the tramp documentation - you can use Tramp together with gdb to debug remotely. For example:

M-xgdbRET

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.