Search code examples
cgccgdbdebug-symbols

C - Display all lines from a c executable in a file for debugging purpose


I'm having issues with a c program that I want to debug. I would like to know how to get a file that contains every lines of my executable, so I can later set breakpoints with gdb in it. Thanks :)


Solution

  • For GCC specify -g when compiling.

    More here: https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html