kern: clean up majority of TODOs
This commit is contained in:
@@ -163,11 +163,11 @@ namespace ams::creport {
|
||||
svc::DebugEventInfo d;
|
||||
while (R_SUCCEEDED(svcGetDebugEvent(reinterpret_cast<u8 *>(&d), this->debug_handle))) {
|
||||
switch (d.type) {
|
||||
case svc::DebugEvent_AttachProcess:
|
||||
this->HandleDebugEventInfoAttachProcess(d);
|
||||
case svc::DebugEvent_CreateProcess:
|
||||
this->HandleDebugEventInfoCreateProcess(d);
|
||||
break;
|
||||
case svc::DebugEvent_AttachThread:
|
||||
this->HandleDebugEventInfoAttachThread(d);
|
||||
case svc::DebugEvent_CreateThread:
|
||||
this->HandleDebugEventInfoCreateThread(d);
|
||||
break;
|
||||
case svc::DebugEvent_Exception:
|
||||
this->HandleDebugEventInfoException(d);
|
||||
@@ -182,8 +182,8 @@ namespace ams::creport {
|
||||
this->crashed_thread.ReadFromProcess(this->debug_handle, this->thread_tls_map, this->crashed_thread_id, this->Is64Bit());
|
||||
}
|
||||
|
||||
void CrashReport::HandleDebugEventInfoAttachProcess(const svc::DebugEventInfo &d) {
|
||||
this->process_info = d.info.attach_process;
|
||||
void CrashReport::HandleDebugEventInfoCreateProcess(const svc::DebugEventInfo &d) {
|
||||
this->process_info = d.info.create_process;
|
||||
|
||||
/* On 5.0.0+, we want to parse out a dying message from application crashes. */
|
||||
if (hos::GetVersion() < hos::Version_5_0_0 || !IsApplication()) {
|
||||
@@ -217,9 +217,9 @@ namespace ams::creport {
|
||||
this->dying_message_size = userdata_size;
|
||||
}
|
||||
|
||||
void CrashReport::HandleDebugEventInfoAttachThread(const svc::DebugEventInfo &d) {
|
||||
void CrashReport::HandleDebugEventInfoCreateThread(const svc::DebugEventInfo &d) {
|
||||
/* Save info on the thread's TLS address for later. */
|
||||
this->thread_tls_map[d.info.attach_thread.thread_id] = d.info.attach_thread.tls_address;
|
||||
this->thread_tls_map[d.info.create_thread.thread_id] = d.info.create_thread.tls_address;
|
||||
}
|
||||
|
||||
void CrashReport::HandleDebugEventInfoException(const svc::DebugEventInfo &d) {
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ams::creport {
|
||||
std::map<u64, u64> thread_tls_map;
|
||||
|
||||
/* Attach process info. */
|
||||
svc::DebugInfoAttachProcess process_info = {};
|
||||
svc::DebugInfoCreateProcess process_info = {};
|
||||
u64 dying_message_address = 0;
|
||||
u64 dying_message_size = 0;
|
||||
u8 *dying_message = nullptr;
|
||||
@@ -95,8 +95,8 @@ namespace ams::creport {
|
||||
private:
|
||||
void ProcessExceptions();
|
||||
void ProcessDyingMessage();
|
||||
void HandleDebugEventInfoAttachProcess(const svc::DebugEventInfo &d);
|
||||
void HandleDebugEventInfoAttachThread(const svc::DebugEventInfo &d);
|
||||
void HandleDebugEventInfoCreateProcess(const svc::DebugEventInfo &d);
|
||||
void HandleDebugEventInfoCreateThread(const svc::DebugEventInfo &d);
|
||||
void HandleDebugEventInfoException(const svc::DebugEventInfo &d);
|
||||
|
||||
void SaveToFile(ScopedFile &file);
|
||||
|
||||
@@ -56,11 +56,11 @@ namespace ams::dmnt::cheat::impl {
|
||||
size_t target_core = NumCores - 1;
|
||||
|
||||
/* Retrieve correct core for new thread event. */
|
||||
if (dbg_event.type == svc::DebugEvent_AttachThread) {
|
||||
if (dbg_event.type == svc::DebugEvent_CreateThread) {
|
||||
u64 out64 = 0;
|
||||
u32 out32 = 0;
|
||||
|
||||
R_TRY_CATCH(svcGetDebugThreadParam(&out64, &out32, debug_handle, dbg_event.info.attach_thread.thread_id, DebugThreadParam_CurrentCore)) {
|
||||
R_TRY_CATCH(svcGetDebugThreadParam(&out64, &out32, debug_handle, dbg_event.info.create_thread.thread_id, DebugThreadParam_CurrentCore)) {
|
||||
R_CATCH_RETHROW(svc::ResultProcessTerminated)
|
||||
} R_END_TRY_CATCH_WITH_ABORT_UNLESS;
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace ams::dmnt::cheat::impl {
|
||||
svc::DebugEventInfo d;
|
||||
size_t target_core = NumCores - 1;
|
||||
while (R_SUCCEEDED(svc::GetDebugEvent(std::addressof(d), cheat_dbg_hnd))) {
|
||||
if (d.type == svc::DebugEvent_AttachThread) {
|
||||
if (d.type == svc::DebugEvent_CreateThread) {
|
||||
R_TRY(GetTargetCore(std::addressof(target_core), d, cheat_dbg_hnd));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,17 +178,17 @@ namespace ams::fatal::srv {
|
||||
/* First things first, check if process is 64 bits, and get list of thread infos. */
|
||||
std::unordered_map<u64, u64> thread_id_to_tls;
|
||||
{
|
||||
bool got_attach_process = false;
|
||||
bool got_create_process = false;
|
||||
svc::DebugEventInfo d;
|
||||
while (R_SUCCEEDED(svcGetDebugEvent(reinterpret_cast<u8 *>(&d), debug_handle.Get()))) {
|
||||
switch (d.type) {
|
||||
case svc::DebugEvent_AttachProcess:
|
||||
ctx->cpu_ctx.architecture = (d.info.attach_process.flags & 1) ? CpuContext::Architecture_Aarch64 : CpuContext::Architecture_Aarch32;
|
||||
std::memcpy(ctx->proc_name, d.info.attach_process.name, sizeof(d.info.attach_process.name));
|
||||
got_attach_process = true;
|
||||
case svc::DebugEvent_CreateProcess:
|
||||
ctx->cpu_ctx.architecture = (d.info.create_process.flags & 1) ? CpuContext::Architecture_Aarch64 : CpuContext::Architecture_Aarch32;
|
||||
std::memcpy(ctx->proc_name, d.info.create_process.name, sizeof(d.info.create_process.name));
|
||||
got_create_process = true;
|
||||
break;
|
||||
case svc::DebugEvent_AttachThread:
|
||||
thread_id_to_tls[d.info.attach_thread.thread_id] = d.info.attach_thread.tls_address;
|
||||
case svc::DebugEvent_CreateThread:
|
||||
thread_id_to_tls[d.info.create_thread.thread_id] = d.info.create_thread.tls_address;
|
||||
break;
|
||||
case svc::DebugEvent_Exception:
|
||||
case svc::DebugEvent_ExitProcess:
|
||||
@@ -197,7 +197,7 @@ namespace ams::fatal::srv {
|
||||
}
|
||||
}
|
||||
|
||||
if (!got_attach_process) {
|
||||
if (!got_create_process) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ namespace {
|
||||
svc::DebugEventInfo d;
|
||||
while (true) {
|
||||
R_ABORT_UNLESS(svcGetDebugEvent(reinterpret_cast<u8 *>(&d), debug_handle.Get()));
|
||||
if (d.type == svc::DebugEvent_AttachProcess) {
|
||||
return ncm::ProgramId{d.info.attach_process.program_id};
|
||||
if (d.type == svc::DebugEvent_CreateProcess) {
|
||||
return ncm::ProgramId{d.info.create_process.program_id};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user