1

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?

Danilo Casa
  • 506
  • 1
  • 9
  • 18
Apostolos
  • 7,763
  • 17
  • 80
  • 150
  • Remove those two lines of code, and follow the instructions and documentation of madExcept and EurekaLog – David Heffernan Mar 11 '16 at 09:14
  • I did. Still it did not work. Could it be handling the exceptions somewhere else in code. Any specific call back I should look for? – Apostolos Mar 11 '16 at 10:25
  • Who knows. ME works perfectly well for me. What's different in your project? A bit of debugging by bisection is what you need. Or even just old fashioned interactive debugging. Raise an exception that you know you don't handle, and step through the code to see where it goes. – David Heffernan Mar 11 '16 at 10:31
  • This is what I did. Raised an unhandled exception but still it shows the default dialog box of windows/Delphi for exceptions. I know I am not providing more info because I am no delphi epxert, and the project just came in to my hands. – Apostolos Mar 11 '16 at 10:56
  • It sounds like you need to do some learning in that case. Asking us to guess what the problem is does not seem very constructive. I suggest that you do some investigation and some debugging. Do you know how to debug? – David Heffernan Mar 11 '16 at 10:59
  • Make sure the IDE isn't ignoring exceptions of the class you are raising - break at the first-chance exception handler in the IDE and step through. If you don't end up at the RTL exception handler eventually then you're handling the exception somewhere and MadExcept won't step in to do anything. If you do hit the RTL exception handler, then check your MadExcept settings and make sure they're configured correctly. – J... Mar 11 '16 at 11:32
  • @DavidHeffernan Yes, I do now how to debug. As I said I am not a delphi expert, was just asking maybe for some guidance on where to look. – Apostolos Mar 11 '16 at 12:36
  • That's not really how Stack Overflow works. We're about specific questions here with specific answers, not broad guideline and discussion type questions. – David Heffernan Mar 11 '16 at 12:38
  • @DavidHeffernan It was a specific question i think. But anyway, thanks for the effort :) – Apostolos Mar 11 '16 at 13:28
  • "I was just asking maybe for some guidance on where to look" is not specific. – David Heffernan Mar 11 '16 at 13:34
  • Sorry man I won't get in a debate with you whether it was or not...Anyway as I said...thank you for trying to help. – Apostolos Mar 11 '16 at 13:44

2 Answers2

0

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...

John Kouraklis
  • 686
  • 4
  • 12
  • Hello John...it's latest trial 7.x. I will try your recommendations. Eureka or mad exept both work when creating my own project. So I am sure something's wrong with that specific project. I have disabled custom exception handling but still the same problem. Pantws se euxaristw! – Apostolos Mar 12 '16 at 17:14
0

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.

Alex
  • 5,477
  • 2
  • 36
  • 56