The symbol table

  • The GCC argument -g is added at compile time, and the package content carries the symbol table
  • useobjcopy --only-keep-debug libxxx.so libxxx.so.symGets a separate symbol table package
  • useobjcopy --strip-all libxxx.soClears 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
    • useinfo shareCommand to print the address information of the dynamic link library
    • useadd-symbol-file xxx.so.sym 0x0000Type a symbol table into the corresponding dynamic library

debugging

  • usegdb attach pidGDB a running process