Score:0

How do you add debugging information to an executable .out file?

eh flag

In a Linux system, I used the terminal to create an executable file of a .c file.

However, I now require to add debugging information to said executable file. Any way to help me out here? Thanks.

Score:2
hr flag

You would need to recompile the executable with the appropriate flag(s) - the basic compiler flag to add debug symbols with gcc and g++ is -g:

   -g  Produce debugging information in the operating system's native
       format (stabs, COFF, XCOFF, or DWARF).  GDB can work with this
       debugging information.

If you're using the clang compiler there are some additional options:

   -g, -gline-tables-only, -gmodules

Read the relevant manual pages (man gcc, man clang) for more information.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.