Crash log: Move GDB/LLDB logging to its own section

pull/562/head
Jonathan G Rennison 1 year ago
parent dd57fc6ecf
commit da07c8ce51

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

@ -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.

@ -306,10 +306,16 @@ class CrashLogOSX : public CrashLog {
/**
* Log LLDB information if available
*/
char *LogRegisters(char *buffer, const char *last) const override
char *LogDebugExtra(char *buffer, const char *last) const override
{
buffer = LogLldbInfo(buffer, last);
return this->LogLldbInfo(buffer, last);
}
/**
* Log registers if available
*/
char *LogRegisters(char *buffer, const char *last) const override
{
#ifdef WITH_UCONTEXT
ucontext_t *ucontext = static_cast<ucontext_t *>(context);
#if defined(__x86_64__)

@ -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<ucontext_t *>(context);
#if defined(__x86_64__)

Loading…
Cancel
Save