4

Recently I have faced an interesting problem. When I use gdb for code search, I can move inside any function which I defined, by step-into. But when I try to do it for standard C function (e.g printf() ) I see only binary form of source code.

How can I ask gdb to show human-readable source code? I am very interested in the work of standard functions.Thank you!

Matthieu Brucher
  • 21,634
  • 7
  • 38
  • 62

1 Answers1

4

You have to:

  • Install the debug versions of the standard C and C++ libraries
  • Tell the compiler to link against those versions

If you are on Linux and have GCC as your compiler, you can look up this post about how to do the second bullet above.

P.W
  • 26,289
  • 6
  • 39
  • 76