Integrated Debugging

There are two integrated debugging tools in RadASM, breakpoints and VKim's debug.


To use breakpoints you must include one of the following lines in your main code.

include \RadASM\masm\inc\
#include "\RadASM\GoAsm\inc\RadDbg.a"
#include( "\RadASM\hla\inc\" )
include \radasm\tasm\inc\

Breakpoints are set using the right click menu in the code editor window. Place the cursor on a line of code and right-click, select Toggle Breakpoint to set or remove a single breakpoint select Clear Breakpoints to remove all breakpoints. Once you have a breakpoint set, the Add Variable selection will be enabled for that line, you can use this to specify variables that you wish to have displayed when the breakpoint is reached. RadASM will pause the program once the line immediately before the breakpoint has executed and a dialog will display a register dump plus the variables you have specified.

Breakpoints require that you run the program from the RadASM Make menu using the Run command. You must remove all breakpoints if you wish to run the program independent of RadASM.

Breakpoints are saved in the file and will not be lost by closing the project. You must re-build a program using breakpoints each time RadASM is opened as the MDI handle must be known for breakpoints to work properly.

There can be a maximum of 10 breakpoints in a project.

VKim's Debug

MASM only

There is a RadASM specific implementation of VKim's debug. To enable it insert the following lines in your main code.

include \RadASM\masm\inc\
includelib \RadASM\masm\lib\debug.lib

DBGWIN_DEBUG_ON = 1 ; include debug info into the program
DBGWIN_EXT_INFO = 1 ; include extra debug info into the program

The RadASM implementation is identical to the original except that instead of outputting to a debug window it will output to the RadASM output window.

For information on using VKim's debug see the help file in \RadASM\Help\DBGWIN.HLP

GoAsm only

The GoAsm includes are currently available at . The GoAsm implementation of VKim's debug requires a minimum of GoAsm 0.46i beta release and supports the following functions:

PrintDec - Syntax = PrintDec(eax) or PrintDec([hInstance]) Only dwords are supported optional text is not.
PrintHex - Same as PrintDec
PrintText - Syntax = PrintText("Quoted text")
PrintString - Syntax = PrintString(StringLabel) do not encase the label in square brackets
PrintStringByAddr - Syntax = PrintStringByAddr(pString)
PrintLine - Same as MASM
PrintError - Same as MASM
DumpMem - Syntax = DumpMem(pMem,nBytes)
DumpFPU - Syntax = DumpFPU
Spy - Syntax = Spy(Label) do not encase the label in square brackets
StopSpy = Same as MASM
TrapException = TrapException(OFFSET CodeLabel)
PrintDouble = PrintDouble(QWordLabel) do not encase the label in square brackets
ASSERT = ASSERT(eax,"Message") if you wish the default message you must use "" in place of "Message"
DbgDump - Syntax = DbgDump(pMem,nBytes)
PrintException - Syntax = PrintException(pEXCEPTION_RECORD)

Extensions for GoAsm version only:
ShowLine - Syntax = ShowLine - Prints the current line number in the output window
DumpEFlags - Syntax = DumpEFlags - dumps the eflags register
DumpMMX - Syntax = DumpMMX - Dumps the MMX registers
Measure/EndMeasure - returns the number of bytes between the two
- Syntax = PrintQWORD(label) do not encase the label in square brackets
PrintQWORDHex - Syntax = PrintQWORDHex(label) do not encase the label in square brackets

The Fix function is unsupported

To enable VKim's debug for GoAsm include the following line in your source code:

#include "\RadASM\GoAsm\inc\debug.a"
DBGWIN_DEBUG_ON = 1 ; use this to enable Spy/StopSpy/DbgDump and TrapException
DBGWIN_SHOWONLYERRORS = 1 ; setting this to 1 will suppress PrintError if no error exists

The directive STRINGS UNICODE will cause debug to translate the PrintString, PrintStringByAddr and PrintText functions from Unicode to ANSI.

External Debuggers

You can set up the Make menu selection to work with your external debugger and you can also include it to your tools menu. For those debuggers that accept command line filenames you can add that with a ,5 at the end of the command line.