From: Daniel Jacobowitz <drow@false.org>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Eliminate use of deprecated_register_bytes() from remote.c
Date: Wed, 27 Apr 2005 15:40:00 -0000 [thread overview]
Message-ID: <20050427154018.GB7765@nevyn.them.org> (raw)
In-Reply-To: <20050415161212.28c1d511@ironwood.lan>
On Fri, Apr 15, 2005 at 04:12:12PM -0700, Kevin Buettner wrote:
> On Fri, 15 Apr 2005 17:37:58 -0400
> Daniel Jacobowitz <drow@false.org> wrote:
>
> > On Fri, Apr 15, 2005 at 02:32:45PM -0700, Kevin Buettner wrote:
> > > This one seems almost obvious, but I'd like someone else to look it
> > > over before I check it in...
> > >
> > > * remote.c (init_remote_state): Eliminate use of
> > > deprecated_register_bytes().
> >
> > I'm pretty sure you need an if (regnum < NUM_REGS) on the second piece.
>
> I agree that that's the right thing to do, but I'm not convinced that
> will give us behavior equivalent to what we have now. Consider the
> following comment/code from regcache.c:
>
> /* FIXME: cagney/2002-05-22: Should only need to allocate space for
> the raw registers. Unfortunately some code still accesses the
> register array directly using the global registers[]. Until that
> code has been purged, play safe and over allocating the register
> buffer. Ulgh! */
> descr->sizeof_raw_registers = descr->sizeof_cooked_registers;
>
> The ``sizeof_raw_registers'' field is the value returned by
> deprecated_register_bytes(). So, it seems to me that we're presently
> setting rs->sizeof_g_packet to a value that's potentially larger than
> need be.
You are definitely right. That's an Ulgh indeed.
> I can think of no reason to continue to over-allocate space for g/G
> packets in remote.c so I'm happy with this patch instead (which adds
> the test that you wanted):
>
> * remote.c (init_remote_state): Eliminate use of
> deprecated_register_bytes().
This is fine with me.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-04-27 15:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-15 21:32 Kevin Buettner
2005-04-15 21:38 ` Daniel Jacobowitz
2005-04-15 23:12 ` Kevin Buettner
2005-04-27 15:40 ` Daniel Jacobowitz [this message]
2005-04-28 18:16 ` Kevin Buettner
2005-04-29 22:59 ` Michael Snyder
2005-05-02 19:39 ` Kevin Buettner
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=20050427154018.GB7765@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
/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