DS Core: Backport symbol loading changes from GBA core (fixes #1834)
Vicki Pfau vi@endrift.com
Thu, 30 Jul 2020 19:08:55 -0700
2 files changed,
15 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -29,6 +29,7 @@ - DS GX: Clean up and unify texture mapping
- DS Core: Add symbol loading - DS Video: Simplify VRAM mapping - DS GX: Reject and log polygons that clip to more than 10 vertices + - DS Core: Backport symbol loading changes from GBA core (fixes mgba.io/i/1834) 0.9.0: (Future) Features:
M
src/ds/core.c
→
src/ds/core.c
@@ -83,6 +83,7 @@ core->cpu = arm9;
core->board = ds; core->timing = &ds->ds9.timing; core->debugger = NULL; + core->symbolTable = NULL; dscore->arm7 = arm7; dscore->arm9 = arm9; dscore->debuggerPlatform = NULL;@@ -596,27 +597,38 @@ core->debugger = NULL;
} static void _DSCoreLoadSymbols(struct mCore* core, struct VFile* vf) { -#ifdef USE_ELF bool closeAfter = false; core->symbolTable = mDebuggerSymbolTableCreate(); #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 +#ifdef USE_ELF if (!vf) { closeAfter = true; vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.base, ".elf", O_RDONLY); } #endif if (!vf) { + closeAfter = true; + vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.base, ".sym", O_RDONLY); + } +#endif + if (!vf) { return; } +#ifdef USE_ELF struct ELF* elf = ELFOpen(vf); if (elf) { +#ifdef USE_DEBUGGERS mCoreLoadELFSymbols(core->symbolTable, elf); +#endif ELFClose(elf); + } else +#endif + { + mDebuggerLoadARMIPSSymbols(core->symbolTable, vf); } if (closeAfter) { vf->close(vf); } -#endif } static bool _DSCoreLookupIdentifier(struct mCore* core, const char* name, int32_t* value, int* segment) {