www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Getting backtrace

reply Xavier Bigand <flamaros.xavier gmail.com> writes:
Is there a way to get backtrace outside exceptions?
Jan 08 2014
next sibling parent Benjamin Thaut <code benjamin-thaut.de> writes:
Am 08.01.2014 21:25, schrieb Xavier Bigand:
 Is there a way to get backtrace outside exceptions?
On which plattform?
Jan 08 2014
prev sibling next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Wednesday, 8 January 2014 at 20:25:28 UTC, Xavier Bigand wrote:
 Is there a way to get backtrace outside exceptions?
Yes http://arsdnet.net/dcode/stacktrace.d works at least on linux
Jan 08 2014
prev sibling next sibling parent reply Benjamin Thaut <code benjamin-thaut.de> writes:
Am 08.01.2014 21:25, schrieb Xavier Bigand:
 Is there a way to get backtrace outside exceptions?
Found a plattform independend way: import core.runtime; import std.stdio; void main(string[] args) { auto trace = defaultTraceHandler(null); foreach(t; trace) { writefln("%s", t); } }
Jan 08 2014
parent Xavier Bigand <flamaros.xavier gmail.com> writes:
Le 08/01/2014 21:29, Benjamin Thaut a écrit :
 Am 08.01.2014 21:25, schrieb Xavier Bigand:
 Is there a way to get backtrace outside exceptions?
Found a plattform independend way: import core.runtime; import std.stdio; void main(string[] args) { auto trace = defaultTraceHandler(null); foreach(t; trace) { writefln("%s", t); } }
It's exactly what I need, thank you.
Jan 09 2014
prev sibling parent "yazd" <yazan.dabain gmail.com> writes:
On Wednesday, 8 January 2014 at 20:25:28 UTC, Xavier Bigand wrote:
 Is there a way to get backtrace outside exceptions?
If you're on Linux, you can try this library: https://github.com/yazd/backtrace-d
Jan 08 2014