ImDebugger: Add new Modules windows, turn the old Modules window into what will be a symbol browser

This commit is contained in:
Henrik Rydgård committed 2025-04-02 10:09:19 +02:00
1 parent db62098ca6
commit 4a15ff950c
5 files changed
+78 -24

No files matched your search

+9 -11
View File
@@ -1581,7 +1581,6 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
module->nm.entry_addr = module->nm.module_start_func;
MIPSAnalyst::PrecompileFunctions();
} else {
module->nm.entry_addr = -1;
}
@@ -2364,22 +2363,21 @@ struct GetModuleIdByAddressArg
SceUID result;
};
static bool __GetModuleIdByAddressIterator(PSPModule *module, GetModuleIdByAddressArg *state) {
const u32 start = module->memoryBlockAddr, size = module->memoryBlockSize;
if (start != 0 && start <= state->addr && start + size > state->addr) {
state->result = module->GetUID();
return false;
}
return true;
}
static u32 sceKernelGetModuleIdByAddress(u32 moduleAddr)
{
GetModuleIdByAddressArg state;
state.addr = moduleAddr;
state.result = SCE_KERNEL_ERROR_UNKNOWN_MODULE;
kernelObjects.Iterate(&__GetModuleIdByAddressIterator, &state);
kernelObjects.Iterate<PSPModule>([&state](int id, PSPModule *module) -> bool {
const u32 start = module->memoryBlockAddr, size = module->memoryBlockSize;
if (start != 0 && start <= state.addr && start + size > state.addr) {
state.result = module->GetUID();
return false;
}
return true;
});
if (state.result == (SceUID)SCE_KERNEL_ERROR_UNKNOWN_MODULE) {
return hleLogError(Log::sceModule, state.result, "module not found at address");
} else {