mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 15:00:30 +02:00
Find the companion ELF when a game is launched by folder, and keep line info
Two things kept the companion ELF from doing its job. The first is the one that mattered: fileToStart is the game's own *directory* for folder-launched homebrew (IdentifiedFileType::PSP_PBP_DIRECTORY), which is the normal case when you pick a homebrew in the UI. The search navigated up from it regardless, landing in PSP/GAME and listing sibling games - all directories, all skipped - so app.elf sitting right next to the EBOOT was never found. It only ever worked when the path pointed at the EBOOT itself, which is how headless is invoked, which is why it looked fine from there. Searches the directory itself now when that's what it's given. The second: line info didn't survive loading a savestate. Modules aren't just re-registered there, they're destroyed and rebuilt (KernelObjectPool::Clear), so removing a module's lines in ~PSPModule threw the table away on every state load. The previous commit worked around it by re-reading the companion, which was both wasteful and no help at all to an ELF launched directly - those bytes are long gone by then. SymbolMap already solves this and line info now does it the same way: keep what you have, and let whatever next claims the address range replace it. AddModule replaces by key and is called for every module load, including ones with no line info of their own, so a range gets retired when it's genuinely reused. The whole table goes when the game does, in PSP_Shutdown. That also means the savestate path has nothing to re-read, so state loads no longer pay to re-parse a multi-megabyte ELF. The tradeoff is a window between a module unloading and its range being reclaimed where a lookup can still answer for it. For a debugger that's a stale file:line on an address nothing owns, against certain and total loss on every state load. Verified with --auto-save-load-symbols off, launched both ways: by directory (the case that was broken) and by EBOOT path, both give 3734 symbols and 98383 line rows. pspautotests 314/314, UnitTest 55/55. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
This commit is contained in:
1 parent
4ffbe80d76
commit
3463789597
4 files changed
+27
-10
No files matched your search
@@ -50,6 +50,7 @@
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#include "Core/MIPS/MIPSAnalyst.h"
|
||||
#include "Core/MIPS/MIPSVFPUUtils.h"
|
||||
#include "Core/Debugger/LineInfo.h"
|
||||
#include "Core/Debugger/SymbolMap.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
@@ -626,6 +627,9 @@ void CPU_Shutdown(bool success) {
|
||||
g_CoreParameter.mountIsoLoader = nullptr;
|
||||
delete g_symbolMap;
|
||||
g_symbolMap = nullptr;
|
||||
// Line info outlives individual modules on purpose (see ~PSPModule), so the game going away is
|
||||
// what ends it.
|
||||
g_lineInfo.Clear();
|
||||
|
||||
g_lua.Shutdown();
|
||||
|
||||
|
||||
Reference in new issue
Block a user