# Windows # gdb cross compiler arm-linux-gnueabihf-gdb

# Linux # gdb cross compiler arm-linux-gnueabihf-gdb

https://blog.csdn.net/xiaoting451292510/article/details/105166739

GDB (GNU symbolic debugger) simply is a debugging tool. It is a free software under GPL General Public License that is protected.

Like all the same debugger, GDB allows you to debug a program, including the program to stop at your desired location, then you can view variables, registers, memory, and stack. Further you can modify variables and memory values. GDB is a very powerful debugger that can debug multiple languages. Here we are dealing only C and C ++ debugging, and does not include other languages. Another point to note is that, GDB is a debugger, rather than VC is an integrated environment. You can use some front-end tools such as XXGDB, DDD and so on. They have a graphical interface, and therefore easier to use, but they are only GDB layer of the shell. Therefore, you should still be familiar with the GDB command. In fact, when you use these long time graphical interface, you will see the importance of the familiar GDB commands.

Embedded Linux GDB debug environment by the end of the Host (PC machine) and Target end (ARM) composed of two parts, using the Host side arm-linux-gdb debugger, and the need to run gdbserver Target end, or via the serial port between the two socket connections, the application returns ARM Target end in the performance Host. Host debug trace command is issued from the end of the arm-linux-gdb in. Therefore, you need to cross GDB debugging.

You can download the corresponding version of GDB from http://ftp.gnu.org/gnu/gdb/ URL. The latest version of gdb-9.1.tar.xz. 8.2 I use more, so the compiler version 8.2

To compile the source code, we also need to install MSYS

http://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/  

Open msys.bat file, then enter the directory gdb, the specific compiler and # linux # gdb cross compiler arm-linux-gnueabihf-gdb almost no big difference. --host not fill, you are prompted to use the default

./configure --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- CC=arm-linux-gnueabihf-gcc --prefix=/c/arm-linux-gnueabihf-gdb-8.2
$ ./configure --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- CC=arm-linux-gnueabihf-gcc --prefix=/c
/arm-linux-gnueabihf-gdb-8.2
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... arm-unknown-linux-gnueabihf
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... no, using cp -pR
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/c/99_temp/gdb-8.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

Use the default configuration ./configure view the current --host = i686-pc-mingw32

$ ./configure
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... no, using cp -pR

Join  --host = i686-pc-mingw32

./configure --target=arm-linux-gnueabihf --host=i686-pc-mingw32 --program-prefix=arm-linux-gnueabihf- CC=arm-linux-gnueabihf-gcc --prefix=/c/arm-linux-gnueabihf-gdb-8.2

 

Published 170 original articles · won praise 207 · Views 4.59 million +

Guess you like

Origin blog.csdn.net/xiaoting451292510/article/details/105228162