Simplify QR stacktrace (#121)
This commit is contained in:
committed by
GitHub
parent
34f99205ca
commit
43714b2355
@@ -14,13 +14,15 @@ std::string getUrlFromCrashData() {
|
||||
for (int i = 0; i < crash_data->callstackLength; ++i) {
|
||||
const CallstackFrame&frame = crash_data->callstack[i];
|
||||
uint32_t pc = esp_cpu_process_stack_pc(frame.pc);
|
||||
#if CRASH_DATA_INCLUDES_SP
|
||||
uint32_t sp = frame.sp;
|
||||
#endif
|
||||
stack_buffer[i * 2] = pc;
|
||||
#if CRASH_DATA_INCLUDES_SP
|
||||
stack_buffer[(i * 2) + 1] = sp;
|
||||
#endif
|
||||
}
|
||||
|
||||
assert(sizeof(CallstackFrame) == 8);
|
||||
|
||||
std::stringstream stream;
|
||||
|
||||
stream << "https://oops.bytewelder.com?";
|
||||
@@ -31,8 +33,11 @@ std::string getUrlFromCrashData() {
|
||||
|
||||
for (int i = crash_data->callstackLength - 1; i >= 0; --i) {
|
||||
uint32_t pc = stack_buffer[(i * 2)];
|
||||
stream << std::hex << pc;
|
||||
#if CRASH_DATA_INCLUDES_SP
|
||||
uint32_t sp = stack_buffer[(i * 2) + 1];
|
||||
stream << std::hex << pc << std::hex << sp;
|
||||
stream << std::hex << sp;
|
||||
#endif
|
||||
}
|
||||
|
||||
free(stack_buffer);
|
||||
|
||||
Reference in New Issue
Block a user