public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Enable simulator on gdb
@ 2021-07-16  3:52 任建军
  2021-07-29  8:49 ` Andrew Burgess
  0 siblings, 1 reply; 5+ messages in thread
From: 任建军 @ 2021-07-16  3:52 UTC (permalink / raw)
  To: gdb

Hi all:
   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? 


   And attach a picture:


   Thanks a lot!




 Best Regards!
 Ron


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enable simulator on gdb
  2021-07-16  3:52 Enable simulator on gdb 任建军
@ 2021-07-29  8:49 ` Andrew Burgess
  2021-08-17 22:13   ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Burgess @ 2021-07-29  8:49 UTC (permalink / raw)
  To: 任建军; +Cc: gdb

* 任建军 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
targets.

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.

Thanks,
Andrew

--

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_target_obs="aarch64-newlib-tdep.o"
+	gdb_sim=../sim/arm/libsim.a
 	;;
 
 aarch64*-*-freebsd*)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enable simulator on gdb
  2021-07-29  8:49 ` Andrew Burgess
@ 2021-08-17 22:13   ` Mike Frysinger
  2021-08-19 10:32     ` Andrew Burgess
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2021-08-17 22:13 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: 任建军, gdb

On 29 Jul 2021 09:49, Andrew Burgess wrote:
> * 任建军 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
> targets.
> 
> 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.

while i love QEMU, i'm not sure it should be relevant wrt decisions about the
GNU sim and its integration in places.

> Either way, this should get it working for you.
> 
> --- a/gdb/configure.tgt
> +++ b/gdb/configure.tgt
> @@ -117,6 +117,7 @@ case "${targ}" in
>  aarch64*-*-elf | aarch64*-*-rtems*)
>  	# Target: AArch64 embedded system
>  	gdb_target_obs="aarch64-newlib-tdep.o"
> +	gdb_sim=../sim/arm/libsim.a

guessing you meant aarch64 there and not arm ?
-mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enable simulator on gdb
  2021-08-17 22:13   ` Mike Frysinger
@ 2021-08-19 10:32     ` Andrew Burgess
  2021-08-19 22:13       ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Burgess @ 2021-08-19 10:32 UTC (permalink / raw)
  To: 任建军, gdb

* Mike Frysinger <vapier@gentoo.org> [2021-08-17 18:13:37 -0400]:

> On 29 Jul 2021 09:49, Andrew Burgess wrote:
> > * 任建军 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
> > targets.
> > 
> > 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.
> 
> while i love QEMU, i'm not sure it should be relevant wrt decisions about the
> GNU sim and its integration in places.
> 
> > Either way, this should get it working for you.
> > 
> > --- a/gdb/configure.tgt
> > +++ b/gdb/configure.tgt
> > @@ -117,6 +117,7 @@ case "${targ}" in
> >  aarch64*-*-elf | aarch64*-*-rtems*)
> >  	# Target: AArch64 embedded system
> >  	gdb_target_obs="aarch64-newlib-tdep.o"
> > +	gdb_sim=../sim/arm/libsim.a
> 
> guessing you meant aarch64 there and not arm ?

Yes I did.  Thanks.

Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Enable simulator on gdb
  2021-08-19 10:32     ` Andrew Burgess
@ 2021-08-19 22:13       ` Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2021-08-19 22:13 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: 任建军, gdb

On 19 Aug 2021 11:32, Andrew Burgess wrote:
> * Mike Frysinger <vapier@gentoo.org> [2021-08-17 18:13:37 -0400]:
> > On 29 Jul 2021 09:49, Andrew Burgess wrote:
> > > * 任建军 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
> > > targets.
> > > 
> > > 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.
> > 
> > while i love QEMU, i'm not sure it should be relevant wrt decisions about the
> > GNU sim and its integration in places.
> > 
> > > Either way, this should get it working for you.
> > > 
> > > --- a/gdb/configure.tgt
> > > +++ b/gdb/configure.tgt
> > > @@ -117,6 +117,7 @@ case "${targ}" in
> > >  aarch64*-*-elf | aarch64*-*-rtems*)
> > >  	# Target: AArch64 embedded system
> > >  	gdb_target_obs="aarch64-newlib-tdep.o"
> > > +	gdb_sim=../sim/arm/libsim.a
> > 
> > guessing you meant aarch64 there and not arm ?
> 
> Yes I did.  Thanks.

gotcha.  posted a patch to turn it on for aarch64 & cris.
-mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-19 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16  3:52 Enable simulator on gdb 任建军
2021-07-29  8:49 ` Andrew Burgess
2021-08-17 22:13   ` Mike Frysinger
2021-08-19 10:32     ` Andrew Burgess
2021-08-19 22:13       ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).