Setting up MASM for use with SoftICE
By Lord Lucifer
Mon January 25, 1999

Introduction



Well, I have had a pain trying to get masm produced executables to debug correctly with SoftICE. After some kludging I've finally figured it out... Its actually simple to do, but if you dont know what you're doing (or haven't read your manual), its quite a pain. Set these options when you build your project and you should have no problems debugging it.
 

Instructions


Step 1 - Setting up The Assembler:
ML /COFF /Zi ...

Step 2 - Setting up The Linker:
Link /SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV ...

Step 3 - Seting up SoftICE:
This batch file will translate the symbol information and package the source code. This will allow you full symbolic and source level debugging.  It will then launch the debugger amd break on the module's entry point (WinMain, DllMain, or DriverEntry). This batch file will completely replace the use of Loader32.exe, giving quick and easy access to the debugger from the command line.

rem DEBUG.BAT
@echo off
nmsym /translate:source,package,always /source:. /load:execute,break %1

Now all you have to do is type "DEBUG MyProgram.exe" on the command line to automatically load the source and symbols and begin debugging.

Step 4 - Setting up the Paths:
Now all you need to do is add your MASM bin directory to the PATH, as in:
SET PATH = %PATH%;C:\MASM\BIN

Step 5 - Using SoftICE to Debug:
Note: It is a good idea to have a WinMain function in your source, so that SoftICE will break on it when it loads the program...
Once you have the program laoded into softice you can use the SRC command to toggle between source view, code view, and mixed mode... You can also set breakpoints on your functions by typing BPX MyFunc. BPM MyVar will break on access to a variable.
Of course, READ YOUR MANUAL so you really know what your doing...

NOTE: These settings haven't seemed to work for everybody... so if you have
problems, or know what I am doing wrong, please let me know.

Hope this helps someone...and thanks Hookflash!
 

For a plaintext copy: softicedb.txt



Copyright (C) 1999
Lord Lucifer lord-lucifer@usa.net