Does anybody have an alternative to using mesageboxes for debugging?
Posted on 2002-01-23 20:20:24 by matthew
OllyDbg - if you want to see the registers...
WinDBG - another debugger

or just print out the value to an edit box


Yeah!!! messagebox debugging, im still using the same tactic :grin:
Posted on 2002-01-23 20:33:47 by stryker
I always trace through the code in OllyDbg.
It's easy to use and hard to do without!
Posted on 2002-01-23 20:35:44 by bitRAKE
If you have the newest MASM v7, check out and use VKim's Debug window for MASM. Its VERY good!

A NaN rated:

... Ernie has a decient console window debugger include on his site too... (but its kinda out dated since Vkim's work).

Posted on 2002-01-23 20:38:35 by NaN

Yeah, the title bar, the status bar, a console window or Vladimir Kim's VKdebug.

Debuggers are cute toys if you actually have the use for them, NuMega's SoftIce seems to be the pick of the crop if you are debugging device drivers, Ollydebug is popular in application level debugging but no debugger will pick an error in logic or help you when you are not getting the results that you expect.

The main idea is to be able to design the test condition that will demonstrate if your code is doing what you intended it to do. How you display it is a matter of taste depending on what you need to do.

Title bars and status bars are very good for displaying results in callbacks that debuggers usually do not do well. Windows is not well suited for debuggers because of its architecture and the privelege levels that it supports so be careful of becoming dependent on such programs as they can leave you without the necessary capacity to solve a problem.

Posted on 2002-01-23 20:44:01 by hutch--
I quite agree with hutch here. I've never used a debugger, it's looking too closely, I want a more overall view.

I like console output myself. Compile a windows program as a console program and you get the best of both world. Start it in a dos box and you can pipe the output to a file.

Check my site for the macros I use.
Posted on 2002-01-23 21:43:18 by Ernie
I use Ernie's debug macros for debugging message loop problems. I use Visual Studio to do my coding. It is really good because it enables you to step through the source that you wrote, or to step through the code that the compiler emits, which is quite handy. It also has the debug window, i can set watches on variables/registers, check memory locations, etc. It has all the good points of all the other debuggers mentioned in previous posts, but is not as low-level as SoftIce.
Posted on 2002-01-23 21:47:03 by sluggy
Thanks everybody,

I think one of the console systems will be best for me.
Posted on 2002-01-23 22:17:32 by matthew
Woohoo, using some simple debugging techniques.. i fixed my
problem, all by myself ;) Less of a need to annoy you guys now.

Posted on 2002-01-23 22:44:44 by matthew
Do you have a link to VKim's debugger?
Posted on 2002-02-22 14:04:41 by sceptor
sceptor: It's in the masm32 package (version 7)

Posted on 2002-02-22 14:07:14 by Thomas
Single stepping through code in a HLL language like VB6 is ok, but in asm, nah. I use Vkims debug macros.

You find vkim's debug macros in the masm32 pack, RadASM IDE pack or AsmEdit IDE pack.

Posted on 2002-02-23 09:57:26 by KetilO
Just use int 3
Posted on 2002-02-23 11:59:58 by Axial
Use the best or else ;)

Posted on 2002-02-24 07:48:19 by latigo
latigo said it all

Posted on 2002-02-24 09:19:47 by ancev
KetilO.... You'd actually rather single step through debugging a vb app then an asm one? -yuck-

At least in asm you've (presumably) got the source in front of you and it's more on the wysiwyg side (as far as source-->machine code). Even with the psuedo hll masm syntax. Obviously it all depends on the code that you're debugging. If it's some crazy heavy duty encryption algo you could be in for an unfriendly debugging experience, but.... Or it could be that my asm programs are just so basic, and that's why I don't have a problem debugging them. ;)
Posted on 2002-02-24 13:05:59 by Will
It depends on the problem at hand and the mood I'm in...
sometimes, printf/messagebox style tracking does the job well
(figuring out which general section of the program that dies).
When the problem area has been narrowed down, firing up a debugger
to check register/return values can be faster than adding more
specific printfs or staring hard at the program source.

Stepping through an algorithm in a debugger can be nice, because
you get to feel the flow of the code, and particularly because
you can mess with registers and memory (like fixing a bad value
and continue on to the next problem with the algorithm instead
of having to do recompile+assemble+link, go through options and
reach the code again).

Some times it's faster debugging the source... but it depends on
the problem at hand. Some of the bugs I've rooted out would have
been tough to fix without feeling the flow of the code and poking
at the registers and memory.

Long live symbolic debugging, watches, and conditional breaks! :).

I do most of my debugging in visual studio's debugger, because it's
symbolic and has nice features. For asm stuff I usually use ollydbg
because it loads a bit faster, and because it has a nice color scheme ;)

When I don't have other activity going on in my machine, I very
often use softice for my asm code debugging. I can bring it up
when I want at a keystroke, I can poke around everything, and it
generally gives a nice warm and fuzzy feeling. Plus for some of the
code I deal with, a kernel level debugger is required (some code
protection I have written is annoying to debug with a ring3 debugger,
as well as some exception handlers, kernel mode code, etc).

But it all comes down to what you feel most comfortable with...
Posted on 2002-02-24 16:15:49 by f0dder
I've tried using a copy of softice that my dad has... version 3 something.
He also has bounds checker but i've never looked at it.

I can't seem to get softice to break on program entry, most of
my programs are short proof-of-concept stuff ;) and run quickly
and exit.

mebby int 3 has something to do with it, i'll look into it.

But because of the nature of some of my programs... when they
only need to say 'post message has failed' or whatever, i use
vkims debug window, or vkim&radasm.

I'll eventually take a look at vkims stuff and make my own procs
for it so i don't need to package dbgwin.exe with whatever i

I forgot: EDIT:
What exactly is symbolic debugging? Sounds like it could make
life easier, and apparantly softice can do something with it.
Posted on 2002-02-24 18:43:13 by matthew
symbolic debugging means you see your variable names instead
of memory addresses, that the debugger has a concept of data
types (pretty convenient when you work with structures ;P), and
generally also that you debug at source level instead of disassembly
level (which obviously is more important when dealing with HLL than
with asm).

As for softice, "i3here on" combined with sticking int 3's in your
code is an effective way of breaking :). The symbol loader allows
you to break at program entry though.
Posted on 2002-02-24 18:52:15 by f0dder
OK, i've got int 3 working, my window is sized nicely: LINES 43; WD.0 10; WC 20; X; ;)

But how do you use symbols? I assembled with /Zi but that made
no apparant difference.. there were a couple options in LINK that
mentioned symbols but i would think i need to do something with
ML first.
Posted on 2002-02-24 19:54:32 by matthew