Delphi XE8 Application handling and 3rd party exception handling tools

465 Views Asked by At

I have given to maintain a project in delphi for which I don't have a clue :). It was converted to XE8 from D5. So it has a lot of custom things ( I am replacing some custom Object lists with Dictionaries since Dictionaries didn't exist in D5). The main application is extending TForm and in the FormCreate method contains this line

Application.OnException := FormException;
HandleException := Application.HandleException;

The FormException method takes the exception and also prints a detailed window with some info and the call stack.

I want to integrate EurekaLog or madExcept in my project to be able to find more info on unhandled exceptions. But although installed and enabled I don't get the the window with the info I want. It runs the FromException method, although I read that when linking with madExcept this gets ignored. Creating a new project simply throwing an exception from a button click with madExcept or EurekaLog activated works properly. I don't know where to look for the exception handling of delphi, and whether I need to have more settings for 3rd party tools. Any ideas?

2

There are 2 best solutions below

1
John Kouraklis On

I use EurekaLog and there are a couple of cases that it doesn't capture the exceptions.

For example, if your app is multi-threaded and it is closing, threads are shutting down and it may happen that EL will not have the time to capture the exception.

You may also have configured EL to ignore specific exceptions. Check the options in the EL settings window.

Make sure that EL is configured for the type of app you have (VCL/FMX/etc.). This is the first option in the EL options windows.

Make sure that the debugger produces detailed map file (Project>Options>Compiler>Linking>Map file --> Detailed)

The last thing I can think of is EL is not properly installed. Go to Project>View Source. If EL is activated for your project, you should be able to see a number of units (EMemLeak, etc....) before the System.StartUpCopy.

BTW, which version of EL do you have?

Elpizo na boithisa...

0
Alex On

EurekaLog see that you have installed Application.OnException event handler and assumes that you want to handle unhandled exceptions by yourself. The similar may be true for madExcept.

If you want to use EurekaLog to handle unhandled exceptions, you can either:

See this for more details.