aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorDenis Chertykov <chertykov@gmail.com>2016-06-09 19:00:57 +0300
committerDenis Chertykov <chertykov@gmail.com>2016-06-09 19:00:57 +0300
commit1857fe72aff6f254217956d141bff4b9ca454bc5 (patch)
tree85738760d7e2c8810e930388514e7a293482bed2 /opcodes
parent337c570c5f4442459d3324c9429ad80840094015 (diff)
downloadgdb-1857fe72aff6f254217956d141bff4b9ca454bc5.zip
gdb-1857fe72aff6f254217956d141bff4b9ca454bc5.tar.gz
gdb-1857fe72aff6f254217956d141bff4b9ca454bc5.tar.bz2
Print symbol names in comments for LDS/STS disassembly.
This patch adds default data address space origin (0x800000) to the symbol addresses. when disassemble lds/sts instructions. So that symbol names shall be printed in comments for lds/sts instructions disassemble. ld/ * testsuite/ld-avr/lds-mega.d: New test. * testsuite/ld-avr/lds-mega.s: New test source. * testsuite/ld-avr/lds-tiny.d: New test. * testsuite/ld-avr/lds-tiny.s: New test source. opcodes/ * avr-dis.c (avr_operand): Add default data address space origin (0x800000) to the address and set as symbol address for LDS/ STS immediate operands.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/avr-dis.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 13d35e0..f218365 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-03 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
+
+ * avr-dis.c (avr_operand): Add default data address space origin (0x800000)
+ to the address and set as symbol address for LDS/ STS immediate operands.
+
2016-06-07 Alan Modra <amodra@gmail.com>
* ppc-dis.c (ppc_opts): Delete extraneous parentheses. Default
diff --git a/opcodes/avr-dis.c b/opcodes/avr-dis.c
index 3b783fb..748cb2d 100644
--- a/opcodes/avr-dis.c
+++ b/opcodes/avr-dis.c
@@ -184,17 +184,23 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
break;
case 'i':
- sprintf (buf, "0x%04X", insn2);
+ {
+ unsigned int val = insn2 | 0x800000;
+ *sym = 1;
+ *sym_addr = val;
+ sprintf (buf, "0x%04X", insn2);
+ strcpy (comment, comment_start);
+ }
break;
case 'j':
{
unsigned int val = ((insn & 0xf) | ((insn & 0x600) >> 5)
| ((insn & 0x100) >> 2));
- if (val > 0 && !(insn & 0x100))
- val |= 0x80;
+ *sym = 1;
+ *sym_addr = val | 0x800000;
sprintf (buf, "0x%02x", val);
- sprintf (buf, "%d", val);
+ strcpy (comment, comment_start);
}
break;