public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* trouble with gdb backtraces on ppc with gcc4
@ 2005-11-09 13:05 Olaf Hering
  2005-11-09 13:41 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2005-11-09 13:05 UTC (permalink / raw)
  To: gdb


the backtraces in gdb 6.3 and also in gdb-mainline are usually broken in
openSuSE. How does gdb generate them? I guess gdb needs to deal with the
gcc generated debug info. It seems this fails in many cases, as a result
I get a loop:

 main.c
#include <stdio.h>
extern int t1(int);
extern int t2(int);
int main(void)
{
	int i = 0;
	while (i++)
		i = t1(i) * t2(i);
	printf("i %d\n", i);
	return 0;
}

 t1.c
#include <stdio.h>
int t1(int i)
{
	printf("i %d\n", i);
	return i + 1;
}
 t2.c
int t2(int i)
{
	return i + 2;
}

 gcc -O1 -g -c *.c -Wall && gcc -o t *.o && /usr/bin/gdb t

r
...
i -1525098859
i -250087813
i -1598913907
i -255915693
i 155071
Program received signal SIGINT, Interrupt.
0x0ff6443c in __write_nocancel () from /lib/tls/libc.so.6
(gdb) bt
#0  0x0ff6443c in __write_nocancel () from /lib/tls/libc.so.6
#1  0x0ff141c4 in _IO_new_file_write () from /lib/tls/libc.so.6
#2  0x0ff126e0 in new_do_write () from /lib/tls/libc.so.6
#3  0x0ff12898 in _IO_new_do_write () from /lib/tls/libc.so.6
#4  0x0ff13424 in _IO_new_file_overflow () from /lib/tls/libc.so.6
#5  0x0ff143f4 in _IO_new_file_xsputn () from /lib/tls/libc.so.6
#6  0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
#7  0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
#8  0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
#9  0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
#10 0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
#11 0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
#12 0x0feeb990 in vfprintf () from /lib/tls/libc.so.6
Previous frame inner to this frame (corrupt stack?)
(gdb) 



SLES9 does a better job:

...
i -2042139181
i -1862425
Program received signal SIGINT, Interrupt.
0x0ff6dc10 in __write_nocancel () from /lib/tls/libc.so.6
(gdb) bt
#0  0x0ff6dc10 in __write_nocancel () from /lib/tls/libc.so.6
#1  0x0ff20ee4 in _IO_new_file_write () from /lib/tls/libc.so.6
#2  0x0ff20b34 in new_do_write () from /lib/tls/libc.so.6
#3  0x0ff20e68 in _IO_new_do_write () from /lib/tls/libc.so.6
#4  0x0ff218e8 in _IO_new_file_overflow () from /lib/tls/libc.so.6
#5  0x0ff20db8 in _IO_new_file_xsputn () from /lib/tls/libc.so.6
#6  0x0fefc8f8 in vfprintf () from /lib/tls/libc.so.6
#7  0x0ff0361c in printf () from /lib/tls/libc.so.6
#8  0x100004cc in t1 (i=-1862425243) at t1.c:4
#9  0x10000458 in main () at main.c:8


-- 
short story of a lazy sysadmin:
 alias appserv=wotan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-09 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-09 13:05 trouble with gdb backtraces on ppc with gcc4 Olaf Hering
2005-11-09 13:41 ` Andreas Schwab
2005-11-09 14:02   ` Olaf Hering
2005-11-09 14:17     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).