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]

[PATCH] gdb backtrace grace


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.

- 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


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