How to get the call stack/stack trace at any point in code?

doesn’t this only get the stack trace of the last exception? I’d like to way to get the stack trace of any arbitrary line of code.