Get variables with call stack

Vladimir Panteleev thecybershadow.lists at gmail.com
Sat Sep 22 05:43:53 UTC 2018


On Friday, 21 September 2018 at 19:08:36 UTC, ANtlord wrote:
> Hello! I need to make a some sort of error report system for an 
> application. I want to catch base Exception class instance and 
> report call stack and with the call stack I want to report all 
> variables with their values. There are a couple of services 
> that make report using call stack and provides variables' 
> values. Sentry.io, New Relic etc.
>
> I see how to get call stack, the book Adam Ruppe writes helps 
> me. How to get all variables from every layer of call stack?

The only way to do that would be using a debugger.

The specifics of the solution would thus depend on the platform. 
On POSIX, it would probably mean getting gdb to print a detailed 
backtrace for your project. On Windows, you might be able to 
achieve this by spawning a thread which then uses dbgeng.dll to 
get a detailed stack trace.



More information about the Digitalmars-d-learn mailing list