首页 > 数据库技术 > 详细

gdb+gdbserver找不到符号文件的问题

时间:2015-11-23 14:52:25      阅读:1021      评论:0      收藏:0      [点我收藏+]

远端gdbserver已经起来,本地使用gdb已经连接上gdbserver,但是本地提示找不到符号文件:

warning: Could not load vsyscall page because no executable was specified

try using the "file" command first.

那么使用file命令,指定被调试的可执行文件即可:

file /opt/linuxshare/helloworld/main


这里要注意一下,file指定的main已经是一个ELF可执行文件,也就是正在被调试的程序,另外,这个文件其实是存在于远端磁盘上,但是已经被mount到了本地机器上。


file成功后即可看到源码:

(gdb) file /opt/linuxshare/helloworld/main

A program is being debugged already.

Are you sure you want to change the file? (y or n) y

Reading symbols from /opt/linuxshare/helloworld/main...done.

(gdb) b main

Breakpoint 1 at 0x40055c: file main.c, line 3.

(gdb) info b

Num     Type           Disp Enb Address            What

1       breakpoint     keep y   0x000000000040055c in main at main.c:3

(gdb) l

1 #include <stdio.h>

2 int main() {

3    printf("Hello World\n");

4

5    int i = 0;

6    while(1)

7    {

8 sleep(3);

9 printf("time: %d\n", ++i);

10    }


gdb+gdbserver找不到符号文件的问题

原文:http://1038741.blog.51cto.com/1028741/1715919

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!