This is the mail archive of the gdb-cvs@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]

src/gdb ChangeLog libunwind-frame.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2011-01-13 16:23:22

Modified files:
	gdb            : ChangeLog libunwind-frame.c 

Log message:
	[libunwind-frame] handle functions with no minimal symbol/debug info.
	
	This is something that I am seeing on ia64-hpux while trying to
	backtrace from a thread that's doing a wait:
	
	(gdb) task 2
	[Switching to task 2]
	0x9fffffffef52f590 in __ksleep () from /[...]/libc.so.1
	(gdb) bt
	#0  0x9fffffffef52f590 in __ksleep () from /[...]/libc.so.1
	#1  0x9fffffffef73c870 in __sleep_1x1 () from /[...]/libpthread.so.1
	#2  0x9fffffffef738fe0 in __mxn_sleep () from /[...]/libpthread.so.1
	#3  0x9fffffffef675e90 in ?? () from /[...]/libpthread.so.1
	
	The backtrace is incomplete and stops at frame #3, but there are in fact
	a few more frames.
	
	The reason why we stopped the backtrace is related to the fact that
	we were not able to determine the start address of the function
	corresponding to the frame PC.  This is visible at the user level
	thanks to the "??" that GDB displayed for frame 3.
	
	We have the following code in libunwind-frame.c:libunwind_frame_cache
	which explicitly returns a NULL cache when we couldn't determine the
	frame's function address, immediately triggering an end-of-stack
	frame_id, thus terminating the backtrace:
	
	/* We can assume we are unwinding a normal frame.  Even if this is
	for a signal trampoline, ia64 signal "trampolines" use a normal
	subroutine call to start the signal handler.  */
	cache->func_addr = get_frame_func (this_frame);
	if (cache->func_addr == 0
	&& get_next_frame (this_frame)
	&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME)
	return NULL;
	
	As explained in the comment, I think we can still go on, and use
	the unwind record to do the debugging.  This change imlements this
	change, and allows us to get the full backtrace.
	
	gdb/ChangeLog:
	
	* libunwind-frame.c (libunwind_frame_cache): Do not return NULL
	if we could not determine the frame's function address.  Instead,
	use the frame's PC, and then continue.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12469&r2=1.12470
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/libunwind-frame.c.diff?cvsroot=src&r1=1.30&r2=1.31


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