why gdb analyse coredump file different for x86 and arm

tong.changda@zte.com.cn tong.changda@zte.com.cn
Mon Dec 14 06:06:00 GMT 2009


I have seen some discussion about this. But it seems no clear conclusion.
 I use gdb to analyse the coredump file generate on x86 and arm. gdb could 
clear analyse x86's corefile , arm not.

x86 version gdb is:  GNU gdb Red Hat Linux (6.5-37.el5rh)
arm version gdb is:  GNU gdb (Sourcery G++ Lite 2008q1-126) 
6.7.50.20080107-cvs
arm version gcc is : gcc version 4.2.3 (Sourcery G++ Lite 2008q1-126

a sample code compile by gcc, and arm-none-linux-gnueabi-gcc, and run 
under x86 box and arm board

int main()
{
        char *p = NULL;
        memcpy(p, "test", 4);  //if i replace this line with while(1){}; 
run and send sig 11, arm coredump file could clearly show stack
}

both was compile with  -g -O0 -fno-omit-frame-pointer -o test test.c

and run 
arm-none-linux-gnueabi-gdb -c core -s test
and
gdb  -c core -s test

the x86 shows
#0  0x08048243 in main () at test.c:7

the arm version shows
#0  0x00011e1c in memcpy ()
#1  0x74736574 in ?? ()
Backtrace stopped: frame did not save the PC

I wish the arm could clearly show the err line. Could anyone point out a 
right verson of arm gcc to work properly?

Thank you



More information about the Gdb mailing list