GDB graphical interface GUI debugger insight compiled and used

GDB graphical interface GUI debugger insight compiled and used

0 Preface

Embedded development in the Linux environment often requires the use of GDB. For IDEs who are used to using the GUI on win, they are not used to getting started. Here is a GDB front-end GUI tool—insight, which is simple and convenient to use, but it is commonly used There is no compiled package on the release. You can only compile and install the source code yourself, which is recorded here. When I first started compiling, I read some blogs and modified the source code in many places where the compilation errors were handled, which may cause problems in subsequent use. Therefore, I did not modify any source code to compile successfully. Currently, no problems have been found in use.

1. Download the source code

Insight official website: https://sourceware.org/insight/index.php

git clone --recursive git://sourceware.org/git/insight.git

This article here is the latest source code pulled directly by git, the version after compilation is as shown in the figure below
View Image

2. Prepare the compilation environment

Since insight is written by Tcl/Tk, you need to install its corresponding development environment. According to the description in the Readme in the source code, you can download the environment of tcl, tk, itcl, itk and iwidgets through the apt package manager.

# Compile and build the required packages sudo apt-get install autogen texinfo python2.7-dev #Run dependent packages sudo apt-get install tcl-dev tk-dev itcl3-dev itk3-dev iwidgets4

Here are my compiled program dependencies. (I am using the host Ubuntu16.04).

xiaoming@xiaoming-N550JK:/opt/arm-none-eabi-insight/bin$ ldd ./arm-none-eabi-insight linux-vdso.so.1 => (0x00007ffdc6bce000) libz.so.1 =>/lib/x86_64-linux-gnu/libz.so.1 (0x00007fba4e452000) libtk8.6.so => ​​/usr/lib/x86_64-linux-gnu/libtk8.6.so (0x00007fba4e0f5000) libtcl8.6.so => ​​/usr/lib/x86_64-linux-gnu/libtcl8.6.so (0x00007fba4dd46000) libX11.so.6 =>/usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fba4da0c000) libpthread.so.0 =>/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fba4d7ef000) libdl.so.2 =>/lib/x86_64-linux-gnu/libdl.so.2 (0x00007fba4d5eb000) libncurses.so.5 =>/lib/x86_64-linux-gnu/libncurses.so.5 (0x00007fba4d3c9000) libtinfo.so.5 =>/lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fba4d1a0000) libm.so.6 =>/lib/x86_64-linux-gnu/libm.so.6 (0x00007fba4ce97000) libpython2.7.so.1.0 =>/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007fba4c909000) libexpat.so.1 =>/lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fba4c6e0000) libc.so.6 =>/lib/x86_64-linux-gnu/libc.so.6 (0x00007fba4c316000) /lib64/ld-linux-x86-64.so.2 (0x00007fba4e66c000) libXft.so.2 =>/usr/lib/x86_64-linux-gnu/libXft.so.2 (0x00007fba4c101000) libfontconfig.so.1 =>/usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fba4bebe000) libXss.so.1 =>/usr/lib/x86_64-linux-gnu/libXss.so.1 (0x00007fba4bcba000) libxcb.so.1 =>/usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fba4ba98000) libutil.so.1 =>/lib/x86_64-linux-gnu/libutil.so.1 (0x00007fba4b895000) libfreetype.so.6 =>/usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fba4b5eb000) libXrender.so.1 =>/usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fba4b3e1000) libXext.so.6 =>/usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fba4b1cf000) libXau.so.6 =>/usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fba4afcb000) libXdmcp.so.6 =>/usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fba4adc5000) libpng12.so.0 =>/lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fba4aba0000)

3. Configure compilation

Here we compile it for embedded use, so we need to add the option –target=arm-none-eabi, and –prefix=/opt/arm-none-eabi-insight/. is the storage location after compilation and installation. When compiling, I found that if you don’t configure –prefix, you can compile successfully, but after the configuration, you always get an error. Later, when you find that you need to specify the directory, you need to specify the tcl/tk directory to compile correctly, that is, the option –with-tcl=/usr/lib/--with-tk=/usr/lib/

autoconf ./configure --prefix=/opt/arm-none-eabi-insight/. --target=arm-none-eabi --disable-binutils --disable-elfcpp --disable-gas --disable-gold - disable-gprof --disable-ld --disable-rpath --disable-zlib --enable-sim --with-expat --with-python --without-libunwind --with-tcl=/usr/lib/- -with-tk=/usr/lib/ make sudo make install

Here is another version configuration of gdb debugging on the host machine

autoconf ./configure --prefix=/opt/insight/. --disable-binutils --disable-elfcpp --disable-gas --disable-gold --disable-gprof --disable-ld --disable-rpath - disable-zlib --enable-sim --with-expat --with-python --without-libunwind --with-tcl=/usr/lib/--with-tk=/usr/lib/ make sudo make install

After the compilation is completed, the arm-none-eabi-insight file will be generated in the/opt/arm-none-eabi-insight/bin directory, and the insight arm version can be opened by running it. Similarly,/opt/insight/bin/insight is for debugging The insight of the program on the host. You can add environment variables or desktop launchers for easy use, so I won’t repeat them here.
Here is the binary file I compiled
https://download.csdn.net/download/weixin_39871788/11009936
https://download.csdn.net/download/weixin_39871788/11009925
Note: Due to the need for external dependencies to download and use, be cautious, It is strongly recommended to compile it by yourself according to the blog description . If you need to download and use the dependencies, see the second section.

4. Instructions for use

The commands that insight accepts are exactly the same as gdb, except that it has a relatively simple GUI, so arm-none-eabi-gdb in the previous running script can be directly changed to arm-none-eabi-insight to use, and then used later I will update the content slowly.
(To be updated, put a rendering, my target board is wildfire imxRT1052)
View Image


Reference : https://blog.csdn.net/weixin_39871788/article/details/88378871