Hello, I have problem with gcc3.x and stabs debugging format on powerpc (ppc32 603e). gdb doesn't recognize builtin unsigned int/long formats. I compile the following program with: powerpc-gcc -gstabs a.c int main() { unsigned int a; int b; return 0; } and try to debug it: > gdb a.out (gdb) b main Breakpoint 1 at 0x100003bc: file a.c, line 6. (gdb) r Starting program: a.out Breakpoint 1, main () at a.c:6 6 return 0; (gdb) info locals a = <error type> b = -1 (gdb) q The program is running. Exit anyway? (y or n) y > After little investigation I discovered that gcc emits wrong stabs entry for unsigned int format. .stabs "unsigned int:t(0,4)=r(0,4);0;4294967295;",128,0,0,0 The problem is with the max value. According to gdb source code if the value too big for int it should be emitted in octal. Here is what gcc for intel emits in this case by the way: .stabs "unsigned int:t(0,4)=r(0,4);0;-1;",128,0,0,0 After further investigation I saw that HOST_BITS_PER_WIDE_INT for powerpc is defined to 64 and gdb rightfully things that widest int is 32 bit long on my 32 bit powerpc CPU and bails out since constant from stabs entry is to big. The definition of HOST_BITS_PER_WIDE_INT depends on need_64bit_hwint from config.gcc and it's set to "yes" for all powerpc CPUs there. I've removed definition of need_64bit_hwint for powerpc and the result compiler emits right stab entry now, but it can't compile glibc. The error is in file glibc-2.3.2/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h. It uses __uint128_t and gcc provides it only if HOST_BITS_PER_WIDE_INT is at least 64 bits.
Hmm, what version of gdb is this, since I tried on ppc-darwin and it produces what you consided back stabs and it worked (this is gdb 5.3). Also why use stabs when dwarf-2 works better and most of the time produces small debugging info and still provides more information?
I forgot to mension the gdb I've tried are 6.0 and 6.3. The problem is in the stabsread.c file in function read_huge_number. The stabs produce much smaller output for me. The result file using stabs is 23M and with dwarf-2 70M. I can debug it no my embeded system.
(In reply to comment #1) > Hmm, what version of gdb is this, since I tried on ppc-darwin and it produces what you consided back > stabs and it worked (this is gdb 5.3). > gdb 5.3 doesn't work for me. Do you use vanilla gdb?
Seems to be about a gdb bug.