View Full Version : Personal Debugging/Error code

08-04-2003, 10:53 AM
I thought I'd asked this question before, but I cant find in so maybe I'm hallucinating again...

I've been working lately on error trapping/handling/prevention applications for use with any application. I'm not a huge fan of the debugger. When something goes wrong, I dont feel like hunting it down, I want a detailed list of data pertaining to just what went wrong, dumped to file.

So; I've written all my own memory handling routines that safely allocate and dealloc memory. It checks for leaks and reports the location in the source of allocation, it reports shady use of the memory and the location in the source, and refuses to allow use of pointers to bad memory.

I also have an extensive error class which the programmer can use to track bugs, report errors, log data, etc. All of this is dumped to file to be checked out if a crash occures.

So what I'm wondering is; How many people out there are using their own custom error handling classes? What interesting ideas are floating around? I think we'd all benefit from a little sharing :). I'm willing to put up my error handling routines for general use if enough people are interested. I want to know what you all use.

08-04-2003, 12:08 PM
sounds like a great idea but i dont know much about it. are you writing your routines in Assembly? C? and how are you going about trapping errors?

08-04-2003, 01:55 PM
hmm...if you've figured out what data is leaking etc (it seems as you have) I think the next step would be a graphical representation of the memory dump. So in the text file, for every byte or word or however you want to do it write a ' . ' Then for every peice of memory your app allocates, write an ' x '. That way you can easily see where the memory is going and figure out for instance why pointers are crashing the program etc. I haven't programmed on the pc for a few months otherwise i'd come up with something, im basically laying low until my embedded project starts. But yeah, that's just an idea.

BTW: I forgot to mention that the program should write that to the text file, my explanation probably wasnt all that clear

08-04-2003, 02:24 PM
have you ever heard of a little piece of software called BoundsChecker? It was made by Numega and its job is primarily to catch errors while you're debugging. Memory leaks, reading uninitialized memory, etc. It has been an invaluable tool that I would suggest to anyone who is developing. Anyway, it would eliminate the need for a code-based method.