Hello,
The functions "madExcept.GetCrashStackTrace()" and "madExcept.GetThreadStacktrace()" do not return the callstack, return empty string.
My application is 64 bits, written in Delphi and developed in XE7. I am using the MadExcep 4.0.19 (Single Developer Edition).
If the application generates it in 32 bits, the functions work correctly returning the callstack.
Thanks in advance.
GetCrashStackTrace/GetThreadStacktrace do not work in x64
-
- Posts: 21
- Joined: Tue Mar 27, 2018 1:30 am
Re: GetCrashStackTrace/GetThreadStacktrace do not work in x6
Two questions:
1) GetCrashStackTrace() is only supposed to be called from within a try..except block. Is that how you've called it in x64?
2) Do you have madExcept fully enabled (in the "madExcept settings..." dialog) and compiled the EXE within the IDE?
GetThreadStacktrace() is problematic in x64, that's a known problem. I'm calling OS APIs in this case, and they don't seem to work well, for some reason I can't manage to figure out. You can workaround it by raising a dummy exception in a try..except block like this:
1) GetCrashStackTrace() is only supposed to be called from within a try..except block. Is that how you've called it in x64?
2) Do you have madExcept fully enabled (in the "madExcept settings..." dialog) and compiled the EXE within the IDE?
GetThreadStacktrace() is problematic in x64, that's a known problem. I'm calling OS APIs in this case, and they don't seem to work well, for some reason I can't manage to figure out. You can workaround it by raising a dummy exception in a try..except block like this:
Code: Select all
try
raise Exception.Create('dummy');
except
currentThreadStackTrace := GetCrashStackTrace();
end;
-
- Posts: 21
- Joined: Tue Mar 27, 2018 1:30 am
Re: GetCrashStackTrace/GetThreadStacktrace do not work in x6
Hello,
And yes for the moment I solved it with a fictitious exception:
This solution is not optimal, so I asked if there was any way.
GetCrashStackTrace/GetThreadStacktrace uses them without try..except, and in both x86 and x64 the code is the same.1) GetCrashStackTrace() is only supposed to be called from within a try..except block. Is that how you've called it in x64?
I have full enabled madExcept, and my application compiled it with the IDE.2) Do you have madExcept fully enabled (in the "madExcept settings..." dialog) and compiled the EXE within the IDE?
And yes for the moment I solved it with a fictitious exception:
Code: Select all
try
raise Exception.Create ('Some error message');
except on E: Exception do
sCurrentStackTrace: = E.StackTrace;
end;