call traceback is indecipherable garbage

forkit forkit at gmail.com
Fri Feb 4 22:47:18 UTC 2022


On Friday, 4 February 2022 at 19:04:24 UTC, kinke wrote:
>
> One can easily disable any exception traces via 
> https://dlang.org/phobos/core_runtime.html#.Runtime.traceHandler:
> ```
> void main() {
>     import core.runtime : Runtime;
>     Runtime.traceHandler = null;
>
>     throw new Exception("oops");
> }
> ```
>
> [That won't just avoid the output, but also makes EH faster.]
>
> One can also set a custom function, e.g., to make tracing 
> depend on some environment variable, reusing 
> https://dlang.org/phobos/core_runtime.html#.defaultTraceHandler.

Thanks. Very useful info :-)

Although, I almost always need to compile with '-g' in order for 
the strace to be of any practical use.

So I will likely end up incorporating above, into this:

debug
     {
         import core.runtime : Runtime;
         Runtime.traceHandler = null;
     }





More information about the Digitalmars-d mailing list