News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Help debugging first program

Started by monkey, March 07, 2005, 12:19:11 PM

Previous topic - Next topic

monkey

Hi,

I have created a screen capture to demonstrate my problem ( all that is required to view it is a Macromedia Flash capable browser ):

URL removed

I have to admit I did not spend a lot of time with trial & error and am probably doing a lot of things wrong, but any help is still highly appreciatedĀ  :U

Thanks,

Andreas

donkey

Hi Andreas,

I get a refused connection when I click the link you provided. Could you post the project as a zip file so I can take a look at it after work ?

The RadDbg.a file is the include and macro file for the integrated debugger used by RadASM. You would inlcude it in order to use the "right click" breakpoints. It will add certain code to your project and you must remove those breakpoints when you attempt to run the project outside of RadASM.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

monkey

#2
Thanks for your prompt reply, Donkey. After a little more trial & error everything works fine now. I originally installed RadAsm in a sub-dir of C:\, not a good idea at all, since virtually all paths break.

Installing it to C:\ solved all of my issuses.

Is there a way to step through the code once execution halts on a breakpoint?

donkey

The breakpoints in RadASM are a bit of a kludge, they are meant only to provide a subset of the functionality of a full debugger so there is no stepping included. Essentially they only provide a way to examine the registers etc... and a label and continue or halt execution. To do more you will have to use a full featured external debugger like GoBug or OllyDbg. I would suggest GoBug as that debugger displays code in GoAsm format but OllyDbg is also an exceptionally good package. There is currently no line number data embedded with debug builds so the source stepping in OllyDbg will not work but as GoAsm is much more linear there is little actual difference between the code and what the debugger displays. You can also have GoBug dump it's output to a file for perusing "offline", I use this to examine the output of various assemblers.

Also included with the RadGoAsm package is my version of VKim's debug which give you many inline macros that make debugging a problem much easier. For the most part I find that it contains all the tools I need to find and fix a problem. The macros include...

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 - Prints a dashed (---) line
PrintError - Prints the last error message
DumpMem - Syntax = DumpMem(pMem,nBytes)
DumpFPU - Syntax = DumpFPU
Spy - Syntax = Spy(Label) do not encase the label in square brackets
StopSpy = Stops the spying of a label
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
PrintQWORD - Syntax = PrintQWORD(label) do not encase the label in square brackets
PrintQWORDHex - Syntax = PrintQWORDHex(label) do not encase the label in square brackets


If I can find the time I may update the file to reflect the added feature of argument counts, there are many macros that could have used it when I wrote them.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable