mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-10 06:01:52 +00:00
Address comment
This commit is contained in:
parent
a33ace8996
commit
bbcb3757bd
2 changed files with 17 additions and 16 deletions
|
@ -17,14 +17,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
struct StackFrame64 {
|
union StackFrame {
|
||||||
|
struct {
|
||||||
u64 fp;
|
u64 fp;
|
||||||
u64 lr;
|
u64 lr;
|
||||||
};
|
} frame_64;
|
||||||
|
struct {
|
||||||
struct StackFrame32 {
|
|
||||||
u32 fp;
|
u32 fp;
|
||||||
u32 lr;
|
u32 lr;
|
||||||
|
} frame_32;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AttachProcessInfo {
|
struct AttachProcessInfo {
|
||||||
|
|
|
@ -115,14 +115,14 @@ bool ThreadInfo::ReadFromProcess(std::map<u64, u64> &tls_map, Handle debug_handl
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a new frame. */
|
/* Read a new frame. */
|
||||||
StackFrame64 cur_frame;
|
StackFrame cur_frame;
|
||||||
if (R_FAILED(svcReadDebugProcessMemory(&cur_frame, debug_handle, cur_fp, sizeof(StackFrame64)))) {
|
if (R_FAILED(svcReadDebugProcessMemory(&cur_frame, debug_handle, cur_fp, sizeof(cur_frame.frame_64)))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance to the next frame. */
|
/* Advance to the next frame. */
|
||||||
this->stack_trace[this->stack_trace_size++] = cur_frame.lr;
|
this->stack_trace[this->stack_trace_size++] = cur_frame.frame_64.lr;
|
||||||
cur_fp = cur_frame.fp;
|
cur_fp = cur_frame.frame_64.fp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (unsigned int i = 0; i < sizeof(this->stack_trace)/sizeof(u64); i++) {
|
for (unsigned int i = 0; i < sizeof(this->stack_trace)/sizeof(u64); i++) {
|
||||||
|
@ -132,14 +132,14 @@ bool ThreadInfo::ReadFromProcess(std::map<u64, u64> &tls_map, Handle debug_handl
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a new frame. */
|
/* Read a new frame. */
|
||||||
StackFrame32 cur_frame;
|
StackFrame cur_frame;
|
||||||
if (R_FAILED(svcReadDebugProcessMemory(&cur_frame, debug_handle, cur_fp, sizeof(StackFrame32)))) {
|
if (R_FAILED(svcReadDebugProcessMemory(&cur_frame, debug_handle, cur_fp, sizeof(cur_frame.frame_32)))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance to the next frame. */
|
/* Advance to the next frame. */
|
||||||
this->stack_trace[this->stack_trace_size++] = cur_frame.lr;
|
this->stack_trace[this->stack_trace_size++] = cur_frame.frame_32.lr;
|
||||||
cur_fp = cur_frame.fp;
|
cur_fp = cur_frame.frame_32.fp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue