Enable simulator on gdb

Andrew Burgess andrew.burgess@embecosm.com
Thu Jul 29 08:49:42 GMT 2021

* 任建军 via Gdb <gdb@sourceware.org> [2021-07-16 11:52:33 +0800]:

>    I have a complie question, An help me answer it? 
>    I use binutils-gdb source code to build gdb for aarch64,the version is “gdb-9.2-release”,   and complie command line is "./configure --target=aarch64 --enable-sim".
>    Compile is completed, but when i enter gdb and type command "target sim"  , gdb said  "Undefined target command: "sim": ..." ,  am i missed someting when i complie gdb? 

The problem is that in gdb/configure.tgt there is no link to the
compiled simulator.  The patch below adds this link for aarch64-elf

I believe the reason for this is that the aarch64 simulator is
considered deprecated in favour of using QEMU.  Or it could just be an
oversight that this link is missing.

Either way, this should get it working for you.



diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 5f66cda6b78..5dcf67a662f 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -117,6 +117,7 @@ case "${targ}" in
 aarch64*-*-elf | aarch64*-*-rtems*)
 	# Target: AArch64 embedded system
+	gdb_sim=../sim/arm/libsim.a

More information about the Gdb mailing list