gdb-imagewatch配置
####################################################################################
1:安装依赖库
sudo apt-get install libpython3-dev python3-dev
2:检查gdb版本>=7.10
gdb --version
<GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1>
检查gdb是否利用python3编译
gdb
python import sys;print(sys.version)
<3.5.2 (default, Nov 12 2018, 13:43:14)>
3:如果gdb不是python3编译,则执行下列命令:
```shell
$ wget http://ftp.gnu.org/gnu/gdb/gdb-7.10.tar.gz
$ tar -zxvf gdb-7.10.tar.gz
$ cd gdb-7.10
$ ./configure --with-python=python3 --disable-werror
$ make -j8
```
4:下载gdb-imagewatch
```shell
$ git clone https://github.com/csantosbh/gdb-imagewatch
$ cd gdb-imagewatch
$ git submodule init
$ git submodule update
```
5:选择默认qmake
cd /usr/lib/x86_64-linux-gnu/qt-default/qtchooser
sudo gedit default.conf
<在第一行中添加qmake版本>
(qmake版本查看:Qt->工具->选项->构建和运行->Debuggers->qmake.
如:~/Qt5.7.0/5.7/gcc_64/bin)
6:编译gdb-imagewatch
```shell
cd <gdb-imagewatch>
mkdir build
cd build
$ qmake .. BUILD_MODE=release PREFIX=/path/to/installation/folder
$ make -j4
$ make install
```
7:环境配置
gedit ~/.gdbinit
source /path/to/gdb-imagewatch/gdb-imagewatch.py
8:Qt工程选择性加载
Qt->工具->调试器->GDB->启动时载入.gdbinit文件(选择性使用gdb-imagewatch)