Debug module main class (singleton). More...
#include <rts/debug.h>
Classes | |
| class | Bin |
| Switches integer output to binary format. More... | |
| class | Dec |
| Switches integer output to decimal format. More... | |
| class | FillChar |
| Sets new fill character. More... | |
| class | Format |
| Old printf style formatting. More... | |
| class | Hex |
| Switches integer output to hexadecimal format. More... | |
| class | HResult |
| Helper class for writing HRESULTs to the debug stream. More... | |
| class | LogDescription |
| class | MemDump |
| Helper class for performing a raw memory dump. More... | |
| class | RepeatChar |
| Repeats a given character N times. More... | |
| class | Width |
| Sets output width for the next insertion. More... | |
Public Types | |
| enum | { MAX_CHECK_HITS = 20 } |
| typedef bool(* | HResultTranslator) (Debug &debug, long hresult, void *user) |
| HRESULT translator callback function type. | |
Public Member Functions | |
| Debug & | operator<< (Hex &) |
| Debug & | operator<< (Dec &) |
| Debug & | operator<< (Bin &) |
| Debug & | operator<< (Width &w) |
| Debug & | operator<< (FillChar &c) |
| Debug & | operator<< (RepeatChar &c) |
| Debug & | operator<< (const Format &f) |
| ~Debug () | |
| bool | AssertDone (void) |
| bool | CheckDone (void) |
| bool | LogDone (void) |
| bool | CrashDone (bool die) |
| Debug & | operator<< (const char *str) |
| void | SetPrefixAndRadix (const char *prefix, int radix) |
| Debug & | operator<< (int val) |
| Debug & | operator<< (unsigned val) |
| Debug & | operator<< (long val) |
| Debug & | operator<< (unsigned long val) |
| Debug & | operator<< (bool val) |
| Debug & | operator<< (float val) |
| Debug & | operator<< (double val) |
| Debug & | operator<< (short val) |
| Debug & | operator<< (unsigned short val) |
| Debug & | operator<< (__int64 val) |
| Debug & | operator<< (unsigned __int64 val) |
| Debug & | operator<< (const void *ptr) |
| Debug & | operator<< (const MemDump &dump) |
| Debug & | operator<< (HResult hres) |
| void | WriteBuildInfo (void) |
| Write build information into log. | |
Static Public Member Functions | |
| static void | InstallExceptionHandler (void) |
| Installs exception handler for current thread. | |
| static bool | SkipNext (void) |
| static Debug & | AssertBegin (const char *file, int line, const char *expr) |
| static Debug & | CheckBegin (const char *file, int line, const char *expr) |
| static Debug & | LogBegin (const char *fileOrGroup) |
| static Debug & | CrashBegin (const char *file, int line) |
| static bool | IsLogEnabled (const char *fileOrGroup) |
| static void | AddHResultTranslator (unsigned prio, HResultTranslator func, void *user=0) |
| Adds a HRESULT translator. | |
| static void | RemoveHResultTranslator (HResultTranslator func, void *user=0) |
| Removes a HRESULT translator. | |
| static bool | AddIOFactory (const char *io_id, const char *descr, DebugIOInterface *(*func)(void)) |
| Registers a new I/O class factory function. | |
| static bool | AddCommands (const char *cmdgroup, DebugCmdInterface *cmdif) |
| Adds a new command group. | |
| static void | RemoveCommands (DebugCmdInterface *cmdif) |
| Removes a command group. | |
| static void | Command (const char *cmd) |
| Issues a debug command. | |
| static void | Update (void) |
| Update method, must be called on a regular basis. | |
| static bool | SimpleMatch (const char *str, const char *pattern) |
| static void | SetBuildInfo (const char *version, const char *internalVersion, const char *buildDate) |
| Tell debug module about build info. | |
Friends | |
| class | DebugCmdInterfaceDebug |
| class | DebugExceptionhandler |
| class | LogDescription |
Debug module main class (singleton).
Definition at line 44 of file debug_debug.h.
HRESULT translator callback function type.
See Debug::AddHResultTranslator for more information.
| debug | Debug instance where info can be written to |
| hresult | current HRESULT value |
| user | user value passed into AddHResultTranslator |
Definition at line 70 of file debug_debug.h.
| anonymous enum |
| Enumerator | |
|---|---|
| MAX_CHECK_HITS | maximum number of times a check can be hit before it is turned off |
Definition at line 53 of file debug_debug.h.
| Debug::~Debug | ( | ) |
Definition at line 247 of file debug_debug.cpp.
|
static |
Adds a new command group.
If the command group already exists the new command interface is added at the end of the list. A command issued for that group is first passed to the 'old' command interface. If that DebugCmdInterface::Execute call fails the command is passed on to the next interface within the same command group.
The only exception is the 'help' command. Here all Execute functions are always called.
Ownership of the interface pointer is passed to the Debug module i.e. the interface is destroyed when the Debug module shuts down (unless the interface is removed using RemoveCommands).
| cmdgroup | command group this interface implements |
| cmdif | command group interface instance |
Definition at line 1034 of file debug_debug.cpp.
|
static |
Adds a HRESULT translator.
A HRESULT translator is called whenever a HResult descriptor is passed into the Debug log stream. Such a translator can translate the numeric value into something more meaningful.
Translators are differentiated by both function address and user pointer. There is however no harm in adding the same translator/user pointer pair twice.
| prio | priority, translators with a higher priority get called first |
| func | translator address |
| user | optional user pointer which will be passed to the given translator |
Definition at line 961 of file debug_debug.cpp.
|
static |
Registers a new I/O class factory function.
This is typically used internally by the DEBUG_IMPLEMENT_IO_INTERFACE macro. If there is already an I/O class with the same name registered the new one overwrites the old.
| io_id | name of I/O class as it should be registered with Debug module |
| descr | short class description |
| func | factory function |
Definition at line 1010 of file debug_debug.cpp.
|
static |
Definition at line 294 of file debug_debug.cpp.
| bool Debug::AssertDone | ( | void | ) |
Definition at line 325 of file debug_debug.cpp.
|
static |
Definition at line 423 of file debug_debug.cpp.
| bool Debug::CheckDone | ( | void | ) |
Definition at line 454 of file debug_debug.cpp.
|
static |
Issues a debug command.
| cmd | command to execute |
Definition at line 1089 of file debug_debug.cpp.
|
static |
Definition at line 549 of file debug_debug.cpp.
Definition at line 582 of file debug_debug.cpp.
|
static |
Installs exception handler for current thread.
For the main thread this is already done, but for any additional threads being created this function must be called.
Definition at line 258 of file debug_debug.cpp.
|
static |
Definition at line 947 of file debug_debug.cpp.
|
static |
Definition at line 506 of file debug_debug.cpp.
| bool Debug::LogDone | ( | void | ) |
Definition at line 539 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | __int64 | val | ) |
Definition at line 818 of file debug_debug.cpp.
Definition at line 234 of file debug_debug.h.
Definition at line 777 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | const char * | str | ) |
Definition at line 700 of file debug_debug.cpp.
Definition at line 326 of file debug_debug.h.
Definition at line 851 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | const void * | ptr | ) |
Definition at line 838 of file debug_debug.cpp.
Definition at line 222 of file debug_debug.h.
| Debug & Debug::operator<< | ( | double | val | ) |
@todo_opt shouldn't use snprintf here - brings in most of the old C IO lib...
Definition at line 790 of file debug_debug.cpp.
Definition at line 278 of file debug_debug.h.
| Debug & Debug::operator<< | ( | float | val | ) |
@todo_opt shouldn't use snprintf here - brings in most of the old C IO lib...
Definition at line 782 of file debug_debug.cpp.
Definition at line 210 of file debug_debug.h.
Definition at line 937 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | int | val | ) |
Definition at line 737 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | long | val | ) |
Definition at line 757 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | RepeatChar & | c | ) |
Definition at line 225 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | short | val | ) |
Definition at line 798 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | unsigned __int64 | val | ) |
Definition at line 828 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | unsigned long | val | ) |
Definition at line 767 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | unsigned short | val | ) |
Definition at line 808 of file debug_debug.cpp.
| Debug & Debug::operator<< | ( | unsigned | val | ) |
Definition at line 747 of file debug_debug.cpp.
Definition at line 256 of file debug_debug.h.
|
static |
Removes a command group.
| cmdif | command group interface that will be removed |
Definition at line 1063 of file debug_debug.cpp.
|
static |
Removes a HRESULT translator.
If the translator/user pointer pair does not exist nothing is done.
| func | translator address |
| user | optional user pointer |
Definition at line 990 of file debug_debug.cpp.
|
static |
Tell debug module about build info.
All these strings are free form and can be up to 63 chars long.
| version | official version |
| internalVersion | internal version |
| buildDate | build date & time |
Definition at line 1418 of file debug_debug.cpp.
| void Debug::SetPrefixAndRadix | ( | const char * | prefix, |
| int | radix ) |
Definition at line 730 of file debug_debug.cpp.
|
static |
Definition at line 1394 of file debug_debug.cpp.
|
static |
Definition at line 263 of file debug_debug.cpp.
|
static |
Update method, must be called on a regular basis.
Scans I/O classes for new command input and processes it.
Definition at line 1095 of file debug_debug.cpp.
| void Debug::WriteBuildInfo | ( | void | ) |
Write build information into log.
Definition at line 1430 of file debug_debug.cpp.
|
friend |
Definition at line 47 of file debug_debug.h.
|
friend |
Definition at line 50 of file debug_debug.h.
|
friend |
Definition at line 333 of file debug_debug.h.
| unsigned Debug::alloc |
allocated buffer size
Definition at line 1065 of file debug_debug.h.
| char* Debug::buffer |
buffer
Definition at line 1059 of file debug_debug.h.
| bool Debug::lastWasCR |
has last character been CR?
Definition at line 1068 of file debug_debug.h.
| unsigned Debug::used |
used buffer size
Definition at line 1062 of file debug_debug.h.