sudo apt-get gdb-server,
"--warning:could not load Vsyscall page because no executable is specified" may appear during client debugging
Follow these steps:
I just encountered this problem myself then I used a cross-compiled gdb (you'll in general need this if your remote host has a different architecture). The symbols need to is read from the binary compiled on the remote host. I figured out this following works for me (also if the architectures on the hosts is the the same):
(1) on the remote host:
#gdbserver [host]:[port] [remote-path-to-binary-from-gdbserver-workdir]
即gdbserver [host]:[port] [要调试的二进制文件全路径]
(2) and then on the Local host in (cross-compiled) GDB:
shell sleep 5
#gdb
(gdb)target remote [host]:[port](gdb)symbol-file remote:[remote-path-to-binary-from-gdbserver-workdir](gdb)directory [local-root-directory-for-source-files]
注意: 本地源文件所在目录, 本地要有源文件.(gdb)continue
Replace the with [*]
your data. You can use it as a gdb script (hence the first line sleep
) or enter it on your GDB command line. The optional directory line tells it to add the local source directory to the search path for sources. This can is useful if you use a frontend which points the source code.
Http://stackoverflow.com/questions/14014288/gdb-remote-debugging-cant-seem-to-find-symbols
Debugging--GDB Remote Debugging