Need cross gdb for device

不羁岁月 提交于 2019-12-20 12:34:11

问题


I installed gcc-arm-linux-gnueabihf cross-compiler on Ubuntu 12.04, and now I am able to build a program for embedded device. Where can I find cross gdb for debugging?

gcc-arm-linux-gnueabihf reference contains gdb-arm-linux-gnueabihf in the Related Packages list, which seems to be the debugger that I am looking for. But this package is not available.


回答1:


I recommend getting gdb from the Linaro toolchain rather than the Ubuntu repositories. Download gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux.tar.bz2 from here and you'll find:

  • bin/arm-linux-gnueabihf-gdb
  • arm-linux-gnueabihf/debug-root/usr/bin/gdbserver

The latter is statically linked and of course built for ARM Linux.

Assuming you have networking already set up to your target board, copy gdbserver to it and run:

$ gdbserver --multi :2345

On your development machine, run:

$ arm-linux-gnueabihf-gdb
(gdb) target extended BOARD-IP-ADDR:2345
(gdb) set remote exec-file /bin/true
(gdb) run

and you're up and running with remote cross debugging.

Links to the Linaro bug tracker, mailing list and web forum are here. They're very active in ARM Linux toolchain, kernel, QEMU development as you can see from their release notes.




回答2:


You need to install the gdb-multiarch package, then run gdb-multiarch command to remotely debug your target.



来源:https://stackoverflow.com/questions/13269948/need-cross-gdb-for-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!