From d8391078c8828e3cf852742963e4f7f7e0f4ab96 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Wed, 19 Sep 2018 15:03:50 +0200 Subject: [PATCH] Fix creport according to latest libnx release changes --- .../creport/source/creport_thread_info.cpp | 6 ++-- .../creport/source/creport_thread_info.hpp | 29 ++----------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/stratosphere/creport/source/creport_thread_info.cpp b/stratosphere/creport/source/creport_thread_info.cpp index ab8c1e397..fbd27a310 100644 --- a/stratosphere/creport/source/creport_thread_info.cpp +++ b/stratosphere/creport/source/creport_thread_info.cpp @@ -28,12 +28,12 @@ void ThreadInfo::SaveToFile(FILE *f_report) { fprintf(f_report, " Registers:\n"); { for (unsigned int i = 0; i <= 28; i++) { - fprintf(f_report, " X[%02u]: %s\n", i, this->code_list->GetFormattedAddressString(this->context.x[i])); + fprintf(f_report, " X[%02u]: %s\n", i, this->code_list->GetFormattedAddressString(this->context.cpu_gprs[i].x)); } fprintf(f_report, " FP: %s\n", this->code_list->GetFormattedAddressString(this->context.fp)); fprintf(f_report, " LR: %s\n", this->code_list->GetFormattedAddressString(this->context.lr)); fprintf(f_report, " SP: %s\n", this->code_list->GetFormattedAddressString(this->context.sp)); - fprintf(f_report, " PC: %s\n", this->code_list->GetFormattedAddressString(this->context.pc)); + fprintf(f_report, " PC: %s\n", this->code_list->GetFormattedAddressString(this->context.pc.x)); } fprintf(f_report, " Stack Trace:\n"); for (unsigned int i = 0; i < this->stack_trace_size; i++) { @@ -58,7 +58,7 @@ bool ThreadInfo::ReadFromProcess(Handle debug_handle, u64 thread_id, bool is_64_ } /* Get the thread context. */ - if (R_FAILED(svcGetDebugThreadContext((u8 *)&this->context, debug_handle, this->thread_id, 0xF))) { + if (R_FAILED(svcGetDebugThreadContext(&this->context, debug_handle, this->thread_id, 0xF))) { return false; } diff --git a/stratosphere/creport/source/creport_thread_info.hpp b/stratosphere/creport/source/creport_thread_info.hpp index 491b988a8..0b3d3f07f 100644 --- a/stratosphere/creport/source/creport_thread_info.hpp +++ b/stratosphere/creport/source/creport_thread_info.hpp @@ -21,34 +21,9 @@ #include "creport_debug_types.hpp" #include "creport_code_info.hpp" -struct FpuReg { - u64 _[2]; /* TODO: uint128? */ -}; - -struct DebugThreadContext { - union { - u64 x[0x20]; - struct { - u64 _x[29]; - u64 fp; - u64 lr; - u64 sp; - }; - }; - u64 pc; - u32 psr; - /* 32-bits of padding. */ - FpuReg fpu_reg[0x20]; - u32 fpcr; - u32 fpsr; - u64 tpidr; -}; - -static_assert(sizeof(DebugThreadContext) == 0x320, "Incorrect DebugThreadContext Definition!"); - class ThreadInfo { private: - DebugThreadContext context{}; + ThreadContext context{}; u64 thread_id = 0; u64 stack_top = 0; u64 stack_bottom = 0; @@ -56,7 +31,7 @@ class ThreadInfo { u32 stack_trace_size = 0; CodeList *code_list; public: - u64 GetPC() { return context.pc; } + u64 GetPC() { return context.pc.x; } u64 GetLR() { return context.lr; } u64 GetId() { return thread_id; }