Ubuntu --warning: Could not load GDB remote debugging vsyscall page because no e

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

1 first install GDBSERVER

apt-get install gdbserver

2 to compile the -g program

gcc -g test_gdb.c -o test_gdb

The following source code:

#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 in the server terminal executes the following statement:

gdbserver 192.168.110.138:9002 ./test_gdb

There will be the following sentence

tiger@ubuntu:/mnt/hgfs/e/Lessons/MyExercise/UtilLibs/THREAD$ gdbserver 192.168.115.250:9002 ./test_gdb
Process ./test_gdb created; pid = 23562
Listening on port 9002

Execute the following a few words in client terminal:

1. gdb

Below these things:

[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:9001
Remote debugging using 192.168.115.250:9001
warning: Could not load vsyscall page because no executable was specified
try using the "file" command first.
0xb7fdf1d0 in ?? ()

2 executive:

  target remote:192.168.115.250:9002

3 executive:

  symbol-file  remote:192.168.115.250:9002

The 4 call is similar to continue, break orders.


Reference resources

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Kay at November 13, 2013 - 2:58 AM