X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fsh-dis.c;h=33aec29507d2c35d6c6780c8725c226fc4dc94e0;hb=e90426589d7c783b7e458162baaac1431fc33bd5;hp=381fa4da8d995322ab3855df25bdbb310c32d0df;hpb=47b0e7ad8c60ea4b45b22ad5cb376f068991bc88;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c index 381fa4da8d..33aec29507 100644 --- a/opcodes/sh-dis.c +++ b/opcodes/sh-dis.c @@ -1,33 +1,31 @@ /* Disassemble SH instructions. - Copyright 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1993-2018 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This file is part of the GNU opcodes library. + + 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 2 of the License, or - (at your option) any later version. + the Free Software Foundation; either version 3, or (at your option) + any later version. - 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. + 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; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "sysdep.h" +#include + #define STATIC_TABLE #define DEFINE_TABLE #include "sh-opc.h" -#include "dis-asm.h" - -#ifdef ARCH_all -#define INCLUDE_SHMEDIA -#endif +#include "disassemble.h" static void print_movxy (const sh_opcode_info *op, @@ -150,7 +148,7 @@ print_insn_ddt (int insn, struct disassemble_info *info) while (op->nibbles[2] != (unsigned) ((insn >> 4) & 3) || op->nibbles[3] != (unsigned) (insn & 0xf)) op++; - + print_movxy (op, (4 * ((insn & (is_movy ? 0x200 : 0x100)) == 0) + 2 * is_movy @@ -353,10 +351,10 @@ print_insn_ppi (int field_b, struct disassemble_info *info) print_dsp_reg (field_b & 0xf, fprintf_fn, stream); break; case DSP_REG_X: - fprintf_fn (stream, sx_tab[(field_b >> 6) & 3]); + fprintf_fn (stream, "%s", sx_tab[(field_b >> 6) & 3]); break; case DSP_REG_Y: - fprintf_fn (stream, sy_tab[(field_b >> 4) & 3]); + fprintf_fn (stream, "%s", sy_tab[(field_b >> 4) & 3]); break; case A_MACH: fprintf_fn (stream, "mach"); @@ -402,16 +400,6 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) && bfd_asymbol_flavour(*info->symbols) == bfd_target_coff_flavour) target_arch = arch_sh4; break; - case bfd_mach_sh5: -#ifdef INCLUDE_SHMEDIA - status = print_insn_sh64 (memaddr, info); - if (status != -2) - return status; -#endif - /* When we get here for sh64, it's because we want to disassemble - SHcompact, i.e. arch_sh4. */ - target_arch = arch_sh4; - break; default: target_arch = sh_get_arch_from_bfd_mach (info->mach); } @@ -834,6 +822,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) fprintf_fn (stream, "xd%d", rn & ~1); break; } + /* Fall through. */ case D_REG_N: fprintf_fn (stream, "dr%d", rn); break; @@ -843,6 +832,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) fprintf_fn (stream, "xd%d", rm & ~1); break; } + /* Fall through. */ case D_REG_M: fprintf_fn (stream, "dr%d", rm); break; @@ -903,6 +893,8 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) size = 2; else size = 4; + /* Not reading an instruction - disable stop_vma. */ + info->stop_vma = 0; status = info->read_memory_func (disp_pc_addr, bytes, size, info); if (status == 0) { @@ -924,11 +916,11 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) } if ((*info->symbol_at_address_func) (val, info)) { - fprintf_fn (stream, "\t! 0x"); + fprintf_fn (stream, "\t! "); (*info->print_address_func) (val, info); } else - fprintf_fn (stream, "\t! 0x%x", val); + fprintf_fn (stream, "\t! %x", val); } }