BetterC stack traces?

Paul Backus snarwin at gmail.com
Sun Sep 4 18:49:37 UTC 2022


On Sunday, 4 September 2022 at 17:43:01 UTC, IchorDev wrote:
> I'm trying to implement a custom exception system in BetterC. 
> Does anyone know how I'd go about getting a stack trace so that 
> I can print it to stdout? :)
> I was thinking of utilising UDAs & `__LINE__` but it turns out 
> that UDAs don't let you inject code, which is a shame!

You can use `libunwind` for this:

https://www.nongnu.org/libunwind/

It's a C library, but it should work for D too.


More information about the Digitalmars-d-learn mailing list