This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Target execution sigsegv


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]