* config/tc-mips.c (macro): Handle a non zero base register for
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
index 6bdfa5f6f9383aee9e06ae2362a4f1bb7755bbf7..3be5ac745f8179243cf992b5426eafdbfb2211da 100644 (file)
@@ -1,5 +1,5 @@
 /* Print i386 instructions for GDB, the GNU debugger.
-   Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1989, 1991, 1993, 1994 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -33,6 +33,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  */
 
 #include "dis-asm.h"
+#include <string.h>
 
 #define MAXLEN 20
 
@@ -70,7 +71,7 @@ fetch_data (info, addr)
   if (status != 0)
     {
       (*info->memory_error_func) (status, start, info);
-      longjmp (priv->bailout);
+      longjmp (priv->bailout, 1);
     }
   else
     priv->max_fetched = addr;
@@ -415,8 +416,8 @@ struct dis386 dis386[] = {
   { "stosS",   Yv, eAX },
   { "lodsb",   AL, Xb },
   { "lodsS",   eAX, Xv },
-  { "scasb",   AL, Xb },
-  { "scasS",   eAX, Xv },
+  { "scasb",   AL, Yb },
+  { "scasS",   eAX, Yv },
   /* b0 */
   { "movb",    AL, Ib },
   { "movb",    CL, Ib },
@@ -1045,11 +1046,17 @@ print_insn_i386 (pc, info)
   else
     dp = &dis386[*codep];
   codep++;
+
+  /* Fetch the mod/reg/rm byte.  FIXME: We should be only fetching
+     this if we need it.  As it is, this code loses if there is a
+     one-byte instruction (without a mod/reg/rm byte) at the end of
+     the address space.  */
+
   FETCH_DATA (info, codep + 1);
   mod = (*codep >> 6) & 3;
   reg = (*codep >> 3) & 7;
   rm = *codep & 7;
-  
+
   if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
     {
       dofloat ();
@@ -1106,7 +1113,7 @@ print_insn_i386 (pc, info)
   if (*first)
     {
       if (op_index[0] != -1)
-       print_address (op_address[op_index[0]], info->stream);
+       (*info->print_address_func) (op_address[op_index[0]], info);
       else
        (*info->fprintf_func) (info->stream, "%s", first);
       needcomma = 1;
@@ -1116,7 +1123,7 @@ print_insn_i386 (pc, info)
       if (needcomma)
        (*info->fprintf_func) (info->stream, ",");
       if (op_index[1] != -1)
-       print_address (op_address[op_index[1]], info->stream);
+       (*info->print_address_func) (op_address[op_index[1]], info);
       else
        (*info->fprintf_func) (info->stream, "%s", second);
       needcomma = 1;
@@ -1126,7 +1133,7 @@ print_insn_i386 (pc, info)
       if (needcomma)
        (*info->fprintf_func) (info->stream, ",");
       if (op_index[2] != -1)
-       print_address (op_address[op_index[2]], info->stream);
+       (*info->print_address_func) (op_address[op_index[2]], info);
       else
        (*info->fprintf_func) (info->stream, "%s", third);
     }
This page took 0.024237 seconds and 4 git commands to generate.