From 7de5b33554a9c0b41c963d220dd85ceda1bf3022 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 22 May 2017 22:19:01 -0700 Subject: [PATCH] LR35902: Fix disassembling segments --- src/lr35902/debugger/cli-debugger.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lr35902/debugger/cli-debugger.c b/src/lr35902/debugger/cli-debugger.c index 6e0740660..c2bc5fbd2 100644 --- a/src/lr35902/debugger/cli-debugger.c +++ b/src/lr35902/debugger/cli-debugger.c @@ -31,11 +31,13 @@ static void _disassemble(struct CLIDebuggerSystem* debugger, struct CLIDebugVect struct LR35902Core* cpu = debugger->p->d.core->cpu; uint16_t address; + int segment = -1; size_t size; if (!dv || dv->type != CLIDV_INT_TYPE) { address = cpu->pc; } else { address = dv->intValue; + segment = dv->segmentValue; dv = dv->next; } @@ -48,7 +50,7 @@ static void _disassemble(struct CLIDebuggerSystem* debugger, struct CLIDebugVect size_t i; for (i = 0; i < size; ++i) { - address = _printLine(debugger->p, address, dv->segmentValue); + address = _printLine(debugger->p, address, segment); } }