This question was asked to me in an interview.
they asked me how to generate a core dump file with which i can debug.
then i said that with -g
flag in
If you don't put -g flag, cannot call list in gdb to list what the source code looks like. it will show "No symbol table is loaded. Use the "file" command."
Also if you type info func or info frame, info locals in gdb, without -g it will not show return datatype and its arguments, basically no translation of instruction to variable (mapping from symbol table).