如何模拟ARM处理器运行环境并加载Linux内核模块?

2024-05-15

我尝试加载我的vmlinux into gdb并使用 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

您的流程是正确的email http://www.sourceware.org/ml/crossgcc/2000-q1/msg00019.htmlgdb 目标命令 http://sourceware.org/gdb/current/onlinedocs/gdb/Target-Commands.html手册中的页面。

However, the gdb configure script has an option --disable-sim. The crosstool-ng http://crosstool-ng.org/ project uses this option by default http://www.sourceware.org/ml/crossgcc/2012-01/msg00088.html. 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.

似乎没有命令行选项来打印gdb配置。然而,运行strings -n 3 arm-eabi-gdb | grep -iw sim应该验证您是否gdbsim选择与否;如果没有,该命令不返回任何内容sim选项中的gdb.

Note1:至少,Linaro、Ubuntu、Debian 和 Ltib 使用交叉工具-ng。我不确定 Android 套件。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何模拟ARM处理器运行环境并加载Linux内核模块? 的相关文章

随机推荐