www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Stack Trace format

reply Szabo Bogdan <szabobogdan3 gmail.com> writes:
Hi,

I noticed that on different platforms the 
`object.Throwable.TraceInfo` has different formats. A program 
compiled on osx with ldc2 has all the TraceInfo empty... Why?

I want to parse those strings or somehow iterate trough all the 
stack elements, but if I get a different format on different 
platforms it's not that easy to determine at what position in the 
string is the address or the function name.

I would appreciate if anyone have an idea of how I can do this 
without a big headache...

Thanks!
Apr 30
parent Szabo Bogdan <szabobogdan3 gmail.com> writes:
On Sunday, 30 April 2017 at 20:31:09 UTC, Szabo Bogdan wrote:
 Hi,

 I noticed that on different platforms the 
 `object.Throwable.TraceInfo` has different formats. A program 
 compiled on osx with ldc2 has all the TraceInfo empty... Why?

 I want to parse those strings or somehow iterate trough all the 
 stack elements, but if I get a different format on different 
 platforms it's not that easy to determine at what position in 
 the string is the address or the function name.

 I would appreciate if anyone have an idea of how I can do this 
 without a big headache...

 Thanks!
Actually I found the `defaultTraceHandler` here: https://github.com/dlang/druntime/blob/7caaf7cbb699a2a1944b2ac087c3b07d23db6802/src/core/runtime.d#L534
Apr 30