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 list
, break 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:
- Mapping from code address (i.e. program counter) to source file and line number. (Without such mapping,
list
andbreak foo.c:123
can’t work.) - Types and names of local and global variables. (Without this,
ptype
andwhatis
andinfo locals
can’t work.) - Location of local variables and parameters on the stack. (Again
info locals
,print a_local_var
,print &a_local_var
can’t work.)