diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-03-02 13:14:36 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-03-02 13:14:36 +0000 |
commit | 1ba53b71caf9544b0c1dc040af4052561c32d47b (patch) | |
tree | 8e3eb732fad2c1b52dc3a76c54ab65e5d1c198f2 /gdb/i386-tdep.h | |
parent | 5488d830ec018f8528fe806eeeaa39ce5ff7ffb1 (diff) | |
download | binutils-gdb-1ba53b71caf9544b0c1dc040af4052561c32d47b.tar.gz |
Support x86 pseudo byte, word and dword registers.
gdb/
2010-03-02 H.J. Lu <hongjiu.lu@intel.com>
* amd64-tdep.c (amd64_byte_names): New.
(amd64_word_names): Likewise.
(amd64_dword_names): Likewise.
(amd64_pseudo_register_name): Likewise.
(amd64_pseudo_register_read): Likewise.
(amd64_pseudo_register_write): Likewise.
(amd64_init_abi): Set num_byte_regs, num_word_regs, num_dword_regs
and num_mmx_regs. Call set_gdbarch_pseudo_register_read,
set_gdbarch_pseudo_register_write and
set_tdesc_pseudo_register_name. Don't call
set_gdbarch_num_pseudo_regs. Don't set mm0_regnum.
* i386-tdep.c (i386_num_mmx_regs): Removed.
(i386_num_pseudo_regs): Likewise.
(i386_byte_names): New.
(i386_word_names): Likewise.
(i386_byte_regnum_p): Likewise.
(i386_word_regnum_p): Likewise.
(i386_mmx_regnum_p): Updated.
(i386_pseudo_register_name): Make it global. Handle byte and
word pseudo-registers.
(i386_pseudo_register_read): Likewise.
(i386_pseudo_register_write): Likewise.
(i386_pseudo_register_type): Handle byte, word and dword
pseudo-registers
(i386_register_reggroup_p): Don't include pseudo
registers, except for MXX, in any register groups. Don't
include pseudo byte, word, dword registers in general_reggroup.
(i386_gdbarch_init): Set num_byte_regs, num_word_regs,
num_dword_regs, al_regnum, ax_regnum and eax_regnum. Put MMX
pseudo-registers after word pseudo-registers. Call
set_gdbarch_num_pseudo_regs after calling gdbarch_init_osabi.
* i386-tdep.h (gdbarch_tdep): Add num_mmx_regs, num_byte_regs,
al_regnum, num_word_regs, ax_regnum, num_dword_regs and
eax_regnum.
(i386_byte_regnum_p): New.
(i386_word_regnum_p): Likewise.
(i386_dword_regnum_p): Likewise.
(i386_pseudo_register_name): Likewise.
(i386_pseudo_register_read): Likewise.
(i386_pseudo_register_write): Likewise.
gdb/testsuite/
2010-03-02 H.J. Lu <hongjiu.lu@intel.com>
* gdb.arch/amd64-byte.exp: New.
* gdb.arch/amd64-dword.exp: Likewise.
* gdb.arch/amd64-pseudo.c: Likewise.
* gdb.arch/amd64-word.exp: Likewise.
* gdb.arch/i386-byte.exp: Likewise.
* gdb.arch/i386-pseudo.c: Likewise.
* gdb.arch/i386-word.exp: Likewise.
Diffstat (limited to 'gdb/i386-tdep.h')
-rw-r--r-- | gdb/i386-tdep.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index a64e5c386a4..72c634e6b7d 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -114,10 +114,32 @@ struct gdbarch_tdep absence of an FPU. */ int st0_regnum; + /* Number of MMX registers. */ + int num_mmx_regs; + /* Register number for %mm0. Set this to -1 to indicate the absence of MMX support. */ int mm0_regnum; + /* Number of byte registers. */ + int num_byte_regs; + + /* Register pseudo number for %al. */ + int al_regnum; + + /* Number of pseudo word registers. */ + int num_word_regs; + + /* Register number for %ax. */ + int ax_regnum; + + /* Number of pseudo dword registers. */ + int num_dword_regs; + + /* Register number for %eax. Set this to -1 to indicate the absence + of pseudo dword register support. */ + int eax_regnum; + /* Number of core registers. */ int num_core_regs; @@ -250,6 +272,21 @@ enum record_i386_regnum /* Types for i386-specific registers. */ extern struct type *i387_ext_type (struct gdbarch *gdbarch); +/* Checks of different pseudo-registers. */ +extern int i386_byte_regnum_p (struct gdbarch *gdbarch, int regnum); +extern int i386_word_regnum_p (struct gdbarch *gdbarch, int regnum); +extern int i386_dword_regnum_p (struct gdbarch *gdbarch, int regnum); + +extern const char *i386_pseudo_register_name (struct gdbarch *gdbarch, + int regnum); + +extern void i386_pseudo_register_read (struct gdbarch *gdbarch, + struct regcache *regcache, + int regnum, gdb_byte *buf); +extern void i386_pseudo_register_write (struct gdbarch *gdbarch, + struct regcache *regcache, + int regnum, const gdb_byte *buf); + /* Segment selectors. */ #define I386_SEL_RPL 0x0003 /* Requester's Privilege Level mask. */ #define I386_SEL_UPL 0x0003 /* User Privilige Level. */ |