您好,登錄后才能下訂單哦!
遠端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 }
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。