Unix crash log: Generalise crash log fault handling to all sections

This commit is contained in:
Jonathan G Rennison
2023-06-12 18:34:37 +01:00
parent fdcfa7318b
commit dd57fc6ecf
3 changed files with 213 additions and 103 deletions

View File

@@ -125,7 +125,7 @@ protected:
* @param last The last position in the buffer to write to.
* @return the position of the \c '\0' character after the buffer.
*/
virtual char *LogScopeInfo(char *buffer, const char *last) const;
char *LogScopeInfo(char *buffer, const char *last) const;
#endif
char *LogOpenTTDVersion(char *buffer, const char *last) const;
@@ -135,6 +135,13 @@ protected:
char *LogRecentNews(char *buffer, const char *list) const;
char *LogCommandLog(char *buffer, const char *last) const;
virtual void StartCrashLogFaultHandler();
virtual void StopCrashLogFaultHandler();
using CrashLogSectionWriter = char *(*)(CrashLog *self, char *buffer, const char *last);
virtual char *TryCrashLogFaultSection(char *buffer, const char *last, const char *section_name, CrashLogSectionWriter writer);
virtual void CrashLogFaultSectionCheckpoint(char *buffer) const;
public:
/** Buffer for the filename name prefix */
char name_buffer[64];