Ubuntu下gdb遠端偵錯--warning: Could not load vsyscall page becaus

來源:互聯網
上載者:User

Ubuntu下gdb遠端偵錯--warning: Could not load vsyscall page because no executable was specified解決方案 1. 首先安裝gdbserver apt-get install gdbserver 2. 編譯-g 程式 gcc -g test_gdb.c -o test_gdb 源碼如下: #include "Util.h"  void p1(){    int j = 0;    char *p;        *p = '5';     printf("%p  %c",p,*p);    do    {        j++;    }while(j < 10);  } void p2(){    int j = 0;     while(j < 20)    {        j = j + j*j;    } } int main(int argc,char **argv){     CreateGerneralThread(p1);     CreateGerneralThread(p2);      while(1)    {        sleep(1);    }    return 0;} 3. 在server端執行下面語句: gdbserver 192.168.110.138:9002 ./test_gdb 會出現下面這句話 tiger@ubuntu:/mnt/hgfs/e/Lessons/MyExercise/UtilLibs/THREAD$ gdbserver 192.168.115.250:9002 ./test_gdbProcess ./test_gdb created; pid = 23562Listening on port 9002 在client端執行下面幾句話: 1. gdb 出現下面這些東西: [root@localhost ~]# gdb           GNU gdb (GDB) Fedora (7.3.50.20110722-9.fc16)Copyright (C) 2011 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.  Type "show copying"and "show warranty" for details.This GDB was configured as "x86_64-redhat-linux-gnu".For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.(gdb) target remote 192.168.115.250:9001Remote debugging using 192.168.115.250:9001warning: Could not load vsyscall page because no executable was specifiedtry using the "file" command first.0xb7fdf1d0 in ?? () 2. 執行:   target remote:192.168.115.250:9002 3. 執行:   symbol-file  remote:192.168.115.250:9002 4. 可以調用類似continue , break 等命令了
 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.