aboutsummaryrefslogtreecommitdiff
path: root/sim/erc32/func.c
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2015-02-19 23:31:19 +0100
committerMike Frysinger <vapier@gentoo.org>2015-02-21 23:10:57 -0500
commit53b5af48f6591c3120fb076f078188a4f117c2b7 (patch)
treefe926e02cd06dd7a402464c2ef5ecdce59148914 /sim/erc32/func.c
parent74f4df0028f256214ede2091cb102ffd496463c9 (diff)
downloadgdb-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 ...
Diffstat (limited to 'sim/erc32/func.c')
-rw-r--r--sim/erc32/func.c17
1 files changed, 14 insertions, 3 deletions
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");
}