title: gcc -g :what will happen
body: <p>This question was asked to me in an interview.</p>
  
  <p>they asked me how to generate a core dump file with which i can debug.
  then i said that with <code>-g</code> flag in <code>gcc</code> we can do it.</p>
  
  <p>then they have asked me what exactly does that <code>-g</code> flag do  to the compiler.</p>
  
  <p>i said (probably a wrong answer) that it will open up all the symbols in the core file which can be used for debugging.</p>
  
  <p>can anyone tell me what exactly does it do?</p>