MADExcept and Eurekalog are good products (and there is a JVCL tool as well). If you run your app in the IDE, you get the stack there – but for now, you need to acquire a third party package to get it runtime.I don’t disagree with the wish for a basic call stack tool, that works cross platform, but it would affect third party developers.
Whats the problem? You attach handlers to Exception.GetExceptionStackInfoProc, GetStackInfoStringProc and ` and just call a function that grabs the map or td32 info and generates the callstack – if you don’t want to spend any money for a high quality tool like madExcept (can even use it for free for non commercial use!) then use JclDebug.pas
And it taught me about this by madshi (of MADExcept fame):
DebugEngine is a collection of utils related to debug stuff (stack trace, CPU registers snaphot, debug info,…). Basically, I started to write a commercial error log plugin for Delphi, then I noticed that my internal framework got bigger and bigger. So I decided to share it with the community in hope it will be useful.
And there is the JCL ExceptDlg.pas which is quite easy to use: just add it anywhere to your project and the global exception handler will show you a stack trace provided you have a .MAP file or .TDS file (which contains TD32 symbol information) in the same directory as your .EXE.
–jeroen
Example code:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
I had this warning (which is actually an error: you cannot continue as pressing OK would get you the same warning over and over again) during AQTime installation a while ago:
---------------------------
WARNING !
---------------------------
Setup has detected AQtimerunning on your computer. You must close the application and press OK to continue.
Press Cancel to abort installation.
---------------------------
OK Cancel
---------------------------
It did successfully extract the AQtime.msi before bailing out
The fix (from SmartBear support) was remarkably simple, so I was surprised I could not find it online:
If your downloaded, saved AQtime installation package is named AQtime.exe, rename it: (ex: AQtime850.exe and you should then be able to complete the installation process.
So basically renaming AQTime.exe into AQTime850.exe allowed it to install.
Check out $(BDS)\source\cpprtl\Source\misc\unmangle.c – it contains the source code for the unmangling mechanism used by TDUMP, the debugger and the linker. (C++Builder and Delphi use the same mangling scheme.)
…
This has been around as long as BCC itself. However the file was called um.c instead of unmangle.c in older versions
The AQTimeDemo.exe is the same as the latest AQTime###.exe (functionality depends in license).
The installation from Windows Explorer sometimes fails with the below message. Installation from the command-prompt works, but you need to run it from an Administrator command-prompt:
---------------------------
E:\TEMP\AQtime824.exe
---------------------------
Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.
---------------------------
OK
---------------------------
To get going for my special case, I watched some sample videos (which I did get to work in Internet Explorer but not in Chrome forty-something):
While developing x64 applications, most Windows development tools are actually running in x86 mode, and use an intermediate x64 layer to debug the x64 process even for local debugging.
For Visual Studio 2008 and up, this is msvsmon.exe (for Delphi XE2 and up it is PAServer.exe for remote debugging or [WayBack] dbkw64_16_0.exe for local debugging, other tools use a similar mechanism).
The fun thing with Visual Studio is that when msvsmon.exe fails to load locally, you get a misleading error message:
[Microsoft Visual Studio]
Error while trying to run project: Unable to start debugging.
The Microsoft Visual Studio Remote Debugging Monitor has been closed on the remote machine.
[OK]
I found two workarounds myself :
Kill msvsmon.exe if it is running but Visual Studio cannot talk to it
Restart Visual Studio if it cannot start msvsmon.exe
Delphi XE2 and up sometimes have a similar cryptic message (I forgot to jolt it down, next time I come across it, I will edit this blog post) and usually killing PAServer.exe or dbkw63*.exe or restarting the IDE solves it.