gdb/python: smarter symbol lookup for gdb.lookup_static_symbol
[deliverable/binutils-gdb.git] / opcodes / d30v-dis.c
index 972d367ad75ae82a89554c13a17dc5e76be55325..8dd43fb984e0361f86664497419bec6893847d3f 100644 (file)
@@ -1,6 +1,5 @@
 /* Disassemble D30V instructions.
-   Copyright 1997, 1998, 2000, 2001, 2005, 2007, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1997-2019 Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
 
@@ -22,8 +21,9 @@
 #include "sysdep.h"
 #include <stdio.h>
 #include "opcode/d30v.h"
-#include "dis-asm.h"
+#include "disassemble.h"
 #include "opintl.h"
+#include "libiberty.h"
 
 #define PC_MASK 0xFFFFFFFF
 
@@ -226,7 +226,9 @@ print_insn (struct disassemble_info *info,
                  val |= OPERAND_FLAG;
                  break;
                default:
-                 fprintf (stderr, "illegal id (%d)\n", id);
+                 /* xgettext: c-format */
+                 opcodes_error_handler (_("illegal id (%d)"), id);
+                 abort ();
                }
            }
          else if (oper->flags & OPERAND_ACC)
@@ -312,7 +314,9 @@ print_insn (struct disassemble_info *info,
          (*info->fprintf_func) (info->stream, "0x%x", val);
        }
       /* If there is another operand, then write a comma and space.  */
-      if (insn->form->operands[opind] && !(found_control && opind == 2))
+      if (opind < (int) ARRAY_SIZE (insn->form->operands)
+         && insn->form->operands[opind]
+         && !(found_control && opind == 2))
        need_comma = 1;
     }
   if (need_paren)
This page took 0.025043 seconds and 4 git commands to generate.