binutils/
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 2 Feb 2007 15:27:04 +0000 (15:27 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 2 Feb 2007 15:27:04 +0000 (15:27 +0000)
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.

binutils/ChangeLog
binutils/doc/binutils.texi
include/ChangeLog
include/dis-asm.h
opcodes/ChangeLog
opcodes/disassemble.c
opcodes/i386-dis.c

index 58e63a6b60998e42830d6ce217c1e1b5d21afffc..62a353f14c96bbf0b4cb87c715fe3f4edbd31cae 100644 (file)
@@ -1,3 +1,8 @@
+2076-02-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * doc/binutils.texi (objdump): Document the new addr64 option
+       for i386 disassembler.
+
 2076-02-02  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/3945
index a0611b13180dfd654e23730e5f5c72fb5ded34af..3751d048f41bdc60c3545467632118d09e368361 100644 (file)
@@ -1760,7 +1760,7 @@ switch, but allow finer grained control.  Multiple selections from the
 following may be specified as a comma separated string.
 @option{x86-64}, @option{i386} and @option{i8086} select disassembly for
 the given architecture.  @option{intel} and @option{att} select between
-intel syntax mode and AT&T syntax mode.  @option{addr32},
+intel syntax mode and AT&T syntax mode.  @option{addr64}, @option{addr32},
 @option{addr16}, @option{data32} and @option{data16} specify the default
 address size and operand size.  These four options will be overridden if
 @option{x86-64}, @option{i386} or @option{i8086} appear later in the
index 6e67822f186b835523cbbecef190078eef3edac5..363d043b3248bbe18708eb68ea2f3df9d53923ef 100644 (file)
@@ -1,3 +1,7 @@
+2076-02-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * dis-asm.h (print_i386_disassembler_options): New.
+
 2007-01-31  Vladimir Prus  <vladimir@codesourcery.com>
        
        * libiberty.h (PEX_STDERR_TO_PIPE): New define.
index af48e8528ef6bfebc48f3348c06fdab192ab1ab3..9dfd503268353976c4f93e745dc88d2d4b7a94fd 100644 (file)
@@ -284,6 +284,7 @@ extern int print_insn_z8002         (bfd_vma, disassemble_info *);
 extern disassembler_ftype arc_get_disassembler (void *);
 extern disassembler_ftype cris_get_disassembler (bfd *);
 
+extern void print_i386_disassembler_options (FILE *);
 extern void print_mips_disassembler_options (FILE *);
 extern void print_ppc_disassembler_options (FILE *);
 extern void print_arm_disassembler_options (FILE *);
index a7db87faf619f5687babd851e5fadcbd0eef86a6..af2d0bd163141dc27faf9af57d0764475f16cd59 100644 (file)
@@ -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.
index ca28f5619893be117ed9558507bc9facf853833f..f86d21c766287af712afebd7b39063265a6bfb98 100644 (file)
@@ -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;
 }
index eb751bce81b0e098a82fb40e50bdf3cb0ee16d40..58f630eac0de122479bd81c1e23a92e2c51a35b0 100644 (file)
@@ -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"))
        {
This page took 0.032102 seconds and 4 git commands to generate.