diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2007-02-02 15:27:04 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2007-02-02 15:27:04 +0000 |
commit | f59a29b99f7ec485425e13e6935029b7cadcc78e (patch) | |
tree | bf831829a358f761110ad8a714e1161b2c6a822a /opcodes | |
parent | 7aad4c3d675f44a20cf9e5a66dc32181da1e9a2e (diff) | |
download | gdb-f59a29b99f7ec485425e13e6935029b7cadcc78e.zip gdb-f59a29b99f7ec485425e13e6935029b7cadcc78e.tar.gz gdb-f59a29b99f7ec485425e13e6935029b7cadcc78e.tar.bz2 |
binutils/
2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
* doc/binutils.texi (objdump): Document the new addr64 option
for i386 disassembler.
include/
2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
* dis-asm.h (print_i386_disassembler_options): New.
opcodes/
2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
* disassemble.c (disassembler_usage): Call
print_i386_disassembler_options for i386 disassembler.
* i386-dis.c (print_i386_disassembler_options): New.
(print_insn): Support the new addr64 option.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 8 | ||||
-rw-r--r-- | opcodes/disassemble.c | 3 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 38 |
3 files changed, 45 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a7db87f..af2d0bd 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,11 @@ +2076-02-02 H.J. Lu <hongjiu.lu@intel.com> + + * disassemble.c (disassembler_usage): Call + print_i386_disassembler_options for i386 disassembler. + + * i386-dis.c (print_i386_disassembler_options): New. + (print_insn): Support the new addr64 option. + 2007-02-02 Hiroki Kaminaga <kaminaga@sm.sony.co.jp> * ppc-dis.c (powerpc_dialect): Handle ppc440. diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c index ca28f56..f86d21c 100644 --- a/opcodes/disassemble.c +++ b/opcodes/disassemble.c @@ -448,6 +448,9 @@ disassembler_usage (stream) #ifdef ARCH_powerpc print_ppc_disassembler_options (stream); #endif +#ifdef ARCH_i386 + print_i386_disassembler_options (stream); +#endif return; } diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index eb751bc..58f630e 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -2856,6 +2856,26 @@ print_insn_i386 (bfd_vma pc, disassemble_info *info) return print_insn (pc, info); } +void +print_i386_disassembler_options (FILE *stream) +{ + fprintf (stream, _("\n\ +The following i386/x86-64 specific disassembler options are supported for use\n\ +with the -M switch (multiple options should be separated by commas):\n")); + + fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n")); + fprintf (stream, _(" i386 Disassemble in 32bit mode\n")); + fprintf (stream, _(" i8086 Disassemble in 16bit mode\n")); + fprintf (stream, _(" att Display instruction in AT&T syntax\n")); + fprintf (stream, _(" intel Display instruction in Intel syntax\n")); + fprintf (stream, _(" addr64 Assume 64bit address size\n")); + fprintf (stream, _(" addr32 Assume 32bit address size\n")); + fprintf (stream, _(" addr16 Assume 16bit address size\n")); + fprintf (stream, _(" data32 Assume 32bit data size\n")); + fprintf (stream, _(" data16 Assume 16bit data size\n")); + fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n")); +} + static int print_insn (bfd_vma pc, disassemble_info *info) { @@ -2917,10 +2937,20 @@ print_insn (bfd_vma pc, disassemble_info *info) } else if (CONST_STRNEQ (p, "addr")) { - if (p[4] == '1' && p[5] == '6') - priv.orig_sizeflag &= ~AFLAG; - else if (p[4] == '3' && p[5] == '2') - priv.orig_sizeflag |= AFLAG; + if (address_mode == mode_64bit) + { + if (p[4] == '3' && p[5] == '2') + priv.orig_sizeflag &= ~AFLAG; + else if (p[4] == '6' && p[5] == '4') + priv.orig_sizeflag |= AFLAG; + } + else + { + if (p[4] == '1' && p[5] == '6') + priv.orig_sizeflag &= ~AFLAG; + else if (p[4] == '3' && p[5] == '2') + priv.orig_sizeflag |= AFLAG; + } } else if (CONST_STRNEQ (p, "data")) { |