Improve the MSP430 disassembler's handling of memory read errors.
authorNick Clifton <nickc@redhat.com>
Fri, 27 May 2016 12:49:58 +0000 (13:49 +0100)
committerNick Clifton <nickc@redhat.com>
Fri, 27 May 2016 12:49:58 +0000 (13:49 +0100)
commit77d66e7b303f6fa65dd2ca4abce6393d6ea70a8f
tree2e1cb7f10467bbed1d8dd5427aee81348abe34a0
parent51415b9f309443261016ad1b63b9e350bbe3903d
Improve the MSP430 disassembler's handling of memory read errors.

PR target/20150
* msp430-dis.c (msp430dis_read_two_bytes): New function.
(msp430dis_opcode_unsigned): New function.
(msp430dis_opcode_signed): New function.
(msp430_singleoperand): Use the new opcode reading functions.
Only disassenmble bytes if they were successfully read.
(msp430_doubleoperand): Likewise.
(msp430_branchinstr): Likewise.
(msp430x_callx_instr): Likewise.
(print_insn_msp430): Check that it is safe to read bytes before
attempting disassembly.  Use the new opcode reading functions.
opcodes/ChangeLog
opcodes/msp430-dis.c