The symbol table
- The GCC argument -g is added at compile time, and the package content carries the symbol table
- use
objcopy --only-keep-debug libxxx.so libxxx.so.sym
Gets a separate symbol table package - use
objcopy --strip-all libxxx.so
Clears the symbol table of the original package
CMake
Common keywords
- Include_directories: specifies a header file path. Multiple header directories are supported
- Link_directories: dynamic link library file directories. Multiple directories are supported
- Target_link_libraries: the name of the dynamic link library, such as libcurl
gdb
Core file analysis
- GDB analyzes core files
./gdb -exec=/home/exec_file -core=/opt/coredump/core_file
- In the case of no symbol table, you need to type symbol table in the analysis core file
- use
info share
Command to print the address information of the dynamic link library - use
add-symbol-file xxx.so.sym 0x0000
Type a symbol table into the corresponding dynamic library
- use
debugging
- use
gdb attach pid
GDB a running process