From a161dfeb31710b91731457a13f44f06c2fb92451 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 28 May 2023 21:11:48 -0700 Subject: [PATCH] Debugger: Fill in segment in debugger entry --- include/mgba/debugger/debugger.h | 1 + src/sm83/debugger/debugger.c | 1 + src/sm83/debugger/memory-debugger.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/mgba/debugger/debugger.h b/include/mgba/debugger/debugger.h index 122fdde6f..4ce7c3cf9 100644 --- a/include/mgba/debugger/debugger.h +++ b/include/mgba/debugger/debugger.h @@ -61,6 +61,7 @@ enum mDebuggerEntryReason { struct mDebuggerModule; struct mDebuggerEntryInfo { uint32_t address; + int segment; union { struct { uint32_t oldValue; diff --git a/src/sm83/debugger/debugger.c b/src/sm83/debugger/debugger.c index eafed0329..d24a75463 100644 --- a/src/sm83/debugger/debugger.c +++ b/src/sm83/debugger/debugger.c @@ -54,6 +54,7 @@ static void SM83DebuggerCheckBreakpoints(struct mDebuggerPlatform* d) { } struct mDebuggerEntryInfo info = { .address = breakpoint->address, + .segment = debugger->cpu->memory.currentSegment(debugger->cpu, breakpoint->address), .pointId = breakpoint->id, .target = TableLookup(&d->p->pointOwner, breakpoint->id) }; diff --git a/src/sm83/debugger/memory-debugger.c b/src/sm83/debugger/memory-debugger.c index 4a62448e8..9022a3f07 100644 --- a/src/sm83/debugger/memory-debugger.c +++ b/src/sm83/debugger/memory-debugger.c @@ -62,6 +62,7 @@ static bool _checkWatchpoints(struct SM83Debugger* debugger, uint16_t address, s info->type.wp.oldValue = oldValue; info->type.wp.newValue = newValue; info->address = address; + info->segment = debugger->originalMemory.currentSegment(debugger->cpu, address); info->type.wp.watchType = watchpoint->type; info->type.wp.accessType = type; info->pointId = watchpoint->id;