Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Andrew Stubbs <ams@codesourcery.com>
Cc: gdb@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [commited] Detect bad debug info
Date: Wed, 24 Sep 2008 12:18:00 -0000	[thread overview]
Message-ID: <jeej39zqja.fsf@sykes.suse.de> (raw)
In-Reply-To: <48D3EC6C.8050809@codesourcery.com> (Andrew Stubbs's message of 	"Fri, 19 Sep 2008 19:16:12 +0100")

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."


       reply	other threads:[~2008-09-24 12:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48D3EC6C.8050809@codesourcery.com>
2008-09-24 12:18 ` Andreas Schwab [this message]
2008-09-24 13:00   ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jeej39zqja.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=ams@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox