Reputation: 41002
I try to load my vmlinux
into gdb
and use an ARM core simulator.
But I can't understand why do I get Undefined target command: "sim".
:
Here is the shell output:
$ 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
Upvotes: 2
Views: 3891
Reputation: 7248
The ARM simulator in GDB doesn't emulate an ARM application processor capable of running the Linux kernel, e.g. I believe it doesn't emulate the memory management unit. For running Linux, use QEMU and its builtin gdb server instead: https://plus.google.com/100386424363328269117/posts/RhdQmjz4gBJ
Upvotes: 3
Reputation: 22440
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.
Upvotes: 4