X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fi960-dis.c;h=6cb348541e30ec5f995ad08c5d48b3a9a79b5f08;hb=e09efd5931daf7eede1f4da46313a1aaadd4dbfa;hp=94f733e2413659cc50e1233658ec25b535cd50f5;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/i960-dis.c b/opcodes/i960-dis.c index 94f733e241..6cb348541e 100644 --- a/opcodes/i960-dis.c +++ b/opcodes/i960-dis.c @@ -1,24 +1,25 @@ /* Disassemble i80960 instructions. - Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2003 - Free Software Foundation, Inc. + Copyright (C) 1990-2018 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This file is part of the GNU opcodes library. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to the -Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -02110-1301, USA. */ + It is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #include "sysdep.h" -#include "dis-asm.h" +#include "disassemble.h" static const char *const reg_names[] = { /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", @@ -202,7 +203,7 @@ ctrl (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED return; } - (*info->fprintf_func) (stream, ctrl_tab[i].name); + (*info->fprintf_func) (stream, "%s", ctrl_tab[i].name); if (word1 & 2) /* Predicts branch not taken. */ (*info->fprintf_func) (stream, ".f"); @@ -274,7 +275,7 @@ cobr (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED return; } - (*info->fprintf_func) (stream, cobr_tab[i].name); + (*info->fprintf_func) (stream, "%s", cobr_tab[i].name); /* Predicts branch not taken. */ if (word1 & 2) @@ -289,7 +290,7 @@ cobr (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED /* M1 is 1 */ (*info->fprintf_func) (stream, "%d", src1); else - (*info->fprintf_func) (stream, reg_names[src1]); + (*info->fprintf_func) (stream, "%s", reg_names[src1]); if (cobr_tab[i].numops > 1) { @@ -715,7 +716,7 @@ reg (unsigned long word1) fp = 0; } - (*info->fprintf_func) (stream, mnemp); + (*info->fprintf_func) (stream, "%s", mnemp); s1 = (word1 >> 5) & 1; s2 = (word1 >> 6) & 1; @@ -822,7 +823,7 @@ ea (bfd_vma memaddr, int mode, const char *reg2, const char *reg3, int word1, /* Register Instruction Operand. */ static void -regop (int mode, int spec, int reg, int fp) +regop (int mode, int spec, int fp_reg, int fp) { if (fp) { @@ -830,7 +831,7 @@ regop (int mode, int spec, int reg, int fp) if (mode == 1) { /* FP operand. */ - switch (reg) + switch (fp_reg) { case 0: (*info->fprintf_func) (stream, "fp0"); break; @@ -851,7 +852,7 @@ regop (int mode, int spec, int reg, int fp) else { /* Non-FP register. */ - (*info->fprintf_func) (stream, reg_names[reg]); + (*info->fprintf_func) (stream, "%s", reg_names[fp_reg]); } } else @@ -860,15 +861,15 @@ regop (int mode, int spec, int reg, int fp) if (mode == 1) { /* Literal. */ - (*info->fprintf_func) (stream, "%d", reg); + (*info->fprintf_func) (stream, "%d", fp_reg); } else { /* Register. */ if (spec == 0) - (*info->fprintf_func) (stream, reg_names[reg]); + (*info->fprintf_func) (stream, "%s", reg_names[fp_reg]); else - (*info->fprintf_func) (stream, "sf%d", reg); + (*info->fprintf_func) (stream, "sf%d", fp_reg); } } } @@ -876,15 +877,15 @@ regop (int mode, int spec, int reg, int fp) /* Register Instruction Destination Operand. */ static void -dstop (int mode, int reg, int fp) +dstop (int mode, int dest_reg, int fp) { /* 'dst' operand can't be a literal. On non-FP instructions, register mode is assumed and "m3" acts as if were "s3"; on FP-instructions, sf registers are not allowed so m3 acts normally. */ if (fp) - regop (mode, 0, reg, fp); + regop (mode, 0, dest_reg, fp); else - regop (0, mode, reg, fp); + regop (0, mode, dest_reg, fp); } static void