2

我尝试加载vmlinuxgdb使用 ARM 核心模拟器。

但我不明白为什么我会得到Undefined target command: "sim".

这是外壳输出:

$ arm-eabi-gdb vmlinux
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 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=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /repo/kernel/kernel/vmlinux...done.
(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 core -- Use a core file as a target
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
4

2 回答 2

4

Your process is correct as per this email and the gdb target command page in the manual.

However, the gdb configure script has an option --disable-sim. The crosstool-ng project uses this option by default. Most cross-compilers are build with this project Note1 as it is a fairly lengthy process to do by hand. It is quite possible that your gdb does not have the simulator built in.

There doesn't seem to be a command line option to print the gdb configuration. However, running strings -n 3 arm-eabi-gdb | grep -iw sim should verify whether your gdb has the sim option or not; the command returns nothing if there is no sim option in the gdb.

Note1: At least, Linaro, Ubuntu, Debian, and Ltib use crosstool-ng. I am not sure about the Android suite.

于 2013-04-25T14:39:30.087 回答
3

GDB 中的 ARM 模拟器不模拟能够运行 Linux 内核的 ARM 应用处理器,例如,我相信它不模拟内存管理单元。对于运行 Linux,请改用 QEMU 及其内置 gdb 服务器:https: //plus.google.com/100386424363328269117/posts/RhdQmjz4gBJ

于 2013-04-28T21:08:22.020 回答