<div>how do i get a stacktrace inside handleTermination?</div><div><br></div><div>If not currently possible, could we have a compile flag that would enable this kind of feature? (making code slower would be OK, its an opt in feature)</div>
<div>Ideally we'd also be able to walk up or down the stack trace (kind of what gdb would do, but I'd like to be able to do that without resorting to gdb, using a language/library solution)</div><div><br></div>----<div>
<pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin:0em;line-height:19px;background-color:rgb(255,255,255)">import core.sys.posix.signal;
import std.c.stdlib;
import std.stdio;</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;line-height:19px;background-color:rgb(255,255,255)">
void main(string[] args)
{
bsd_signal(SIGINT, &handleTermination);
while (true)
{
}
}
extern(C) void handleTermination(int signal)
{
writefln("Caught signal: %s", signal);
exit(signal);
}</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;line-height:19px;background-color:rgb(255,255,255)">-----</pre>
</div>