CrashLogWindows Class Reference

Windows implementation for the crash logger. More...

Inheritance diagram for CrashLogWindows:
CrashLog

Public Member Functions

char * AppendDecodedStacktrace (char *buffer, const char *last) const
 CrashLogWindows (EXCEPTION_POINTERS *ep=NULL)
 A crash log is always generated when it's generated.

Data Fields

char crashlog [65536]
 Buffer for the generated crash log.
char crashlog_filename [MAX_PATH]
 Buffer for the filename of the crash log.
char crashdump_filename [MAX_PATH]
 Buffer for the filename of the crash dump.
char screenshot_filename [MAX_PATH]
 Buffer for the filename of the crash screenshot.

Static Public Attributes

static CrashLogWindowscurrent = NULL
 Points to the current crash log.

Private Member Functions

char * LogOSVersion (char *buffer, const char *last) const
 Writes OS' version to the buffer.
char * LogError (char *buffer, const char *last, const char *message) const
 Writes actually encountered error to the buffer.
char * LogStacktrace (char *buffer, const char *last) const
 Writes the stack trace to the buffer, if there is information about it available.
char * LogRegisters (char *buffer, const char *last) const
 Writes information about the data in the registers, if there is information about it available.
char * LogModules (char *buffer, const char *last) const
 Writes the dynamically linked libaries/modules to the buffer, if there is information about it available.

Private Attributes

EXCEPTION_POINTERS * ep
 Information about the encountered exception.

Detailed Description

Windows implementation for the crash logger.

Definition at line 45 of file crashlog_win.cpp.


Constructor & Destructor Documentation

CrashLogWindows::CrashLogWindows ( EXCEPTION_POINTERS *  ep = NULL  )  [inline]

A crash log is always generated when it's generated.

Parameters:
ep the data related to the exception.

Definition at line 75 of file crashlog_win.cpp.

References crashdump_filename, crashlog, crashlog_filename, and screenshot_filename.


Member Function Documentation

char * CrashLogWindows::LogError ( char *  buffer,
const char *  last,
const char *  message 
) const [private, virtual]

Writes actually encountered error to the buffer.

Parameters:
buffer The begin where to write at.
last The last position in the buffer to write to.
message Message passed to use for possible errors. Can be NULL.
Returns:
the position of the ' ' character after the buffer.

Implements CrashLog.

Definition at line 110 of file crashlog_win.cpp.

References ep, and seprintf().

char * CrashLogWindows::LogModules ( char *  buffer,
const char *  last 
) const [private, virtual]

Writes the dynamically linked libaries/modules to the buffer, if there is information about it available.

Parameters:
buffer The begin where to write at.
last The last position in the buffer to write to.
Returns:
the position of the ' ' character after the buffer.

Reimplemented from CrashLog.

Definition at line 213 of file crashlog_win.cpp.

References AllocaM, lengthof, LoadLibraryList(), min(), and seprintf().

char * CrashLogWindows::LogOSVersion ( char *  buffer,
const char *  last 
) const [private, virtual]

Writes OS' version to the buffer.

Parameters:
buffer The begin where to write at.
last The last position in the buffer to write to.
Returns:
the position of the ' ' character after the buffer.

Implements CrashLog.

Definition at line 92 of file crashlog_win.cpp.

References seprintf().

char * CrashLogWindows::LogRegisters ( char *  buffer,
const char *  last 
) const [private, virtual]

Writes information about the data in the registers, if there is information about it available.

Parameters:
buffer The begin where to write at.
last The last position in the buffer to write to.
Returns:
the position of the ' ' character after the buffer.

Reimplemented from CrashLog.

Definition at line 241 of file crashlog_win.cpp.

References ep, and seprintf().

char * CrashLogWindows::LogStacktrace ( char *  buffer,
const char *  last 
) const [private, virtual]

Writes the stack trace to the buffer, if there is information about it available.

Parameters:
buffer The begin where to write at.
last The last position in the buffer to write to.
Returns:
the position of the ' ' character after the buffer.

Implements CrashLog.

Definition at line 305 of file crashlog_win.cpp.

References ep, and seprintf().


The documentation for this class was generated from the following file:

Generated on Fri Mar 18 23:18:28 2011 for OpenTTD by  doxygen 1.6.1