Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ask GDB to list all functions in a program

Tags:

c

linux

gcc

x86-64

gdb

How can you list all functions in a program with GDB?

like image 447
pythonic Avatar asked May 21 '12 06:05

pythonic


People also ask

What is LIST command in 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.

How do I trace a function call in GDB?

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.

Can you call functions in GDB?

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.

How do I get more information on GDB?

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.


1 Answers

info functions prints the names and data types of all defined functions. See 16 Examining the Symbol Table.

like image 51
ks1322 Avatar answered Oct 18 '22 10:10

ks1322