diff options
author | Jiri Gaisler <jiri@gaisler.se> | 2015-02-19 23:31:19 +0100 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-02-21 23:10:57 -0500 |
commit | 53b5af48f6591c3120fb076f078188a4f117c2b7 (patch) | |
tree | fe926e02cd06dd7a402464c2ef5ecdce59148914 | |
parent | 74f4df0028f256214ede2091cb102ffd496463c9 (diff) | |
download | gdb-53b5af48f6591c3120fb076f078188a4f117c2b7.zip gdb-53b5af48f6591c3120fb076f078188a4f117c2b7.tar.gz gdb-53b5af48f6591c3120fb076f078188a4f117c2b7.tar.bz2 |
sim/erc32: Disassembly in stand-alone mode did not work.
The API to print_insn_sparc() has changed over the years ...
-rw-r--r-- | sim/erc32/ChangeLog | 5 | ||||
-rw-r--r-- | sim/erc32/func.c | 17 |
2 files changed, 19 insertions, 3 deletions
diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog index 2da23d4..4a316bc 100644 --- a/sim/erc32/ChangeLog +++ b/sim/erc32/ChangeLog @@ -1,3 +1,8 @@ +2015-02-21 Jiri Gaisler <jiri@gaisler.se> + + * func.c (print_insn_sparc_sis): Add helper function for disassembly. + (disp_ctrl): Use helper function. + 2014-08-19 Alan Modra <amodra@gmail.com> * configure: Regenerate. diff --git a/sim/erc32/func.c b/sim/erc32/func.c index d001c58..e6744ee 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -759,6 +759,17 @@ disp_regs(sregs,cwp) } } +static void print_insn_sparc_sis(uint32 addr, struct disassemble_info *info) +{ + unsigned char i[4]; + + sis_memory_read(addr, i, 4); + dinfo.buffer_vma = addr; + dinfo.buffer_length = 4; + dinfo.buffer = i; + print_insn_sparc(addr, info); +} + static void disp_ctrl(sregs) struct pstate *sregs; @@ -770,10 +781,10 @@ disp_ctrl(sregs) sregs->psr, sregs->wim, sregs->tbr, sregs->y); sis_memory_read(sregs->pc, i, 4); printf("\n pc: %08X = %02X%02X%02X%02X ", sregs->pc,i[0],i[1],i[2],i[3]); - print_insn_sparc(sregs->pc, &dinfo); + print_insn_sparc_sis(sregs->pc, &dinfo); sis_memory_read(sregs->npc, i, 4); printf("\n npc: %08X = %02X%02X%02X%02X ",sregs->npc,i[0],i[1],i[2],i[3]); - print_insn_sparc(sregs->npc, &dinfo); + print_insn_sparc_sis(sregs->npc, &dinfo); if (sregs->err_mode) printf("\n IU in error mode"); printf("\n\n"); @@ -821,7 +832,7 @@ dis_mem(addr, len, info) for (i = addr & -3; i < ((addr & -3) + (len << 2)); i += 4) { sis_memory_read(i, data, 4); printf(" %08x %02x%02x%02x%02x ", i, data[0],data[1],data[2],data[3]); - print_insn_sparc(i, info); + print_insn_sparc_sis(i, info); if (i >= 0xfffffffc) break; printf("\n"); } |