. Advertisement .
..3..
. Advertisement .
..4..
I get the error message:
(gdb)exec-file main.o
(gdb)break 59
No symbol table is loaded. Use the "file" command.
Has anyone ever faced this problem? How to troubleshoot the “No symbol table is loaded. Use the “file” command.” The problem appears when I try to operate the following program:
gcc -g main.c utmpib2.c -o main.o
and:
cc -g main.c utmpib2.c -o main.o
and also:
g++ -g main.c utmpib2.c -o main.o
$gdb
The cause: Because you have a completely built program, but not an object file. Therefore, the
.o
extension is invalid.Solution: The
.o
extension should be removed. And follow the suggestion in the error notice to resolve your issue: Use the “file” command.Alternatively, you can just outdo the program from the command line.
You will need to add the extra parameter -g which generates source-level debug information. This is how it will look:
Then you can use the gdb in a common way.