Program Crash Logging

Started by
5 comments, last by try_catch_this 19 years, 11 months ago
I need a way to log the exact point a program crashes and why inorder to track bugs. This is all part of the process of testing on different machiens. Currently I have a console that logs certain events but its not enough because every function does not interact with the console ( and it is not necessary for them to either ). I run netscape and sometimes it crashes on start up, but this other program pops up and is ready to report the exact reason why it crashed. I would like to integrate this kind of error catching in all my programs. Any Idea how this is done? gdipong oglpong Online (43% complete) If you got any requests or suggestions post here
Advertisement
You need a second process that runs in parallel to the first and monitors the health/execution of the first. This does not necessarily mean a second binary, though; with careful design, it can be a second thread within the same application - actually, a first thread since it must start before and terminate after the "application."
Supose I had another thread that was to monitor the application, how would I keep track fo which function the other thread crashed in?



gdipong

oglpong Online (43% complete)


If you got any requests or suggestions post here
Running on Windows? Dr Watson and Windbg are your friends.

Start "drwtsn32.exe" and configure it to create crash dumps. That will cause a .dmp file to get generated when your process crashes.

Make sure your build generate debug symbols, then you can load the crash dumps from a debugger.

Go to http://microsoft.com/ddk/ and download "Debugging Tools for Windows". Install and learn how to use windbg. The help file is really good.

Now open a .dmp file of the crash from windbg. There you have everything you need, such as call stack of the crash.
AP: I havent seen doctor watson since I got winxp, I didnt even know that it came with windows.

I will look into this ddk thing later.



gdipong

oglpong Online (43% complete)


If you got any requests or suggestions post here
http://www.codeproject.com/debug/crash_report.asp?df=100&forumid=14054&exp=0&select=742201

http://www.codeproject.com/debug/windbg_part1.asp
nice link ap

This topic is closed to new replies.

Advertisement