Hm the backtrace() method does not give the line numbers of the methods in the stack trace, it only gives the hexadecimal offset. Is there anyway to retrieve the line numbers?
Is there any way to print out the stack trace of the current location?
Not sure if Postgres has something in the utils for that. You can use backtrace() in glibc. Solaris 9 libc has printstack(). Not sure what's available for Windows.
I am looking for something like print_stack_trace(); that I can insert in arbitrary location in the code.