I'm debugging some C code. I want to dprintf a message when a certain function returns, regardless of how it actually returns, and even if it returns without hitting a literal return statement (for example, when a void function reaches the end of its body). I understand I could write e.g. dprintf name_of_fn:13, "message %d\n", param
or something for a function whose body was 13 lines long. But this sucks if I'm actively editing the function, since I might be changing the length of its body.
Is this possible? Does anyone know how to do this?
Thanks homies
here is a simple example, from: https://sourceware.org/gdb/onlinedocs/gdb/Dynamic-Printf.html
The referenced page goes into all the details of using dprintf with gdb