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 #ifdef USE_ELF
struct ELF; struct ELF;
bool mCoreLoadELF(struct mCore* core, struct ELF* elf); bool mCoreLoadELF(struct mCore* core, struct ELF* elf);
#ifdef USE_DEBUGGERS
void mCoreLoadELFSymbols(struct mDebuggerSymbols* symbols, struct ELF*); void mCoreLoadELFSymbols(struct mDebuggerSymbols* symbols, struct ELF*);
#endif #endif
#endif
CXX_GUARD_END CXX_GUARD_END

View File

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

View File

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

View File

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