Previous Section
2. 8 Make Menu
| Contents | Next Section
2.9.2 Resource Editor

2.9.1 The Debug Window



A simple window that can display run-time output sent by your programs. Operatation of Debug Window requires several steps.

Include the dbgwin header file (located in the hlainc\hide folder). #includeonce ("hide\dbgwin.hhf")

2. Link with debug.lib This is done automatically by setting the Output Version (in Compiler Settings dialog, see Options) to Debug (debug mode).

3. Add a global compile time variable called debug to your source. This is done automatically by setting the Output Version to Debug (debug mode).

Displaying text to the debug window is done by a series of macros all of which use the "dbg" namespace.

Current functions:

Dbg.put(arg1,[arg2],[arg...]);
Used somewhat like stdout.put, but less powerful. Eg: dbg.put("The variable MyVar contains the value: ",MyVar);

Dbg.cls:
Clears the debug window display of any text. Eg: dbg.cls;

Dbg.putz (addr);
Displays a zero-terminated string.

Dbg.separator;
Draws a separating dashed line.
Eg: dbg.separator;

dbg.dumpmem(address,length);
Displays an arbitrary memory location at address passed in address parameter and of length passed in length parameter.

Dbg.dumpregs;
Displays the contents of the registers.

Dbg.trace;
Starts HLA trace, displayse current file/linenumber for most instructions.

Dbg.endtrace;
Ends the trace.

Dbg.timer;
Starts a timer for measuring performance of code.

Dbg.endtimer;
Ends the timer and displays the time.