diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-02-06 18:17:07 +0100 |
---|---|---|
committer | Marcin KoĆcielnicki <koriakin@0x04.net> | 2016-02-10 15:30:31 +0100 |
commit | 62e5fd57bcdfb58eadd08ec430c4dfd742027d8e (patch) | |
tree | d338b40a312a2b92bd3c98ababb1d0df1ecb2040 /gdb/amd64-tdep.c | |
parent | e909d859f5635d66e79fef467da70d6090bfae1b (diff) | |
download | fsf-binutils-gdb-62e5fd57bcdfb58eadd08ec430c4dfd742027d8e.zip fsf-binutils-gdb-62e5fd57bcdfb58eadd08ec430c4dfd742027d8e.tar.gz fsf-binutils-gdb-62e5fd57bcdfb58eadd08ec430c4dfd742027d8e.tar.bz2 |
gdb/x86: Implement ax_pseudo_register_collect hook.
Makes "collect $ymm15" action work.
gdb/ChangeLog:
* amd64-tdep.c (amd64_ax_pseudo_register_collect): New function.
(amd64_init_abi): Fill ax_pseudo_register_collect hook.
* gdb/i386-tdep.c (i386_pseudo_register_read_into_value): Remove
misleading comment.
(i386_pseudo_register_write): Ditto.
(i386_ax_pseudo_register_collect): New function.
(i386_gdbarch_init): Fill ax_pseudo_register_collect hook.
* i386-tdep.h: Add i386_ax_pseudo_register_collect prototype.
Diffstat (limited to 'gdb/amd64-tdep.c')
-rw-r--r-- | gdb/amd64-tdep.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index fae92b2..a62efde 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -455,6 +455,35 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch, i386_pseudo_register_write (gdbarch, regcache, regnum, buf); } +/* Implement the 'ax_pseudo_register_collect' gdbarch method. */ + +static int +amd64_ax_pseudo_register_collect (struct gdbarch *gdbarch, + struct agent_expr *ax, int regnum) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (i386_byte_regnum_p (gdbarch, regnum)) + { + int gpnum = regnum - tdep->al_regnum; + + if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS) + ax_reg_mask (ax, gpnum - AMD64_NUM_LOWER_BYTE_REGS); + else + ax_reg_mask (ax, gpnum); + return 0; + } + else if (i386_dword_regnum_p (gdbarch, regnum)) + { + int gpnum = regnum - tdep->eax_regnum; + + ax_reg_mask (ax, gpnum); + return 0; + } + else + return i386_ax_pseudo_register_collect (gdbarch, ax, regnum); +} + /* Register classes as defined in the psABI. */ @@ -2997,6 +3026,8 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) amd64_pseudo_register_read_value); set_gdbarch_pseudo_register_write (gdbarch, amd64_pseudo_register_write); + set_gdbarch_ax_pseudo_register_collect (gdbarch, + amd64_ax_pseudo_register_collect); set_tdesc_pseudo_register_name (gdbarch, amd64_pseudo_register_name); |