arm-none-eabi-gdb:未定义的目标命令:" sim"

时间:2018-03-24 22:33:38

标签: c arm gdb cross-compiling simulation

我正在尝试使用本教程学习一些有关裸机ARM编程的知识:http://www.valvers.com/open-software/raspberry-pi/step01-bare-metal-programming-in-cpt1/

幸运的是我成功地眨了眨眼......

...但似乎在尝试使用内置CPU模拟器时遇到困难:

zbyszek@ubuntu:~/opt/gcc-arm-none-eabi-4_7-2013q3/bin$ ./arm-none-eabi-gdb
GNU gdb (GNU Tools for ARM Embedded Processors) 7.4.1.20130913-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) target sim
Undefined target command: "sim".  Try "help target".
(gdb) help target
Connect to a target machine or process.
The first argument is the type or protocol of the target machine.
Remaining arguments are interpreted by the target protocol.  For more
information on the arguments for a particular protocol, type
`help target ' followed by the protocol name.

List of target subcommands:

target exec -- Use an executable file as a target
target extended-remote -- Use a remote computer via a serial line
target record -- Log program while executing and replay execution from log
target record-core -- Log program while executing and replay execution from log
target remote -- Use a remote computer via a serial line
target tfile -- Use a trace file as a target

我在Stackoverflow上读过几个线程,但还没找到解决方案。

对我来说,最有可能看到这个答案:https://stackoverflow.com/a/16217742/6632521

  

但是,gdb configure脚本有一个选项--disable-sim。该   crosstool-ng项目默认使用此选项。大多数交叉编译器   使用这个项目Note1构建,因为这是一个相当漫长的过程   手工做。你的gdb很可能没有   模拟器内置。

     

注1:至少,Linaro,Ubuntu,Debian和Ltib使用crosstool-ng。一世   我不确定Android套件。

但是这意味着什么?我是否应该手动构建工具链并禁用选项--disable-sim?或者是包含内置模拟器的某个可用版本?

提前感谢所有答案,如有任何不便,我深表歉意,这是我在Stackoverflow上的第一个问题:)

Zbyszek

1 个答案:

答案 0 :(得分:0)

由于以下原因,您的GDB不支持内置模拟器目标:

(gdb) target sim

失败:

Undefined target command: "sim".  Try "help target".

您必须使用以下配置来编译支持它的GDB:

./configure --enable-sim

crosstool-ng配置为:CT_GDB_CROSS_SIM=y

这里是minimal highly automated baremetal ARM crosstool-ng example with a C program

Ubuntu 16.04上的默认gdb-multiarch软件包没有--enable-sim