hello Pierre, On Wed, Oct 01, 2014 at 06:10:47PM +0200, Pierre Muller wrote: > dwarf register number is defined in > "System V Application Binary Interface > AMD64 Architecture Processor Supplement > Draft Version 0.99.6" > The amd64_dwarf_regmap array > is missing the 8 MMX registers > in Figure 3.36: DWARF Register Number Mapping page 57. > This leads to a wrong value for the > registers past this point. > > I don't know if there are already > cases where this really fixes a problem, > but it is nevertheless a valid correction. > > Is this OK, or is there a valid reason for > this "miss"? > > Pierre Muller > Pascal language maintainer of GDB > > > > 2014-10-01 Pierre Muller > > * amd64-tdep.c (amd64_dwarf_regmap array): Fix amd64 dwarf > register numbering, by adding missing MMX registers. I am so sorry for such a long delay in reviewing your patch. I was also able to confirm that GCC also uses 41-48 for those registers, so your patch is also improving compatibility with GCC (my main concern was to make sure that GDB's numbering was not made on purpose for the sake of supporting something invalid in GCC). The patch is essentially approved, with some minor comments. For my penitence, I made the adjustments, and pushed your patch after having re-tested it on x86_64-linux. Comments below: > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index 7c8575a..b98bc5d 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -201,7 +201,11 @@ static int amd64_dwarf_regmap[] = > AMD64_ST0_REGNUM + 4, AMD64_ST0_REGNUM + 5, > AMD64_ST0_REGNUM + 6, AMD64_ST0_REGNUM + 7, > > - /* Control and Status Flags Register. */ > + /* MMX Registers 0 - 7. Currently not handled, > + see "tdep->num_mmx_regs = 0;" below. */ > + -1, -1, -1, -1, -1, -1, -1, -1, > + > + /* Control and Status Flags Register. */ You were adding a space before the "Control and Status" comment, which is probably unintentional. I removed it. I changed the command to explain that those registers are in fact handled (see the routines that convert between GDB and dwarf numbers). They just need special handling because the associated numbers in GDB depend on the target, and on whether those registers are in fact available or not. Attached is what I pushed for you. gdb/ChangeLog: Pushed by Joel Brobecker . * amd64-tdep.c (amd64_dwarf_regmap array): Add missing MMX registers. Tested on x86_64-linux. -- Joel