Target execution sigsegv

Vincent De Groote list.encelade@gmail.com
Sat Apr 18 18:56:00 GMT 2009


Hello,

I'm new to cross debugging and I have the following problem:

When I run a program on the target machine, it runs without errors
When i run the same program using gdb on the target machine, it runs 
without errors
When I run the same program using gdbserve on the target machine, and 
gdb on the host machine, a sigsegv trap always occurs.

Context:

The target machine is a linux machine, running the last ubuntu  os:

'gcc --version' shows 'gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2'
'gdbserver --version' shows 'GNU gdbserver 6.8-debian [...] This 
gdbserver was configured as "i486-linux-gnu"',
'gdb --version' shows 'GNU gdb 6.8-debian [...] This GDB was configured 
as "i486-linux-gnu".'

The host machine is a windows xp machine, under cygwin.  I just built 
the gdb
'gdb --version' shows 'GNU gdb 6.8 [...] This GDB was configured as 
"--host=i686-pc-cygwin --target=i486-linux-gnu".

The program I'm using is the following:

#include <stdio.h>

int my_function ( int a, int b, int c ) {

        return a + b + c;

}

int main ( int argc, char ** argv ) {

        int result;

        result = my_function ( 1, 2, 3 );
        printf ("Result = %d\n", result );
        return( 0);
}


Using the gdb on the host machine, a sigsegv occurs in the printf 
function call.

What should I do to make this work ?

Thanks for your replies and your time

Vincent De Groote



More information about the Gdb mailing list