When attempting to debug a C program on Mountain Lion you may encounter the "No symbol table is loaded.".
Let's say we have a hello_world program, when we attempt to debug with gdb like the following:
$ gdb hello_world (gdb) break 5 No symbol table is loaded. Use the "file" command.
Hmm, okay it didn't take. Hopefully gdb's feedback will work.
(gdb) file hello_world Load new symbol table from "/Users/you/c/hello_world"? (y or n)
Then we enter "y" to load in the symbol table.
Reading symbols from /Users/you/c/hello_world...done.
We attempt to set the breakpoint again.
(gdb) break 5 No symbol table is loaded. Use the "file" command.
Weaksauce, following gdb's advice didn't help.
Turns out we need to specify an option when compiling our program,
-ggdb should get us what we need. The full command for our example looks like
gcc hello_world.c -o hello_world -ggdb.
Now when we set a breakpoint we should see the following.
$ gdb hello_world (gdb) break 72 Breakpoint 1 at 0x100000de5: file hello_word.c, line 5.
Woot, we can now debug our program! Hopefully this saved you some time and frustration. For more info on what debugging options that gcc supports look at the docs at gcc.gnu.org.