|
resonance 1.0.1
|
Sink that the engine formats its diagnostic and failure text into. More...
#include <dbg.h>
Public Member Functions | |
| Dbg () | |
| Install the built-in report handler with no log open and a dump level of zero. | |
| ~Dbg () | |
| Delete the log stream, without flushing it first. | |
| void | OpenLog (const HxStr &path) |
| Replace the log with a file opened for writing. | |
| void | CloseLog () |
| Flush and delete the log stream, if one is open. | |
| void | SetNotify (FailReportProc pfnReport) |
| Install the handler that receives formatted failure text. | |
| void | Notify (const char *pszFormat,...) |
| Format a failure message and pass it to the installed report handler. | |
| Dbg * | Format (const char *pszFormat,...) |
| Format text into the secondary buffer without dispatching it. | |
| Dbg * | Print (const char *pszText) |
| Write literal text. | |
Public Attributes | |
| FailAbortProc | mAbortProc |
| Handler that finishes a failure report. | |
| int | mDumpLevel |
| Detail level a dump routine tests before writing its optional sections. | |
Sink that the engine formats its diagnostic and failure text into.
The class is not polymorphic and has no RTTI. Its name comes from the debugging symbols of the North American demo release. The demo's Notify() and SetNotify() have the same instructions as this class's Notify() and SetNotify().
Only Notify() reaches the outside world in the shipped build. Print() returns without doing anything, and Format() writes into a static buffer that nothing then reads. The roughly four hundred call sites of each are the object dump routines across the whole engine, every DumpText among them, so a reconstructed DumpText produces no output on this target. The string literals it passes survive in .rodata regardless, which is where many recovered member names come from. Reconstruct those calls as written rather than omitting them.
The sink can also own a log file, opened by OpenLog(). No routine in the shipped image calls OpenLog(), and neither Notify() nor Format() writes to the log.
| Rnd::Dbg::Dbg | ( | ) |
Install the built-in report handler with no log open and a dump level of zero.
mInitializedFlag starts at 1, and mAbortProc is not written. The body is inlined into the unit's static initialiser at 0x004ddef8.
| Rnd::Dbg::~Dbg | ( | ) |
Delete the log stream, without flushing it first.
The body is inlined into the static initialiser at 0x004ddef8.
| void Rnd::Dbg::OpenLog | ( | const HxStr & | path | ) |
Replace the log with a file opened for writing.
The previous log is closed first. A file that fails to open is reported as "Couldn't open log %s" and leaves no log open. No call site survives in the shipped program, and the name is inferred from the report text.
| path | The file to write the log to. |
| void Rnd::Dbg::CloseLog | ( | ) |
Flush and delete the log stream, if one is open.
OpenLog() is the one caller. The name is inferred.
| void Rnd::Dbg::SetNotify | ( | FailReportProc | pfnReport | ) |
Install the handler that receives formatted failure text.
A null handler restores the built-in handler at 0x004ddf68.
| pfnReport | The handler to install, or null for the built-in handler. |
| void Rnd::Dbg::Notify | ( | const char * | pszFormat, |
| ... ) |
Format a failure message and pass it to the installed report handler.
This is the only member that produces output.
| pszFormat | A printf-style format string. |
| Dbg * Rnd::Dbg::Format | ( | const char * | pszFormat, |
| ... ) |
Format text into the secondary buffer without dispatching it.
| pszFormat | A printf-style format string. |
| Dbg * Rnd::Dbg::Print | ( | const char * | pszText | ) |
Write literal text.
The body is two instructions that return the sink, so the text is discarded.
| pszText | The text to write. |
| FailAbortProc Rnd::Dbg::mAbortProc |
Handler that finishes a failure report.
Public because main assigns it directly and the image has no accessor for it, unlike the report handler.
+0x00
| int Rnd::Dbg::mDumpLevel |
Detail level a dump routine tests before writing its optional sections.
Public because Rnd::Object::DumpText reads it directly from a sink it does not own, at 0x0053e6d4, and the image exposes no accessor. A positive value adds the referrer list.
+0x0c