Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: gdb-patches@sourceware.org
Subject: Re: [rfc, frame] Always check for unsaved PC
Date: Thu, 11 Jan 2007 16:34:00 -0000	[thread overview]
Message-ID: <jevejdh69d.fsf@sykes.suse.de> (raw)
In-Reply-To: <20061110201548.GA1115@nevyn.them.org> (Daniel Jacobowitz's 	message of "Fri, 10 Nov 2006 15:15:48 -0500")

Daniel Jacobowitz <drow@false.org> writes:

> @@ -1111,6 +1141,42 @@ get_prev_frame_1 (struct frame_info *thi
>        return NULL;
>      }
>  
> +  /* Check that this and the next frame do not unwind the PC register
> +     to the same memory location.  If they do, then even though they
> +     have different frame IDs, the new frame will be bogus; two
> +     functions can't share a register save slot for the PC.  This can
> +     happen when the prologue analyzer finds a stack adjustment, but
> +     no PC save.  This check does assume that the "PC register" is
> +     roughly a traditional PC, even if the gdbarch_unwind_pc method
> +     frobs it.  */
> +  if (this_frame->level > 0
> +      && get_frame_type (this_frame) == NORMAL_FRAME
> +      && get_frame_type (this_frame->next) == NORMAL_FRAME)
> +    {
> +      int optimized, realnum;
> +      enum lval_type lval, nlval;
> +      CORE_ADDR addr, naddr;
> +
> +      frame_register_unwind_location (this_frame, PC_REGNUM, &optimized,
> +				      &lval, &addr, &realnum);
> +      frame_register_unwind_location (get_next_frame (this_frame), PC_REGNUM,
> +				      &optimized, &nlval, &naddr, &realnum);
> +

This is broken.  You can't use PC_REGNUM unconditionally without checking
whether that register actually exists.  The ia64 does not have such a
register.

Andreas.

-- 
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:[~2007-01-11 16:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-20 13:58 Daniel Jacobowitz
2006-08-20 16:28 ` Mark Kettenis
2006-08-21 15:58   ` Daniel Jacobowitz
2006-08-22 21:36     ` Mark Kettenis
2006-08-23  9:57       ` Daniel Jacobowitz
2006-11-10 20:16   ` Daniel Jacobowitz
2007-01-11 16:34     ` Andreas Schwab [this message]
2007-01-11 16:45       ` Daniel Jacobowitz
2007-01-11 17:15         ` Andreas Schwab
2007-01-11 17:18           ` Daniel Jacobowitz

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=jevejdh69d.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=gdb-patches@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