Remove trailing white spaces.
[deliverable/binutils-gdb.git] / opcodes / m68k-dis.c
index 14d624f99ce3e8f27eb63812c31ff94cf60891a8..16ad7e4d582549f34605b4885df007d60f2d42b6 100644 (file)
@@ -650,7 +650,10 @@ print_insn_arg (const char *d,
             /* Should we be calling this psr like we do in case 'Y'?  */
             {"%mmusr",0x805},
 
-             {"%urp", 0x806}, {"%srp", 0x807}, {"%pcr", 0x808}};
+             {"%urp", 0x806}, {"%srp", 0x807}, {"%pcr", 0x808},
+
+            /* Fido added these.  */
+             {"%cac", 0xffe}, {"%mbb", 0xfff}};
 
        val = fetch_arg (buffer, place, 12, info);
        for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
@@ -1472,6 +1475,12 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
 
   bfd_byte *buffer = priv.the_buffer;
 
+  /* Save these printing functions in case we need to restore them
+     later.  */
+  fprintf_ftype save_printer = info->fprintf_func;
+  void (* save_print_address) (bfd_vma, struct disassemble_info *)
+    = info->print_address_func;
+
   info->private_data = (PTR) &priv;
   /* Tell objdump to use two bytes per chunk
      and six bytes per line for displaying raw data.  */
@@ -1482,8 +1491,26 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
   priv.insn_start = memaddr;
 
   if (setjmp (priv.bailout) != 0)
-    /* Error return.  */
-    return -1;
+    {
+      /* longjmp may be called while these printing functions are
+        temporarily replaced with dummy functions.  Restore them
+        before we leave.
+
+        Admittedly, this save-and-restore operation is somewhat ugly
+        in that we are exposing the fact that match_insn_m68k
+        temporarily replaces insn->fprintf_func and
+        insn->print_address_func.  Perhaps, a real fix is to report a
+        FETCH_DATA failure with a return value of some sort, without
+        using setjmp/longjmp.  A better fix may be to teach the m68k
+        disassembler do its job without temporarily replacing
+        insn->fprintf_func and insn->print_address_func, but that's a
+        task for another day.  */
+      info->fprintf_func = save_printer;
+      info->print_address_func = save_print_address;
+
+      /* Error return.  */
+      return -1;
+    }
 
   arch_mask = bfd_m68k_mach_to_features (info->mach);
   if (!arch_mask)
This page took 0.023389 seconds and 4 git commands to generate.