Core: Fix some linking issues when debuggers are disabled

This commit is contained in:
Vicki Pfau 2018-03-09 22:30:04 -08:00
parent 253ca1d1b8
commit 3443c14169
4 changed files with 8 additions and 1 deletions

View File

@ -196,8 +196,10 @@ void* mCoreGetMemoryBlock(struct mCore* core, uint32_t start, size_t* size);
#ifdef USE_ELF
struct ELF;
bool mCoreLoadELF(struct mCore* core, struct ELF* elf);
#ifdef USE_DEBUGGERS
void mCoreLoadELFSymbols(struct mDebuggerSymbols* symbols, struct ELF*);
#endif
#endif
CXX_GUARD_END

View File

@ -344,6 +344,7 @@ bool mCoreLoadELF(struct mCore* core, struct ELF* elf) {
return true;
}
#ifdef USE_DEBUGGERS
void mCoreLoadELFSymbols(struct mDebuggerSymbols* symbols, struct ELF* elf) {
size_t symIndex = ELFFindSection(elf, ".symtab");
size_t names = ELFFindSection(elf, ".strtab");
@ -363,5 +364,5 @@ void mCoreLoadELFSymbols(struct mDebuggerSymbols* symbols, struct ELF* elf) {
mDebuggerSymbolAdd(symbols, name, syms[i].st_value, -1);
}
}
#endif
#endif

View File

@ -716,7 +716,9 @@ static void _GBACoreLoadSymbols(struct mCore* core, struct VFile* vf) {
}
struct ELF* elf = ELFOpen(vf);
if (elf) {
#ifdef USE_DEBUGGERS
mCoreLoadELFSymbols(core->symbolTable, elf);
#endif
ELFClose(elf);
}
if (closeAfter) {

View File

@ -83,10 +83,12 @@ bool mPythonScriptEngineLoadScript(struct mScriptEngine* se, const char* name, s
void mPythonScriptEngineRun(struct mScriptEngine* se) {
struct mPythonScriptEngine* engine = (struct mPythonScriptEngine*) se;
#ifdef USE_DEBUGGERS
struct mDebugger* debugger = mScriptBridgeGetDebugger(engine->sb);
if (debugger) {
mPythonSetDebugger(debugger);
}
#endif
mPythonRunPending();
}