Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb : what is a symbol-file used for debugging

I am badly confused with files generated during compilation and used for debugging.

I know there two ways to store debugging info when compiling a code. One is to store the info in a separate file other than the executable (or object file) normally with a .sym extention)

1- I do not know what is the other method. (and which one is more common to use)

2- what is a symbol file in the first place? (a little more detailed than it keeps debugging info)

3- if we are given a huge source code with its makefiles, how can we figure out which method is used when we do "make install"

I have seen this thread but I got even more confused !

like image 435
sali Avatar asked Oct 20 '22 10:10

sali


1 Answers

  1. The other method is including all debugging info in the executable itself.
  2. It keeps things such as function names. When a source file is compiled it is translated to opcodes, and all the function names are transformed into pointers. For example when you use gdb you can just break main to break on function main. Also it's useful when you've got a segfault, you just type in bt and it gives the backtrace with full function names.
  3. You can just open the Makefile and search for the install target. Debugging info level is set with the gcc -g or -gN flag.
like image 190
ionagamed Avatar answered Oct 23 '22 03:10

ionagamed