This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] gdbserver regcache fetch all regs
- From: Doug Evans <dje at google dot com>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 19 Jun 2009 08:35:13 -0700
- Subject: Re: [patch] gdbserver regcache fetch all regs
- References: <h19gl1$t66$1@ger.gmane.org>
On Tue, Jun 16, 2009 at 6:24 PM, Aleksandar Ristovski<aristovski@qnx.com> wrote:
> Hello,
>
> I believe this is a bug in gdbserver/regcache.c
>
> Current code fetches regno 0 and marks regcache valid. I believe correct
> should be: fetch all regs, and mark regache valid.
> [...];
> ChangeLog:
>
>
> * regcache.c (get_regcache): Fetch all registers instead of
> regno 0 only.
>
Hi. At first I thought "Yikes!". :-)
But it turns out that all fetch_registers routines treat 0 and -1 equivalently.
I wouldn't hold up this patch (it's fine with me fwiw), though I would
change the ChangeLog entry to something like: "Use -1 instead of 0 to
fetch all registers." since passing 0 does actually fetch all
registers.
It would be good to remove this oddity and stop the conflation of 0
and -1, but I don't know what would break.
We could run the testsuite and see what happens as a start.
Does anyone know the history behind this?