[commited] Detect bad debug info

Andreas Schwab schwab@suse.de
Wed Sep 24 12:18:00 GMT 2008


Andrew Stubbs <ams@codesourcery.com> writes:

> +  /* Detect bad debug info.  */
> +  maxsize = -offset;
> +  for (i = regnum; i < gdbarch_num_regs (gdbarch); i++)

This is broken, it completely ignores the pseudo regs, which badly
breaks ia64 and many other targets.  Committed as obvious.

Andreas.

2008-09-24  Andreas Schwab  <schwab@suse.de>

	* frame.c (get_frame_register_bytes): Take pseudo registers into
	account.

--- frame.c.~1.253.~	2008-09-23 11:46:45.000000000 +0200
+++ frame.c	2008-09-24 14:09:33.000000000 +0200
@@ -809,7 +809,8 @@ get_frame_register_bytes (struct frame_i
   /* Ensure that we will not read beyond the end of the register file.
      This can only ever happen if the debug information is bad.  */
   maxsize = -offset;
-  for (i = regnum; i < gdbarch_num_regs (gdbarch); i++)
+  for (i = regnum;
+       i < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); i++)
     {
       int thissize = register_size (gdbarch, i);
       if (thissize == 0)

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gdb mailing list