PMDBG_GetCurrentAppTitleId => PMDBG_GetCurrentAppTitleIdAndPid
This commit is contained in:
@@ -126,12 +126,13 @@ Result GetTitleExHeaderFlags(ExHeader_Arm11CoreInfo *outCoreInfo, ExHeader_Syste
|
||||
return res;
|
||||
}
|
||||
|
||||
Result GetCurrentAppTitleId(u64 *outTitleId)
|
||||
Result GetCurrentAppTitleIdAndPid(u64 *outTitleId, u32 *outPid)
|
||||
{
|
||||
ProcessList_Lock(&g_manager.processList);
|
||||
Result res;
|
||||
if (g_manager.runningApplicationData != NULL) {
|
||||
*outTitleId = g_manager.runningApplicationData->titleId;
|
||||
*outPid = g_manager.runningApplicationData->pid;
|
||||
res = 0;
|
||||
} else {
|
||||
*outTitleId = 0;
|
||||
|
||||
@@ -12,4 +12,4 @@ Result listMergeUniqueDependencies(ProcessData **procs, u64 *dependencies, u32 *
|
||||
Result GetTitleExHeaderFlags(ExHeader_Arm11CoreInfo *outCoreInfo, ExHeader_SystemInfoFlags *outSiFlags, const FS_ProgramInfo *programInfo);
|
||||
|
||||
// Custom
|
||||
Result GetCurrentAppTitleId(u64 *outTitleId);
|
||||
Result GetCurrentAppTitleIdAndPid(u64 *outTitleId, u32 *outPid);
|
||||
|
||||
@@ -14,6 +14,7 @@ void pmDbgHandleCommands(void *ctx)
|
||||
Handle debug;
|
||||
|
||||
u64 titleId;
|
||||
u32 pid;
|
||||
|
||||
switch (cmdhdr >> 16) {
|
||||
case 1:
|
||||
@@ -40,9 +41,11 @@ void pmDbgHandleCommands(void *ctx)
|
||||
// Custom
|
||||
case 0x100:
|
||||
titleId = 0;
|
||||
cmdbuf[1] = GetCurrentAppTitleId(&titleId);
|
||||
cmdbuf[0] = IPC_MakeHeader(0x100, 3, 0);
|
||||
pid = 0xFFFFFFFF;
|
||||
cmdbuf[1] = GetCurrentAppTitleIdAndPid(&titleId, &pid);
|
||||
cmdbuf[0] = IPC_MakeHeader(0x100, 4, 0);
|
||||
memcpy(cmdbuf + 2, &titleId, 8);
|
||||
cmdbuf[4] = pid;
|
||||
break;
|
||||
case 0x101:
|
||||
cmdbuf[1] = DebugNextApplicationByForce();
|
||||
|
||||
Reference in New Issue
Block a user