Re: PATCH: Remove amd64_linux_gregset64_reg_offset and regmap

Mark Kettenis
2010-04-22T19:48:25Z

> Date: Wed, 21 Apr 2010 16:09:29 -0700
> From: "H.J. Lu" <hongjiu.lu@intel.com>
>
> Hi,
>
> As we have discussed, this patch removes amd64_linux_gregset64_reg_offset
> and regmap from i386/amd64 Linux targets. OK to install?

The amd64 bits are ok. A small issue with the i386 bits below.
> diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
> index d559811..35bc3bd 100644
> --- a/gdb/i386-linux-nat.c
> +++ b/gdb/i386-linux-nat.c
> @@ -245,18 +228,19 @@ void
> fill_gregset (const struct regcache *regcache,
> elf_gregset_t *gregsetp, int regno)
> {
> - elf_greg_t *regp = (elf_greg_t *) gregsetp;
> + gdb_byte *regp = (gdb_byte *) gregsetp;
> int i;
>
> for (i = 0; i < I386_NUM_GREGS; i++)
> if (regno == -1 || regno == i)
> - regcache_raw_collect (regcache, i, regp + regmap[i]);
> + regcache_raw_collect (regcache, i,
> + regp + i386_linux_gregset_reg_offset[i]);
>
> if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
> && I386_LINUX_ORIG_EAX_REGNUM
> < gdbarch_num_regs (get_regcache_arch (regcache)))
> regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM,
> - regp + ORIG_EAX);
> + regp + 4 * ORIG_EAX);

I think this should use an offset from i386_linux_gregset_reg_offset[]
as well.