Ok guys, I have two questions

1: If a program is crashing on you how do you figure out what is causing it.

2: Are there tools that let you troubleshoot a program that's crashing on you.

I'm asking these questions cause I'm having these problems and trying to find out what is causing it. OS, winxp home edition or is this something that I don't have to
worry about.

The problem I'm having is that I'm at exerise 2 and now working on exerise 3 of the
Intermediate section of Thomas's mosaic game exerise. Everything is working, but when I complete the puzzle it shows congrats msg box. After I hit OK on it. Then
Windows pops up a message saying an error occur and the program needs to close.

I new to asm and trying to learn but forgive me for my lack of knowledge. I only coded in perl and shell scripts and never had to use a debugger before or anyother
tools. I know this might sound like a stupid ? But It's puzzling me. Ya'll feedback would be appreciated.
Posted on 2003-07-28 16:55:11 by Tweak
i'd recommend olly debugger, which you can get at:

http://home.t-online.de/home/Ollydbg/

hope it helps you.
Posted on 2003-07-28 17:11:35 by Guy on ASM
If you need a kernel mode debugger, I recommend softice. However its not free or cheap. Its painfully expensive, but worth it.

to quote NuMega:

SoftICE is a powerful kernel mode debugger that supports device driver debugging on either a single or dual machine configuration. SoftICE not only debugs SYS files and VxDs, but also can debug Ring 3 applications as well as system internals.

RobotBob
Posted on 2003-07-28 17:24:25 by RobotBob
Then Windows pops up a message saying an error occur and the program needs to close.


Usually there should be a Button on that Box which says that an error occurs saying something like 'More Information' It will tell you usually what the last Register status' were. Usually you can figure out on what line it crashed - which after disassembly of the program in question you see where exactly it is. After all your source code and the disassembly are mostly the same ;)

_____________

My guess is that you have a stack error somewhere.. Like a push without a pop after the Congrats Message is shown.
_____________

Cheers,
JimmyClif
Posted on 2003-07-28 19:28:46 by JimmyClif
one technique that i've always used to quickly locate the misbehaving code is to start removing code...remove the code most recently added, test the program, if it crashes, u know that thats the code thats causing it...if it doesnt, remove the next most recently added code (so u will have removed the most recently added code as well as the next-to-most recently added code), test again...repeat until u find out in this way where in ur program the fault lies

of course it depends on the circumstances and a debugger always helps ;)
Posted on 2003-07-29 00:44:52 by AnotherWay83
I use nothing else but the VKDebug package, provided with masm32 v7 . I follow the method JimmyClif mentioned - get the debug info from that dialogbox, copy it in new_text_document.txt , open my code in HIEW, see what code is around that code, so that I can determine where exactly is the code in my sourcecode file. Then, looking at the register values from new_text_document.txt , I follow the code above the erroneous line, while I find the error. Of course, I first investigate the erroneous line thoroughly. If I don't find the error in 1 minute, I put things like "PrintDec eax" at some key places, and run the proggie. From the debug output most times I can almost instantly find the error. :grin:
Posted on 2003-07-29 02:03:19 by Ultrano
I always write perfect working code. No need to debug :grin:
Posted on 2003-07-29 02:10:30 by bazik