Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: New ARI warning Sat Mar 19 01:54:11 UTC 2011
Date: Wed, 23 Mar 2011 18:21:00 -0000	[thread overview]
Message-ID: <201103231742.17098.pedro@codesourcery.com> (raw)
In-Reply-To: <20110323171601.GH2520@adacore.com>

On Wednesday 23 March 2011 17:16:01, Joel Brobecker wrote:
> > This was a large diff, but in fact, there is only one new warning:
> > 
> > > gdb/i386-tdep.c:1693: obsolete: frame_register_read: Replace frame_register_read() with get_frame_register(), or possibly introduce a new method safe_get_frame_register()
> > gdb/i386-tdep.c:1693:     && frame_register_read (this_frame, cache->saved_sp_reg, buf))
> 
> I just had a look at this ARI warning.  The comment on
> frame_register_read says:
> 
> /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a
>    function called get_frame_register_p().  This slightly weird (and
>    older) variant of get_frame_register() returns zero (indicating the
>    register value is unavailable/invalid) if either: the register
>    isn't cached; or the register has been optimized out; or the
>    register contents are unavailable (because they haven't been
>    collected in a traceframe).  Problem is, neither check is exactly
>    correct.  A register can't be optimized out (it may not have been
>    saved as part of a function call); The fact that a register isn't
>    in the register cache doesn't mean that the register isn't
>    available (it could have been fetched from memory).  */
> 
> I have had this feeling that we have way too many ways to read/write
> frame registers, but I'm wondering if this comment might not be
> too zealous in this case. This function seems useful, because it
> returns a status as opposed to get_frame_register, which has the exact
> same profile except that it throws instead of returning. So I'm thinking
> we should remove the "deprecation" fixme, and just keep the FIXME for
> fixing whatever incorrectness might be left, and then remove this from
> the ARI.
> 
> Thoughts?

Agreed.

-- 
Pedro Alves


  reply	other threads:[~2011-03-23 17:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19 17:32 GDB Administrator
2011-03-19 21:14 ` Joel Brobecker
2011-03-23 17:42   ` Joel Brobecker
2011-03-23 18:21     ` Pedro Alves [this message]
2011-03-24 18:32       ` Ulrich Weigand
2011-03-25 16:05         ` Joel Brobecker
2011-03-25 19:19           ` Ulrich Weigand

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=201103231742.17098.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --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