Crash log: Checkpoint each line of decoded stack trace

This commit is contained in:
Jonathan G Rennison
2023-06-12 19:03:37 +01:00
parent da07c8ce51
commit 76304c1f76
3 changed files with 13 additions and 0 deletions

View File

@@ -16,6 +16,7 @@
#include "../../screenshot.h" #include "../../screenshot.h"
#include "../../debug.h" #include "../../debug.h"
#include "../../video/video_driver.hpp" #include "../../video/video_driver.hpp"
#include "../../scope.h"
#include "macos.h" #include "macos.h"
#include <errno.h> #include <errno.h>
@@ -235,6 +236,10 @@ class CrashLogOSX : public CrashLog {
#endif #endif
for (; frame != nullptr && i < MAX_STACK_FRAMES; i++) { for (; frame != nullptr && i < MAX_STACK_FRAMES; i++) {
auto guard = scope_guard([&]() {
this->CrashLogFaultSectionCheckpoint(buffer);
});
/* Get IP for current stack frame. */ /* Get IP for current stack frame. */
#if defined(__ppc__) || defined(__ppc64__) #if defined(__ppc__) || defined(__ppc64__)
void *ip = frame[2]; void *ip = frame[2];

View File

@@ -13,6 +13,7 @@
#include "../../string_func.h" #include "../../string_func.h"
#include "../../gamelog.h" #include "../../gamelog.h"
#include "../../sl/saveload.h" #include "../../sl/saveload.h"
#include "../../scope.h"
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
@@ -526,6 +527,9 @@ class CrashLogUnix : public CrashLog {
#endif /* WITH_BFD */ #endif /* WITH_BFD */
for (int i = 0; i < trace_size; i++) { for (int i = 0; i < trace_size; i++) {
auto guard = scope_guard([&]() {
this->CrashLogFaultSectionCheckpoint(buffer);
});
#if defined(WITH_DL) #if defined(WITH_DL)
Dl_info info; Dl_info info;
#if defined(WITH_DL2) #if defined(WITH_DL2)

View File

@@ -24,6 +24,7 @@
#include "../../settings_type.h" #include "../../settings_type.h"
#include "../../thread.h" #include "../../thread.h"
#include "../../walltime_func.h" #include "../../walltime_func.h"
#include "../../scope.h"
#if defined(WITH_DEMANGLE) #if defined(WITH_DEMANGLE)
#include <cxxabi.h> #include <cxxabi.h>
#endif #endif
@@ -515,6 +516,9 @@ char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) c
/* Walk stack at most MAX_FRAMES deep in case the stack is corrupt. */ /* Walk stack at most MAX_FRAMES deep in case the stack is corrupt. */
for (uint num = 0; num < MAX_FRAMES; num++) { for (uint num = 0; num < MAX_FRAMES; num++) {
auto guard = scope_guard([&]() {
this->CrashLogFaultSectionCheckpoint(buffer);
});
if (!proc.pStackWalk64( if (!proc.pStackWalk64(
#ifdef _M_AMD64 #ifdef _M_AMD64
IMAGE_FILE_MACHINE_AMD64, IMAGE_FILE_MACHINE_AMD64,