Debugging--GDB Remote Debugging

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.