gcc -g :what will happen

后端 未结 7 1112
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 00:51

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

7条回答
  •  心在旅途
    2021-01-30 01:46

    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).

提交回复
热议问题