Vivek Goel
Vivek Goel

Reputation: 24160

gdbserver loading symbol table from remote file

I am trying to use gdbserver...
I have an application with binary path /user/bin/foo running with pid 19767.

Started the gdbserver on remote:

gdbserver  --remote-debug --multi 0:12347 

Started gdb on client and connected it to remove server

target extended-remote 192.168.1.84:12347

Attached gdb on pid

attach 19767

It shows:

warning: Could not load vsyscall page because no executable was specified
try using the "file" command first.
0x00007f207550043c in ?? ()

Also, current thread information it is showing is incorrect. Like info threads shows 1 thread , but my app has 10 threads-

(gdb) info threads
* 1 Thread 19767.19767  0x00007f207550043c in ?? ()

How can I ask gdb to load symbol from remote file /user/bin/foo? How to make it show correct info?

Upvotes: 9

Views: 7972

Answers (2)

Employed Russian
Employed Russian

Reputation: 213937

How can I ask gdb to load symbol from remote file /user/bin/foo

You can't.

Update:

As of GDB 7.0 you can, using set sysroot target:/path/to/file/on/target. Documentation.


Old answer:

You can't. Copy remote /usr/bin/foo locally (or mount the filesystem it's on), and then invoke gdb like this: gdb /path/to/copy/of/foo, or just use the file command.

Upvotes: 3

HexMachina
HexMachina

Reputation: 146

As of gdb 7.10, you can use

set sysroot target:

to make gdb retrieve files from the remote filesystem. See https://sourceware.org/gdb/onlinedocs/gdb/Files.html#Files

Upvotes: 7

Related Questions