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

标签 android linux linux-kernel gdb arm

我尝试将我的 vmlinux 加载到 gdb 中并使用 ARM 核心模拟器。

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

这是 shell 输出:

$ 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,你的过程是正确的和 gdb target command手册页。

但是,gdb 配置脚本有一个选项--disable-simcrosstool-ng项目使用这个option by default .大多数交叉编译器都是用这个项目构建的 Note1 因为这是一个相当漫长的手工过程。很可能您的 gdb 没有内置模拟器

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

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

关于android - 如何模拟 ARM 处理器运行时环境并加载 Linux 内核模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16202130/

相关文章:

linux - 如何查看和删除 Kafka 主题

c - 如果 cmd = 2,则不调用 ioctl

android - MediaRecorder.stop() 停止失败 : -1007

linux - Tomcat配置环境变量的最佳方式

java - 更改滚动条上的背景颜色

regex - 我可以用 sed 获取匹配后下一行的长度吗?

c - timeout = 0 的 recvmmsg() 等同于非阻塞 recvmsg()?

c - 判断是ipv4还是ipv6数据结构

android - 如何通过 Volley Request 传递 HttpPost( URI )?

Android 客户端/服务器应用程序?