Wrong line numbers on release build

delphi package - automated exception handling
Post Reply
RogerGrib
Posts: 5
Joined: Thu Apr 23, 2015 8:35 pm

Wrong line numbers on release build

Post by RogerGrib »

Hello, I'm using MadExcept 4.02 under Delphi XE7 on Windows 8. When I raise an exception for testing purposes the MadExcept reports correctly shows de line number on Debug builds, but on Release builds the line number reported is wrong (generally lower by more about a hundred). What am I missing? Should I enable some special setting or make adjustments to my compile settings (I'm using the default settings).
Any help will be very appreciated!
Thanks
madshi
Site Admin
Posts: 10765
Joined: Sun Mar 21, 2004 5:25 pm

Re: Wrong line numbers on release build

Post by madshi »

That shouldn't happen. Are you compiling via IDE or are you compiling via command line or some 3rd party tool (e.g. FinalBuilder)?

4.02 is very very old. Try the latest build, 4.0.12:

http://madshi.net/madCollection.exe
RogerGrib
Posts: 5
Joined: Thu Apr 23, 2015 8:35 pm

Re: Wrong line numbers on release build

Post by RogerGrib »

Actually I'm using MadExcept 4.0.12, I made a mistake with the version mumber.
I'm building from RadStudio XE7 itself. As far as I remember, my release compilation settings are the standard ones.
I wonder if you could send me your release optsave as an attachment so I could try it.
madshi
Site Admin
Posts: 10765
Joined: Sun Mar 21, 2004 5:25 pm

Re: Wrong line numbers on release build

Post by madshi »

What is "optsave"? How do I do that?
RogerGrib
Posts: 5
Joined: Thu Apr 23, 2015 8:35 pm

Re: Wrong line numbers on release build

Post by RogerGrib »

Optsave is the file format used by RadStudio tô export compilation settings. To create an optsave file you should open Project Settings, compiling, select the Release option and click on "Save"
madshi
Site Admin
Posts: 10765
Joined: Sun Mar 21, 2004 5:25 pm

Re: Wrong line numbers on release build

Post by madshi »

Ok, here it comes.

One thought: Maybe you have some old ".tds" or ".pdb" file lying around somewhere which might confuse madExcept?

Might be worth a try to test with a brand new empty project to see if the same problem occurs there? On my PC it works just fine.
Attachments
XE7release.zip
(446 Bytes) Downloaded 252 times
RogerGrib
Posts: 5
Joined: Thu Apr 23, 2015 8:35 pm

Re: Wrong line numbers on release build

Post by RogerGrib »

Thank you very much for your kindness.
Now I'm even more confused! The line numbers worked with your release optset settings, but then I noticed that the "Debug information" option is enabled in your settings, which afaik is disabled in the standard release settings.
Then I did as you suggested and created a new project. Then MadExcept worked perfectly, showing line numbers even with "Debug information" disabled on the release settings.
Summing up: there's something in my project (wich is a large project) that stops MadExcept from showing line numbers correctly when compiling under standard release settings. I can fix it enabling "Debug information" in the release compiling settings, but then it is no longer a "release", right?
RogerGrib
Posts: 5
Joined: Thu Apr 23, 2015 8:35 pm

Re: Wrong line numbers on release build

Post by RogerGrib »

I forgot to mention that there is no tds or pdb files on my project, as you asked.
I'm using some IDE add-ons, like IDEFixPack and DDevExtensions. Maybe I'll remove them and see if that helps.
madshi
Site Admin
Posts: 10765
Joined: Sun Mar 21, 2004 5:25 pm

Re: Wrong line numbers on release build

Post by madshi »

The compiler options don't matter, as far as your final EXE is concerned. There will not be much of a difference, if any at all. The compiler debug options make the DCUs larger. But the linker debug options decide which of the DCU debug stuff ends up in the final EXE. So as long as you have the debug options disabled in the linker settings, you don't need to worry much about having debug options enabled in the compiler section. madExcept does need some compiler debug options to be enabled. It usually does that automatically. So probably with your test project when you disabled the compiler debug options, madExcept simply reenabled them "behind your back" the next time you compiled/saved your project. Not sure why this seems to fail with your main project. My best guess right now is that if you disable the compiler debug options in your main project, madExcept uses some outdated yourProject.map file to create the line number information, and that's why you get wrong numbers, simply because the map file is outdated.
Post Reply