Enable Stack trace with buld tool final builder

delphi package - automated exception handling
Post Reply
Josef Schwaab
Posts: 8
Joined: Mon Jul 11, 2005 10:12 am

Enable Stack trace with buld tool final builder

Post by Josef Schwaab »

Hi,

I have problems enabling the stack trace for MadExcept when using the build tool 'Final Builder'.

Is there a check list, what I could have done wrong?

If I compile the program with Delphi 5 IDE all works fine and for my test-exception I get the following trace:

Code: Select all

main thread ($804):
00bf5a39 Spirit.exe UIcarus  8963 TFIcarus.RaiseException1Click
00478854 Spirit.exe Menus         TMenuItem.Click
00479b6f Spirit.exe Menus         TMenu.DispatchCommand
0048318f Spirit.exe Forms         TCustomForm.WMCommand
0046846d Spirit.exe Controls      TControl.WndProc
0046afb6 Spirit.exe Controls      TWinControl.WndProc
0048138e Spirit.exe Forms         TCustomForm.WndProc
0046abb8 Spirit.exe Controls      TWinControl.MainWndProc
0047e59c Spirit.exe Forms         StdWndProc
77d1e900 user32.dll               CallWindowProcA
00beac85 Spirit.exe UIcarus  4340 NewWindowProc
77d196c2 user32.dll               DispatchMessageA
00487803 Spirit.exe Forms         TApplication.ProcessMessage
0048783a Spirit.exe Forms         TApplication.HandleMessage
00487a45 Spirit.exe Forms         TApplication.Run
00e49b52 Spirit.exe               initialization
If I compile the same program in a build script with FinalBuilder, I get the follwing trace:

Code: Select all

main thread ($b8c):
04b765ee SPIRIT12.exe 
77d1e900 user32.dll    CallWindowProcA
77d196c2 user32.dll    DispatchMessageA
I allready checked the following:

a) I did call MadExceptPatch after the compile
b) Debug is checked as well as Local Symbols and Reference Info
c) Detailed Map File is checked
d) AppendMapFileToBinary=1 and HandleExceptions=1 is set in the mes file

What else could I have done wrong?

Thanks for any hints
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You don't need to call madExceptPatch yourself. FinalBuilder comes with a madExcept action, which internally calls madExceptPatch for you.

Anyway, that shouldn't be the cause of the problem. Does the FinalBuilder action give you any warnings/complaints?
Josef Schwaab
Posts: 8
Joined: Mon Jul 11, 2005 10:12 am

Post by Josef Schwaab »

The Delphi 5 compiler shows some hints and two warnings. None of them seems to be related wiht MadExcept.

The MadExceptPatch also gives no warnings

Extract of the final baulder log as below:

Code: Select all

...

586533 lines, 72.80 seconds, 14294 bytes code, 8 bytes data.
******************************************************
Working around D5 Compiler Bug
==============================
Using Command Line :  /M C:\temp\Spirit_12_20.fbp3\st-development\Project\Spirit\source\Spirit.dpr /Q
Borland Delphi  Version 13.0  Copyright (c) 1983,99 Inprise Corporation
743 lines, 9.03 seconds, 10737280 bytes code, 486477 bytes data.
******************************************************

-------------------------------------------------------------- 

Unit initialization order patched.
Settings stored.
map file compressed into "mad" file
 

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

Post by madshi »

That looks alright. Are you sure that you gave in the correct paths to your exe and to the map and mes files in the madExcept FinalBuilder action?

Please check whether there's a "MAD" resource in your executable file. You can use this freeware tool for that: http://www.angusj.com/resourcehacker/
Josef Schwaab
Posts: 8
Joined: Mon Jul 11, 2005 10:12 am

Post by Josef Schwaab »

I do find a resource Mad/EXCEPTION/0 in my exe now, but still have the same stack trace as above.

I haven't had the MAD resource yesterday, probably because I got the wrong MES file version from CVS. But now it is in there (triple checked :wink: ).
I also switched now to the MadExceptAction (thanks for the hint).
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Are you sure that the right map file is used? Normally when you have that "MAD" resources, everything should be fine - unless it was built from a wrong map file.
Josef Schwaab
Posts: 8
Joined: Mon Jul 11, 2005 10:12 am

Post by Josef Schwaab »

It should be okay. The exe and the map file have about the same time stamp.

Each file is about 14MB. Would it make sense to send the map file to you?

BTW: I did rename the exe in the FinalBuilder script after the build and the patch had been completed. So I checked, if there is any difference, when I rename it back. No effect.
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You can send the files to me (exe+map+mes), but please zipped! :D I don't have FinalBuilder running here, though. I can only test it with madExceptPatch.exe (which is internally called by the FinalBuilder action, though, so it should be comparable).
Post Reply