This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] Use AMD64_RX_REGNUM for X from 8 to 15 ind amd64*tdep.c sources
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Joel Brobecker'" <brobecker at adacore dot com>
- Cc: "'gdb-patches'" <gdb-patches at sourceware dot org>
- Date: Thu, 26 Sep 2013 09:01:34 +0200
- Subject: RE: [RFA] Use AMD64_RX_REGNUM for X from 8 to 15 ind amd64*tdep.c sources
- Authentication-results: sourceware.org; auth=none
- References: <000001ceb580$51869960$f493cc20$ at muller@ics-cnrs.unistra.fr> <20130926003349 dot GA3359 at adacore dot com>
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Joel Brobecker
> Envoyé : jeudi 26 septembre 2013 02:34
> À : Pierre Muller
> Cc : 'gdb-patches'
> Objet : Re: [RFA] Use AMD64_RX_REGNUM for X from 8 to 15 ind amd64*tdep.c
> sources
>
> > 2013-09-19 Pierre Muller <muller@sourceware.org>
> >
> > Replace constant values 8 to 15 by AMD64_R8_REGNUM to
> > AMD64_R15_REGNUM when a register index is expected.
> > * amd64-windows-tdep.c (amd64_windows_dummy_call_integer_regs):
> > Ditto.
> > * amd64-tdep.c (amd64_dummy_call_integer_regs): Ditto.
> > (amd64_dwarf_regmap): Ditto.
>
> I think it's enough of a clear improvement that I can review
> instead of asking MarkK to do it.
>
> For the amd64-tdep.c portion, the recent patches moved the
> amd64_dummy_call_integer_regs array back inside amd64_push_arguments,
> named integer_regnum. You'll need to adjust the patch accordingly.
>
> For the record, the amd64_windows_dummy_call_integer_regs
> array had to be preserved, because it's shared between a coupe of
> gdbarch methods.
>
> So, patch pre-approved with the adjustment I mentioned in amd64-tdep.c.
Patch applied after the needed cange,
Thank you for the approval.
Pierre Muller
This is what I committed:
2013-09-26 Pierre Muller <muller@sourceware.org>
Replace constant values 8 to 15 by AMD64_R8_REGNUM to
AMD64_R15_REGNUM when a register index is expected.
* amd64-windows-tdep.c (amd64_windows_dummy_call_integer_regs):
Substitute in array.
* amd64-tdep.c (amd64_dwarf_regmap): Ditto.
(amd64_push_arguments): Substitute in integer_regnum array.
Index: amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.120
diff -u -p -r1.120 amd64-tdep.c
--- amd64-tdep.c 24 Sep 2013 16:14:15 -0000 1.120
+++ amd64-tdep.c 26 Sep 2013 06:54:06 -0000
@@ -109,7 +109,14 @@ static int amd64_dwarf_regmap[] =
AMD64_RSP_REGNUM,
/* Extended Integer Registers 8 - 15. */
- 8, 9, 10, 11, 12, 13, 14, 15,
+ AMD64_R8_REGNUM, /* %r8 */
+ AMD64_R9_REGNUM, /* %r9 */
+ AMD64_R10_REGNUM, /* %r10 */
+ AMD64_R11_REGNUM, /* %r11 */
+ AMD64_R12_REGNUM, /* %r12 */
+ AMD64_R13_REGNUM, /* %r13 */
+ AMD64_R14_REGNUM, /* %r14 */
+ AMD64_R15_REGNUM, /* %r15 */
/* Return Address RA. Mapped to RIP. */
AMD64_RIP_REGNUM,
@@ -758,8 +765,8 @@ amd64_push_arguments (struct regcache *r
AMD64_RSI_REGNUM, /* %rsi */
AMD64_RDX_REGNUM, /* %rdx */
AMD64_RCX_REGNUM, /* %rcx */
- 8, /* %r8 */
- 9 /* %r9 */
+ AMD64_R8_REGNUM, /* %r8 */
+ AMD64_R9_REGNUM /* %r9 */
};
static int sse_regnum[] =
{
Index: amd64-windows-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-windows-tdep.c,v
retrieving revision 1.18
diff -u -p -r1.18 amd64-windows-tdep.c
--- amd64-windows-tdep.c 24 Sep 2013 16:13:40 -0000 1.18
+++ amd64-windows-tdep.c 26 Sep 2013 06:54:06 -0000
@@ -38,8 +38,8 @@ static int amd64_windows_dummy_call_inte
{
AMD64_RCX_REGNUM, /* %rcx */
AMD64_RDX_REGNUM, /* %rdx */
- 8, /* %r8 */
- 9 /* %r9 */
+ AMD64_R8_REGNUM, /* %r8 */
+ AMD64_R9_REGNUM /* %r9 */
};
/* Return nonzero if an argument of type TYPE should be passed