* i386-dis.c: Revert patch of April 4. The output now matches
authorIan Lance Taylor <ian@airs.com>
Mon, 5 May 1997 18:30:06 +0000 (18:30 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 5 May 1997 18:30:06 +0000 (18:30 +0000)
what gcc generates.

opcodes/ChangeLog
opcodes/i386-dis.c

index 3658d84..8a66920 100644 (file)
@@ -1,3 +1,8 @@
+Mon May  5 14:28:41 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * i386-dis.c: Revert patch of April 4.  The output now matches
+       what gcc generates.
+
 Fri May  2 12:48:37 1997  Doug Evans  <dje@canuck.cygnus.com>
 
        * m32r-opc.c (m32r_cgen_insn_table, cmpui): Use $uimm16 instead
index f5c3aaa..fa45ead 100644 (file)
@@ -1,5 +1,6 @@
 /* Print i386 instructions for GDB, the GNU debugger.
-   Copyright (C) 1988, 89, 91, 93, 94, 95, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1988, 89, 91, 93, 94, 95, 96, 1997
+   Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -39,6 +40,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <setjmp.h>
 
+static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
+
 struct dis_private
 {
   /* Points to first byte not fetched.  */
@@ -97,7 +100,9 @@ fetch_data (info, addr)
 #define Iw OP_I, w_mode
 #define Jb OP_J, b_mode
 #define Jv OP_J, v_mode
+#if 0
 #define ONE OP_ONE, 0
+#endif
 #define Cd OP_C, d_mode
 #define Dd OP_D, d_mode
 #define Td OP_T, d_mode
@@ -139,11 +144,29 @@ fetch_data (info, addr)
 #define fs OP_REG, fs_reg
 #define gs OP_REG, gs_reg
 
-typedef int op_rtn PARAMS ((int bytemode, int aflag, int dflag));
-
-static op_rtn OP_E, OP_G, OP_I, OP_indirE, OP_sI, OP_REG, OP_J, OP_DIR, OP_OFF;
-static op_rtn OP_ESDI, OP_DSSI, OP_SEG, OP_ONE, OP_C, OP_D, OP_T, OP_rm, OP_ST;
-static op_rtn OP_STi;
+typedef int (*op_rtn) PARAMS ((int bytemode, int aflag, int dflag));
+
+static int OP_E PARAMS ((int, int, int));
+static int OP_G PARAMS ((int, int, int));
+static int OP_I PARAMS ((int, int, int));
+static int OP_indirE PARAMS ((int, int, int));
+static int OP_sI PARAMS ((int, int, int));
+static int OP_REG PARAMS ((int, int, int));
+static int OP_J PARAMS ((int, int, int));
+static int OP_DIR PARAMS ((int, int, int));
+static int OP_OFF PARAMS ((int, int, int));
+static int OP_ESDI PARAMS ((int, int, int));
+static int OP_DSSI PARAMS ((int, int, int));
+static int OP_SEG PARAMS ((int, int, int));
+static int OP_C PARAMS ((int, int, int));
+static int OP_D PARAMS ((int, int, int));
+static int OP_T PARAMS ((int, int, int));
+static int OP_rm PARAMS ((int, int, int));
+static int OP_ST PARAMS ((int, int, int));
+static int OP_STi  PARAMS ((int, int, int));
+#if 0
+static int OP_ONE PARAMS ((int, int, int));
+#endif
 
 static void append_prefix PARAMS ((void));
 static void set_op PARAMS ((int op));
@@ -218,11 +241,11 @@ static void ckprefix PARAMS ((void));
 
 struct dis386 {
   char *name;
-  op_rtn *op1;
+  op_rtn op1;
   int bytemode1;
-  op_rtn *op2;
+  op_rtn op2;
   int bytemode2;
-  op_rtn *op3;
+  op_rtn op3;
   int bytemode3;
 };
 
@@ -1035,9 +1058,9 @@ print_insn_i386 (pc, info)
      disassemble_info *info;
 {
   if (info->mach == bfd_mach_i386_i386)
-    print_insn_x86 (pc, info, 1, 1);
+    return print_insn_x86 (pc, info, 1, 1);
   else if (info->mach == bfd_mach_i386_i8086)
-    print_insn_x86 (pc, info, 0, 0);
+    return print_insn_x86 (pc, info, 0, 0);
   else
     abort ();
 }
@@ -1057,6 +1080,10 @@ print_insn_x86 (pc, info, aflag, dflag)
   struct dis_private priv;
   bfd_byte *inbuf = priv.the_buffer;
 
+  /* The output looks better if we put 5 bytes on a line, since that
+     puts long word instructions on a single line.  */
+  info->bytes_per_line = 5;
+
   info->private_data = (PTR) &priv;
   priv.max_fetched = priv.the_buffer;
   priv.insn_start = pc;
@@ -2019,6 +2046,9 @@ OP_DSSI (dummy, aflag, dflag)
   return (0);
 }
 
+#if 0
+/* Not used.  */
+
 /* ARGSUSED */
 static int
 OP_ONE (dummy, aflag, dflag)
@@ -2030,6 +2060,8 @@ OP_ONE (dummy, aflag, dflag)
   return (0);
 }
 
+#endif
+
 /* ARGSUSED */
 static int
 OP_C (dummy, aflag, dflag)