2010. augusztus 17., kedd

Advanced Debug manager (Exception handler)


Problem/Question/Abstract:

How to implement a Debug class that show unit name, function name and line number of an exception.

Answer:

Download the attached file...

The requirement is to enable detailled map file generation in project linker option tab.

DEBUG_MODE is a boolean constant that indiquates if Debug object is activate by default at startup.
Command line /debug and /nodebug parameters modify it.

TObjectInfos is used for getting class instance informations like name, parent(s), owner(s)...
TMapFile is used for getting an exception informations : unit name, procedure name and line number.

IDebug is an interface implemented by TDebug.
Function GetDebug return a IDebug pointer refering to a TDebug instance created and destroyed in finalization unit part.
User can't create or destroy

User can set Before and After exception event callbacks and set the activation state.
ShowException is used by the internal exception handler and can be used by user.

A beautiful except form and a log file can be implemented...


Component Download: http://download.urimont.com/DebugManager.zip

Nincsenek megjegyzések:

Megjegyzés küldése