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

Re: [PATCH] gdb backtrace grace


On Wed, Jun 11, 2008 at 07:06:27PM -0400, Chris Frey wrote:
> Hi folks,
> 
> This patch was the result of the following bug, which I've stumbled across
> by accident in my travels:
> 
> 	https://bugzilla.novell.com/show_bug.cgi?id=390722
> 
> It increases the usefulness of gdb backtraces on systems with incomplete
> debug info.  The patch is by Michael Meeks and Michael Matz.  I am merely
> an observer.
> 
> I didn't see it in gdb's CVS tree yet, and I didn't find it in the mailing
> list archives.  I'm forwarding it here, since it seems important enough
> that I didn't want to see it missed.  I apologise in advance if this is
> duplicated.

Mark, could you take a look at this patch?

On a related note I've been thinking of adding a "tentative" or
"uncertainty" setting to unwind results.  That would let us solve
certain kinds of infinite / garbage backtraces by cutting off by
default if we find too many uncertain frames in a row.  That might
apply here, too.

> 
> - Chris
> 
> P.S. I'm not on this mailing list, please CC me if you need to reach me.
> 
> 
> 
> Index: gdb/i386-tdep.c
> ===================================================================
> --- gdb/i386-tdep.c.orig
> +++ gdb/i386-tdep.c
> @@ -1023,11 +1023,13 @@ i386_frame_cache (struct frame_info *nex
>  	  /* This will be added back below.  */
>  	  cache->saved_regs[I386_EIP_REGNUM] -= cache->base;
>  	}
> -      else
> +      else if (cache->pc)
>  	{
>  	  frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
>  	  cache->base = extract_unsigned_integer (buf, 4) + cache->sp_offset;
>  	}
> +      else
> +	cache->saved_regs[I386_EBP_REGNUM] = 0;
>      }
>  
>    /* Now that we have the base address for the stack frame we can
> 

-- 
Daniel Jacobowitz
CodeSourcery


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