For debugging purposes, I want to write a function that returns file&line information for the call-site. I know about @src(), and I use it elsewhere, but for this use-case I’d rather avoid that. Instead, what want to do is to essentially the same thing as stack-trace printing does — lookup the return address on the stack, then lookup that address in the debug info, and extract file&line info based on that.
I know that std has code for doing that, as that’s exactly what happens in std.debug.dumpCurrentStackTrace(). Is there some convenience function I should call here? Or should I just copy-paste parts of the implementation of dumpCurrentStackTrace()?
In case this is X/Y — I want implement rust’s dbg! for Zig. Zig doesn’t have macros, but I think debug info contains everything I need for this too work, but I also want to write as little of my own code as possible