StackTrace dependency on map file !!UPDATE!!

delphi package - automated exception handling

StackTrace dependency on map file !!UPDATE!!

Postby MikRod » Wed Oct 24, 2018 7:12 pm

I think I discovered the root cause of this. I have a "copy exe file to other directory" defined in my Post-build event. It seems that this copying that the compiler does occurs before madExcept is done patching the exe with its stuff. The exe file in the compiler output directory is larger than the file that ends up in the other directory. Using this larger exe file, madExcept works as expected.

If I'm right, the important lesson is that if you use madExcept, do NOT let the compiler do a post-build event.

I have an XE4 32 bit application running on 64 bit OS. It runs several threads. On of the threads is a debugger thread that I can call from another application in order to get the current stacktrace . However, I get much less information out from GetThreadStackTrace if the application is running from a directory which does not contain the map file. I have enabled all the MadExcept linker options so I thought I would not need to distribute the map file in order to get full stack info. Also, if I compile the app with Delphi Compiler -> Linking -> Debug information set to True, then I get full info from GetThreadStackTrace. Below is an example comparing with and without map file/debug info. The map file and the debug info exe are quite large so I wonder if there is something I'm missing? I'm using madExcept 4.0.20.

No mapfile present and not compiled with debug info:

StackTrace for Main thread
03cafe94 +00 ???
75b9343b +10 kernel32.dll BaseThreadInitThunk

StackTrace for DebugInfoWriter
00988cb6 +00 QSoft401.exe
75b9343b +10 kernel32.dll BaseThreadInitThunk

with mapfile present OR compiled with debug info:

StackTrace for Main thread
0335fe94 +000 ???
75d839b9 +00e USER32.dll WaitMessage
006b837d +149 QSoft401.exe Vcl.Forms TApplication.Idle
006b759b +017 QSoft401.exe Vcl.Forms TApplication.HandleMessage
006b78c9 +0c9 QSoft401.exe Vcl.Forms TApplication.Run
00c8b022 +05a QSoft401.exe QSoft401 114 +7 initialization
75b9343b +010 kernel32.dll BaseThreadInitThunk

StackTrace for DebugInfoWriter
00988cb6 +be QSoft401.exe UMrThreads 231 +11 GetStackTraceForAllCurrentThreads
004a825a +ba QSoft401.exe madExcept GetThreadStackTrace
00988cb1 +b9 QSoft401.exe UMrThreads 231 +11 GetStackTraceForAllCurrentThreads
009897fd +8d QSoft401.exe UMrThreads 438 +12 EnableRemoteDebugThread
0053fb16 +42 QSoft401.exe System.Classes ThreadProc
0040b034 +28 QSoft401.exe System 248 +0 ThreadWrapper
75b9343b +10 kernel32.dll BaseThreadInitThunk

Posts: 1
Joined: Wed Oct 24, 2018 6:46 pm

Re: StackTrace dependency on map file !!UPDATE!!

Postby madshi » Tue Nov 13, 2018 6:42 pm

Sorry for the late reply!

You can still make the post-build event work by manually calling "madExceptPatch.exe" on the copied file. It's a command line tool, see "madExcept\Tools" folder.
Site Admin
Posts: 9821
Joined: Sun Mar 21, 2004 5:25 pm

Return to madExcept

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests