Copyright © tutorialspoint.com
A Debugging Symbol Table maps instructions in the compiled binary program to their corresponding variable, function, or line in the source code. This mapping could be something like:
Symbol tables may be embedded into the program, or stored as a separate file. So if you plan to debug your program then it is required to create Symbol table which will have required information to debug the program. We can infer a few facts about symbol tables:
To let GDB be able to read all that information line by line from the symbol table, we need to compile it a bit differently. Normally we compile things as:
Instead of doing this, we need to compile with the -g flag as such:
|
Copyright © tutorialspoint.com