diff --git a/src/crashlog.cpp b/src/crashlog.cpp index ec3cd07402..359dbdbb44 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -119,6 +119,12 @@ char *CrashLog::LogCompiler(char *buffer, const char *last) const return buffer; } +/* virtual */ char *CrashLog::LogDebugExtra(char *buffer, const char *last) const +{ + /* Stub implementation; not all OSes support this. */ + return buffer; +} + /* virtual */ char *CrashLog::LogRegisters(char *buffer, const char *last) const { /* Stub implementation; not all OSes support this. */ @@ -556,6 +562,9 @@ char *CrashLog::FillCrashLog(char *buffer, const char *last) buffer = this->TryCrashLogFaultSection(buffer, last, "stacktrace", [](CrashLog *self, char *buffer, const char *last) -> char * { return self->LogStacktrace(buffer, last); }); + buffer = this->TryCrashLogFaultSection(buffer, last, "debug extra", [](CrashLog *self, char *buffer, const char *last) -> char * { + return self->LogDebugExtra(buffer, last); + }); buffer = this->TryCrashLogFaultSection(buffer, last, "registers", [](CrashLog *self, char *buffer, const char *last) -> char * { return self->LogRegisters(buffer, last); }); diff --git a/src/crashlog.h b/src/crashlog.h index fd8f76fb10..b212f48d8b 100644 --- a/src/crashlog.h +++ b/src/crashlog.h @@ -99,6 +99,15 @@ protected: */ virtual char *LogStacktrace(char *buffer, const char *last) const = 0; + /** + * Writes information about extra debug info, if there is + * information about it available. + * @param buffer The begin where to write at. + * @param last The last position in the buffer to write to. + * @return the position of the \c '\0' character after the buffer. + */ + virtual char *LogDebugExtra(char *buffer, const char *last) const; + /** * Writes information about the data in the registers, if there is * information about it available. diff --git a/src/os/macosx/crashlog_osx.cpp b/src/os/macosx/crashlog_osx.cpp index fc05d284f9..175c355a74 100644 --- a/src/os/macosx/crashlog_osx.cpp +++ b/src/os/macosx/crashlog_osx.cpp @@ -306,10 +306,16 @@ class CrashLogOSX : public CrashLog { /** * Log LLDB information if available */ + char *LogDebugExtra(char *buffer, const char *last) const override + { + return this->LogLldbInfo(buffer, last); + } + + /** + * Log registers if available + */ char *LogRegisters(char *buffer, const char *last) const override { - buffer = LogLldbInfo(buffer, last); - #ifdef WITH_UCONTEXT ucontext_t *ucontext = static_cast(context); #if defined(__x86_64__) diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp index dc47266bed..56406bc87c 100644 --- a/src/os/unix/crashlog_unix.cpp +++ b/src/os/unix/crashlog_unix.cpp @@ -367,15 +367,19 @@ class CrashLogUnix : public CrashLog { } #endif + /** + * Log GDB information if available + */ + char *LogDebugExtra(char *buffer, const char *last) const override + { + return this->LogGdbInfo(buffer, last); + } + /** * Show registers if possible - * - * Also log GDB information if available */ char *LogRegisters(char *buffer, const char *last) const override { - buffer = LogGdbInfo(buffer, last); - #ifdef WITH_UCONTEXT ucontext_t *ucontext = static_cast(context); #if defined(__x86_64__)