I'm trying to get the call stacks leading to a function, func, each time it gets invoked in my executable, and I don't mind if the way to get this is slow or inefficient, so long as it's automated (because 'func' gets hit thousands of times). I have access to dbx, so I thought I could do something like this:
(dbx) { when in func { where -q; }; } | awk '{ print }' > out.txt
but I don't see the call stacks output on the console or in the file (I have confirmed that the function is getting hit). The documentation for dbx states that 'where' is a non-redirectable command, but I'm wondering if there are any workarounds people have used to do this?