How can you list all functions in a program with GDB?
(gdb) help list List specified function or line. With no argument, lists ten more lines after or around previous listing. "list -" lists the ten lines before a previous ten-line listing. One argument specifies a line, and ten lines are listed around that line.
For each function breakpoint, I instruct GDB to print a short backtrace and then continue execution. I can then stop the program run at any time using CTRL-C and observe where the program is, what functions are being called, and what arguments they are being called with.
To call a function in the program, GDB has to temporarily modify the state of the inferior. This has potentially undesired side effects. Also, having GDB call nested functions is likely to be erroneous and may even crash the program being debugged.
To get more information we use the "backtrace" command. The "backtrace" command tells gdb to list all the function calls (that leads to the crash) in the stack frame.
info functions
prints the names and data types of all defined functions. See 16 Examining the Symbol Table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With