aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-01-02 17:26:11 +0000
committerNick Clifton <nickc@redhat.com>2004-01-02 17:26:11 +0000
commit3ab489312135d66f65a23985dd2341340842db1d (patch)
tree5ceefbe9d821c025e4c0cd286acaa86bbfe4a184 /opcodes
parentf0660b7388f51601a5522c72327ea435cf8675d5 (diff)
downloadgdb-3ab489312135d66f65a23985dd2341340842db1d.zip
gdb-3ab489312135d66f65a23985dd2341340842db1d.tar.gz
gdb-3ab489312135d66f65a23985dd2341340842db1d.tar.bz2
Catch a bug in the msp430 disassembler where an add instruction was confused
with an rla instruction. Add a test for this to the testsuite.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/msp430-dis.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index eacd265..90c75dc 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-02 Albert Bartoszko <albar@nt.kegel.com.pl>
+
+ * msp430-dis.c (msp430_doubleoperand): Check for an 'add'
+ instruction which looks similar to an 'rla' instruction.
For older changes see ChangeLog-0203
diff --git a/opcodes/msp430-dis.c b/opcodes/msp430-dis.c
index 767ffa4..1b5ffb1 100644
--- a/opcodes/msp430-dis.c
+++ b/opcodes/msp430-dis.c
@@ -1,5 +1,5 @@
/* Disassemble MSP430 instructions.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
@@ -491,6 +491,10 @@ msp430_doubleoperand (info, opcode, addr, insn, op1, op2, comm1, comm2, cycles)
{
/* Absolute. */
dst = msp430dis_opcode (addr + 2, info);
+ /* If the 'src' field is not the same as the dst
+ then this is not an rla instruction. */
+ if (dst != msp430dis_opcode (addr + 4, info))
+ return 0;
cmd_len += 4;
*cycles = 6;
sprintf (op1, "&0x%04x", PS (dst));