arm-linux-gnueabihf-gdb helloWorld
注意:如果要直接这样使用arm-linux-gnueabihf-gdb,需要设置环境变量,示例如下:
export PATH=$PATH:/xxx/arm-gdb/bin
打印信息如下:
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version3or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, tothe extent permitted by law. Type "show copying"and"show warranty"for details.
This GDB was configured as"--host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf".
For bug reporting instructions, please see:
<https://bugs.launchpad.net/gcc-linaro>...
Reading symbols from /nfs/helloWorld...done.
(gdb)
注意:打印最后进入了gdb的调试环境:(gdb)
- 第七步:远程连接开发板端口
(gdb):target remote 192.168.1.90:20
Ubuntu打印信息如下:
Remote debugging using 192.168.1.90:20
Reading symbols from /opt/arm-4.9-toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3...done.
Loaded symbols for /opt/arm-4.9-toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.30xb6fd7a40in _start () from /opt/arm-4.9-toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3
开发板打印信息如下:
Remote debugging from host 192.168.1.95
完成上面的7步之后,就可以使用GDB对开发板程序进行调试了。