I have a long C function that can return at different lines. Is it possible to have GDB run through the function and print out on what line the function returned? So far I have been going through one line at a time (using n), and this is becoming tedious.
Can I dynamically call a function with GDB and know on which line it returned?
One nasty trick if you’re compiling with GCC and can edit the code would be to do a macro and search+replace all the returns in your editor…
Then call the function and inspect the global variable.