No Symbol Table using GDB on Compiled Programs

The No symbol table loaded message you are getting is misleading: all GDB is telling you is that your binary does not have any debugging info in it.

Usually this is solved by rebuilding the binary with -g flag, but since you are given an already compiled and linked file, you can’t do that.

Without debug info, certain commands, such as listbreak file.c:line, or break line will not work. But other commands, such as: disassemble and break function will work, and that’s the commands you’ll have to use for this assignment.

Is there a command list of codes that are available and not available

Not that I am aware of. But you can deduce what that list is from understanding what debugging info contains.

Debugging info generally contains:

  1. Mapping from code address (i.e. program counter) to source file and line number. (Without such mapping, list and break foo.c:123 can’t work.)
  2. Types and names of local and global variables. (Without this, ptype and whatis and info locals can’t work.)
  3. Location of local variables and parameters on the stack. (Again info localsprint a_local_varprint &a_local_var can’t work.)

Leave a Comment