enable madExcept in release mode only

delphi package - automated exception handling
Post Reply
kjpx
Posts: 1
Joined: Mon Apr 09, 2018 11:09 am

enable madExcept in release mode only

Post by kjpx »

Hi,

is it possible to enable madexcept automatically when I compile my project in release mode?
Up to now I have to enable/disable it manually on build a new setup.



(madExcept 4.0.18)
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: enable madExcept in release mode only

Post by madshi »

Why do you want it disabled in debug mode?
Han312
Posts: 54
Joined: Mon Mar 14, 2016 3:49 pm

Re: enable madExcept in release mode only

Post by Han312 »

I also disable it by default (since it takes a lot of time on my i7 1st generation computer).
First of all when having the option 'report ressource leaks' enabled.
And I can open only some projects at the same time since I reach the 2 Gb memory limit very fast.

So I disabled it by default and patch it only in the Post-Build-Events (for the release):

"c:\Program Files (x86)\madCollection\madExcept\Tools\madExceptPatch.exe" "$(OutputPath)" "w:\\My_PostBuildRelease.mes"

The advantage is that
a) I can use different MES files for different configurations
and
b) different developers or computer can use the same madexcept settings for a release.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: enable madExcept in release mode only

Post by madshi »

Yes, leak reporting makes everything slower and consumes a lot of RAM. So it absolutely makes sense to only enable leak reporting selectively, when you need it. But without leak reporting (and "instantly crash on buffer overrun") madExcept should not really slow your program down at all, so why disabling madExcept completely in either debug or release mode?
Han312
Posts: 54
Joined: Mon Mar 14, 2016 3:49 pm

Re: enable madExcept in release mode only

Post by Han312 »

madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: enable madExcept in release mode only

Post by madshi »

Well, it's hard for me to give recommendations/suggestions if I don't fully understand the reason for why people want what they want. Maybe there's a simple workaround available? But I can't really suggest anything if I don't have all the information.

Possible reasons for not wanting to enable madExcept for release builds could be:

1) Fear that the function names and line numbers could help hackers reverse engineer the code.
2) Fear that madExcept might cause instability.
3) Fear that madExcept might slow the program down.
4) [...]

If 1) is the key problem, then obviously any solution which still embeds function names and line numbers into the code might not be deemed acceptable - unless maybe it's encrypted?

If I knew the exact reasons, I could maybe suggest a good solution, without having to go to the lengths of adding support for release vs debug builds. The problem is that once I start supporting release vs debug builds, it probably won't stop there. But then people will use custom builds and want to support that, as well. It can get complex very quickly.
Han312
Posts: 54
Joined: Mon Mar 14, 2016 3:49 pm

Re: enable madExcept in release mode only

Post by Han312 »

In my case I couldn't digitally sign the exe in postbuild as long as madexcept was enabled.
This was some years ago.
So I am not sure whether today I would have still the same problems. (But I also don't want to test it.)
Post Reply