This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] gdb backtrace grace
- From: Daniel Jacobowitz <drow at false dot org>
- To: Chris Frey <cdfrey at foursquare dot net>
- Cc: gdb-patches at sourceware dot org, Mark Kettenis <kettenis at gnu dot org>
- Date: Thu, 26 Jun 2008 10:12:11 -0400
- Subject: Re: [PATCH] gdb backtrace grace
- References: <20080611230627.GA16939@foursquare.net>
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:
> 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
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