Getting C++Builder stack trace from call site
Posted: Wed Jun 07, 2017 12:00 pm
I am trying to evaluate madExcept for our BCB 10.2 Tokyo project. We use the 32bit clang toolchain. Everything looks very good apart from not being able to show stack trace which would begin at the original throw site.
So for example:
Will show no exception information (not even EEFFACE, just Unknown) and the stack trace begins from the HandleException line. I would like to see the stack trace start from the throw line.
If the try/catch is commented out and madExcept handles the exception in Delphi side, it works as expected:
Should this work in c++ code?
Thanks!
Jussi
So for example:
Code: Select all
void test()
{
throw new std::exception("test");
}
void __fastcall TForm7::Button2Click(TObject *Sender)
{
try
{
test();
}
catch(...)
{
HandleException();
}
}
Code: Select all
main thread ($513fc):
00000000 +000 ???
76527908 +026 USER32.dll GetMessageW
004449a3 +2f7 Project17.exe Madexcept HandleException
00404b47 +0df Project17.exe Unit7.cpp 62 +8 TForm7.Button2Click
50ab5287 +073 vcl250.bpl Vcl.Controls 7442 +9 TControl.Click
50adaf8a +01e vcl250.bpl Vcl.StdCtrls 5441 +3 TCustomButton.Click
50adba98 +010 vcl250.bpl Vcl.StdCtrls 5902 +1 TCustomButton.CNCommand
Code: Select all
void __fastcall TForm7::Button2Click(TObject *Sender)
{
//try
//{
test();
//}
//catch(...)
//{
// HandleException();
//}
}
Code: Select all
main thread ($50e18):
75efc41f +058 KERNELBASE.dll RaiseException
3222d751 +07d CC32C250MT.DLL ___cxa_throw
004045a7 +0d7 Project17.exe Unit7.cpp 28 +2 test
00404a74 +00c Project17.exe Unit7.cpp 58 +4 TForm7.Button2Click
50ab5287 +073 vcl250.bpl Vcl.Controls 7442 +9 TControl.Click
50adaf8a +01e vcl250.bpl Vcl.StdCtrls 5441 +3 TCustomButton.Click
50adba98 +010 vcl250.bpl Vcl.StdCtrls 5902 +1 TCustomButton.CNCommand
Thanks!
Jussi