Is it possible to include component names in the calll stack?

delphi package - automated exception handling
Post Reply
SveinMarvin
Posts: 2
Joined: Wed May 25, 2022 7:31 am

Is it possible to include component names in the calll stack?

Post by SveinMarvin »

When our customers send bug reports, we sometimes get call stacks like this:

TcxTimer.SetEnabled in cxClasses:1401
TcxCustomButton.MouseUp in cxButtons:1987
TControl.DoMouseUp in Vcl.Controls:7724
TControl.WMLButtonUp in Vcl.Controls:7737
TControl.WndProc in Vcl.Controls:7480
TWinControl.WndProc in Vcl.Controls:10424
TButtonControl.WndProc in Vcl.StdCtrls:5439
TcxCustomButton.WndProc in cxButtons:1744
TWinControl.MainWndProc in Vcl.Controls:10113
StdWndProc in System.Classes:18175
DispatchMessageW in USER32.dll
TApplication.ProcessMessage in Vcl.Forms:11028
TApplication.HandleMessage in Vcl.Forms:11058
TApplication.Run in Vcl.Forms:11196
initialization in Cw:352
BaseThreadInitThunk in KERNEL32.DLL

As you can see, there are no names anywhere, just types. We have many TcxTimers and TcxCustomButtons, but this call stack doesn't help us see which timer/button led to the error, not even which form it came from. Is there any way to include this information in the bug report?
madshi
Site Admin
Posts: 10528
Joined: Sun Mar 21, 2004 5:25 pm

Re: Is it possible to include component names in the calll stack?

Post by madshi »

It's not easily possible because Delphi likes to transport the "self" pointer in registers and not on the stack, which means in order to know which object was involved, we would need to know which register Delphi used at which code position to store the self pointer, *and* which value that register had at the time the code was executed. We usually know neither of these 2 things, and we would need to know both to make your feature wish possible.

madExcept was written in such a way that it doesn't slow down your application as long as it behaves nicely. Only if your application misbehaves (crashes) then madExcept becomes active. This is very important because this allows you to keep madExcept enabled at all time. But this means that madExcept does not have the same amount of information a full blown debugger would have.
SveinMarvin
Posts: 2
Joined: Wed May 25, 2022 7:31 am

Re: Is it possible to include component names in the calll stack?

Post by SveinMarvin »

Ah, ok. Not the answer I was hoping for, but thanks anyway :-)
Post Reply