Thread overview | |||||
---|---|---|---|---|---|
|
August 06, 2016 call stack tracing | ||||
---|---|---|---|---|
| ||||
Any solution out there that can get call stack, file and line info? Similar to exceptions but I simply want to track memory allocations and need the complete call stack rather than just the previous call(using __FUNCTION__/__FILE__/etc), which is usually useless. Of course, exceptions have TraceInfo... could that be used anywhere or hacked to get what I need? |
August 06, 2016 Re: call stack tracing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark "J" Twain | On Saturday, 6 August 2016 at 01:29:37 UTC, Mark "J" Twain wrote: > Of course, exceptions have TraceInfo... could that be used anywhere or hacked to get what I need? The function is defaultTraceHandler in druntime for what the exceptions do: http://arsdnet.net/dcode/stacktrace.d more text about this trick is available in my book btw https://www.packtpub.com/application-development/d-cookbook |
August 06, 2016 Re: call stack tracing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Saturday, 6 August 2016 at 01:44:04 UTC, Adam D. Ruppe wrote: > On Saturday, 6 August 2016 at 01:29:37 UTC, Mark "J" Twain wrote: >> Of course, exceptions have TraceInfo... could that be used anywhere or hacked to get what I need? > > The function is defaultTraceHandler in druntime for what the exceptions do: > > http://arsdnet.net/dcode/stacktrace.d > > more text about this trick is available in my book btw https://www.packtpub.com/application-development/d-cookbook Thanks. When I try this in windows I get First-chance exception: core.demangle.Demangle.ParseException I had the GC disabled. Enabling it got me the correct results. |
Copyright © 1999-2021 by the D Language Foundation