1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-23 04:12:02 +00:00

Fix creport according to latest libnx release changes

This commit is contained in:
TuxSH 2018-09-19 15:03:50 +02:00
parent 99d36c423e
commit d8391078c8
2 changed files with 5 additions and 30 deletions

View file

@ -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;
}

View file

@ -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; }