Reputation: 4164
I want to use emacs to remotely run gdb over ssh, then from that remote gdb, target a remote debug server. I really want to run gdb from within emacs, but x-forwarding emacs has too much latency so I run aquamacs locally on my mac. I run M-x gdb with the command line ssh work-host /path/to/my/gdb
and then from the gdb prompt I can target my remote debug target.
This all works great, but no sources load when I try and step through files. I'm assuming emacs is getting confused at the remote paths the ssh gdb is returning. Is there a way to fix up the paths or at least manually map file paths to debug paths?
Upvotes: 4
Views: 870
Reputation: 213935
x-forwarding emacs has too much latency
So don't. The simplest solution may be to ssh to work-host, and run emacs -nw
there. Alternatively,
ssh work-host /path/to/my/gdb
Don't you want ssh work-host /path/to/my/gdb --annotate=3 /path/to/exe
?
You can tell gdb
where to find sources with the dir
command, but I think your initial problem might be that gdb
isn't telling emacs
about source at all (or else you have not told us the whole story).
Upvotes: 1
Reputation: 107899
This worked for me (Emacs 23 under Linux and GDB 7.0.1; I don't see why this wouldn't work on OSX, and probably even on Windows with a bit of prodding):
M-x gdb --annotate=3 /remote.example.com:a.out
Then start
at the (gdb)
prompt opened /remote.example.com:a.c
.
There is some brief mention of this in the Tramp manual, under “Running a debugger on a remote host”.
Upvotes: 1