码迷,mamicode.com
首页 > 数据库 > 详细

调试--gdb远程调试

时间:2014-10-27 20:58:07      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   os   ar   for   sp   strong   文件   

sudo apt-get gdb-server,

client调试时可能会出现 "--warning: Could not load vsyscall page because no executable was specified"

 

按下面步骤操作:

I just encountered this problem myself when I used a cross-compiled gdb (you will in general need this if your remote host has a different architecture). In this case the symbols need to be read from the binary compiled on the remote host. I figured out that the following works for me (also if the architectures on the hosts are 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 sleep in the first line) 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 be useful if you use a frontend which points you to the source code.

 

 

http://stackoverflow.com/questions/14014288/gdb-remote-debugging-cant-seem-to-find-symbols

调试--gdb远程调试

标签:blog   http   io   os   ar   for   sp   strong   文件   

原文地址:http://www.cnblogs.com/lucasysfeng/p/4054928.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!