madExcept and msbuild

contains all delphi packages mentioned below
Post Reply
maggigisla
Posts: 10
Joined: Fri May 20, 2011 2:56 pm

madExcept and msbuild

Post by maggigisla »

Hi ...

I'm using the madcollection, and have been for a while, great product.
My problem is this.
If I compile my project in the Delphi IDE then madExcept seem to catch the exceptions raise, but if I compile the same project using msbuild, it seem that madExcept is not existent.
I use the Debug option for configuration in msbuild, and can see mbuild and the IDE are using the same command line argument.
Building the project with msbuild : msbuild project.dproj /p:configuration=Debug
I'm pretty sure it's using the Debug configuration from the project.dproj

Size of exe after MSBUILD
project.exe : 18954
project.Map : 13173

Size of exe after compile with Delphi
project.exe : 19688
project.Map : 13173

Any ideas ?

Edit: I'm using D2007
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept and msbuild

Post by madshi »

If you don't build inside of the Delphi IDE, you need to run the tool "madExceptPatch" (see "madExcept\Tools" directory) after the build. That should solve all problems. FWIW, if you build inside of the IDE, madExcept can automatically adjust compiler and linker settings to its needs. If you build outside, it can not. So you have to make sure they're set correctly yourself. My recommendation:

- turn on all debug options in the *compiler* options
- turn off all debug options in the *linker* options
- set the map file to "detailed"
maggigisla
Posts: 10
Joined: Fri May 20, 2011 2:56 pm

Re: madExcept and msbuild

Post by maggigisla »

Hi and thanks for the response.

I tried what you suggested, did not work, maybe I'm doing something wrong.
Here's what I did :
- Project -> Options -> Compiler
-- Debugging group
--- All options on

- Project -> Options -> Linker
-- Map file Group
--- Detailed option on

There are no debug options in Linker page

Build the project
File size of project.exe 18.956

Run folloing command in command line : madExceptPatch.exe project.exe
Output :
- no *.mes file found for this project
- No default settings found in the registry
- Using factory default settings
- map file appended
File size of project.exe 19.772

Still, exceptions are not caught by madExcept :sorry:

Am I doing something wrong ? something I'm not doing ?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept and msbuild

Post by madshi »

Setting the compiler/linker/map file options in the IDE won't help if you build outside of the IDE. I don't know the msbuild system, but you gotta be able to change the Delphi compiler/linker/map file settings there, too, somehow.

If you have madExcept activated for your project in the IDE, there should be a "yourProject.mes" file in the same folder. This file is needed by the madExceptPatcher tool.
maggigisla
Posts: 10
Joined: Fri May 20, 2011 2:56 pm

Re: madExcept and msbuild

Post by maggigisla »

:crazy:
It worked, my project.mes file was naturally not in my \run folder, after i ran the madExceptPatch.exe and pointed to the *.mes file it worked.
Thank you for great support.
Post Reply