How can I log the callstack with JCL without using raise exception
Asked Answered
C

1

5

Background

We have a problem that sometimes the grid in Devexpress raise exception "Raised EConvertError: Cannot assign a nil to a TFont".

But to trace the real cause of this we have changed Font in cxEdit to be a public property instead with a get and set method. Here I want to log the callstack.

My question

Normally JCL is used to log callstacks when exceptions appear. But how can I log the callstack without using raise exception and show a dialog for the user about this ?

I have found the lines:

var
  GlobalStackList: TJclGlobalStackList;

in JclDebug but I fail to use it. If someone have a example how to get the callstack I would be happy.

Regards Roland Bengtsson

Camisado answered 21/3, 2011 at 7:36 Comment(2)
Not a full duplicate, but you need the same info as answered under Need a way to periodically log the call stack/stack trace for EVERY method/procedure/function calledTurnheim
This is not a exact duplicate of another question, it's specific to JCL. The other question mentioned ended up wanting a call trace and not a call stack.Dx
P
9

This answer shows how to do it with JCL by calling JclCreateStackList.

Predicant answered 21/3, 2011 at 7:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.