https://access.redhat.com/documentation/en-us/red_hat_developer_toolset

GCC

  1. wget http://mirrors.ustc.edu.cn/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.xz
  2. tar -zxvf gcc-9.3.0.tar.xz
  3. ./configure --prefix=/usr/local/gcc-9.3.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib

GDB

  1. wget http://mirrors.ustc.edu.cn/gnu/gdb/gdb-9.2.tar.xz
  2. tar -zxvf gdb-9.2.tar.xz
  3. cd gdb-9.2
  4. mkdir build
  5. cd build
  6. ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
  7. sudo make && make install
  1. https://github.com/gcc-mirror/gcc/libstdc++-v3/python/libstdcxx/v6/printers.py

下载新版本 python,置于自定义路径

  1. # ~/.gdbinit
  2. python
  3. import sys
  4. sys.path.insert(0, '<path-to>/.gdb/gdb_printers/python')
  5. from libstdcxx.v6.printers import register_libstdcxx_printers
  6. register_libstdcxx_printers (None)
  7. end
  1. (gdb) global pretty-printers:
  2. objfile /usr/lib/x86_64-linux-gnu/libstdc++.so.6 pretty-printers:
  3. libstdc++-v6
  4. std::map
  5. std::vector

https://github.com/hellogcc/100-gdb-tips

GDB调试工具
https://github.com/cgdb/cgdb
https://github.com/snare/voltron
https://github.com/cyrus-and/gdb-dashboard