without -g flag:
(gdb) break main
Breakpoint 1 at 0x8048274
with -g flag:
(gdb) break main
Breakpoint 1 at 0x8048277: file example.c, line 31.
I vaguely know -g option stores the symbol table information.
-
What does the -g option exactly do?
-
Is there any way I can look at this symbol table?
-g(forgcc) stores debugging information in the output files so that debuggers can pick it up and present more useful information during the debugging process. Exactly what gets stored can depend a great deal on the environment you’re running in.One way to look at what this consists of is to use
objdumpwith the--debuggingoption (or its equivalent short form-gwhich matchesgcc).