use _filtered routines for printing so symbolic addresses show up in the right place
[deliverable/binutils-gdb.git] / gdb / mips-pinsn.c
index a90448ae04d23d9c075f78b73a63926533001fe6..ca0e825dfea549a0fe8dcfb9340135ac1fa7d46a 100644 (file)
@@ -1,6 +1,6 @@
 /* Print mips instructions for GDB, the GNU debugger.
-   Copyright 1989, 1991 Free Software Foundation, Inc.
-   Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp)
+   Copyright 1989, 1991, 1992 Free Software Foundation, Inc.
+   Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp).
 
 This file is part of GDB.
 
@@ -18,11 +18,9 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include <stdio.h>
-
 #include "defs.h"
 #include "symtab.h"
-#include "mips-opcode.h"
+#include "opcode/mips.h"
 
 /* Mips instructions are never longer than this many bytes.  */
 #define MAXLEN 4
@@ -31,9 +29,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define NOPCODES (sizeof mips_opcodes / sizeof mips_opcodes[0])
 
 #define MKLONG(p)  *(unsigned long*)p
-
-extern char *reg_names[];
-
 \f
 /* subroutine */
 static unsigned char *
@@ -84,6 +79,10 @@ print_insn_arg (d, l, stream, pc)
       fprintf (stream, "0x%x", ((struct op_r_fmt *) l)->shamt);
       break;
 
+    case 'B':
+      fprintf (stream, "0x%x", ((struct op_brk_fmt *) l)->code);
+      break;
+
     case 'S':
       fprintf (stream, "$f%d", ((struct fop_r_fmt *) l)->fs);
       break;
@@ -117,6 +116,7 @@ print_insn (memaddr, stream)
   unsigned long int l;
 
   read_memory (memaddr, buffer, MAXLEN);
+  SWAP_TARGET_AND_HOST (buffer, MAXLEN);
 
   for (i = 0; i < NOPCODES; i++)
     {
This page took 0.023587 seconds and 4 git commands to generate.