57

New to the project, have multiple source files used for compilation and some "could" be dynamic libraries, loaded at runtime. When debugging the executable using "GDB", is there a command to list all the source files (static) used to build the executable. Once I have all the source files, it's easy for me to set breakpoints, list functions etc. I couldn't find a command to do it in GDB (I'm sure there should be one). In DDD (gui based gdb), there is a Menu: File->List, which lists all the source files used and static libraries used for building the executable. Unfortunately, for command line based debugger (GDB), I couldnt find an equivalent command.

Mike
  • 1,205
  • 3
  • 12
  • 21

1 Answers1

79

You are probably looking for info sources. info functions could also be helpful.

Don't forget you can do things like type break and then just press tab, which will list all relevant functions.

Melebius
  • 6,183
  • 4
  • 39
  • 52
dbrank0
  • 9,026
  • 2
  • 37
  • 55
  • 11
    "info sources" works. I wish there is a way to filter the source files, as it shows tons of C/C++ libraries – Mike Apr 02 '14 at 20:01
  • 5
    There is a way to grep this: https://stackoverflow.com/questions/41965454/gdb-grep-info-sources-files – Vser Nov 09 '18 at 09:29