This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH 4/4] gdbserver: Add RISC-V/Linux support


On Thu, 23 Jan 2020, Jim Wilson wrote:

> > Also handle a glibc bug where ELF_NFPREG is defined in terms of NFPREG,
> > however NFPREG is nowhere defined.
> 
> I remember that this was discussed on the glibc lists, but I don't
> know if a formal bug report was filed.  We unfortunately don't have an
> active glibc maintainer, and I'm helping to maintain so much stuff
> that I'm not fixing a glibc bug unless it is blocking someone's
> progress, and this does not appear to be a blocker for this patch.

 I actually volunteered to become a glibc RISC-V machine maintainer, but 
then I have to admit I haven't been pursuing it particularly actively. :(

> >         gdb/
> >         * arch/riscv.h (riscv_create_target_description): Remove `const'
> >         qualifier from the return type.
> >         * arch/riscv.c (riscv_create_target_description): Likewise.
> >
> >         gdb/gdbserver/
> >         * linux-riscv-low.c: New file.
> >         * Makefile.in (SFILES): Add linux-riscv-low.c and arch/riscv.c.
> >         * configure.srv <riscv*-*-linux*> (srv_tgtobj)
> >         (srv_linux_regsets, srv_linux_usrregs, srv_linux_thread_db):
> >         Define.
> 
> I didn't really review the patch since I've never done any gdbserver
> work.  But I did build and test it and it worked for me.  My gdb
> testsuite results look roughly the same with and without the patch
> set.
> 
> I did have to add a missing build_gdbserver=yes line to the
> riscv*-*-linux* block in configure.tgt.  I will submit that as a patch
> if you don't.

 Indeed, that's useful for a native configuration to build the gdbserver/ 
subdirectory automagically and I missed that, having not looked into it 
(for cross-compilation you need to build `gdbserver' explictly of course).  
Now fixed and included with an updated version, thanks for catching it!

> >  Posted as an RFC as this hits a major issue with GDB rejecting the XML
> > description supplied, e.g.:
> >
> > warning: while parsing target description (at line 4): Target description specified unknown architecture "riscv:rv64id"
> > warning: Could not load XML target description; ignoring
> 
> The problem isn't only in bfd.  gdb/arch/riscv.c
> riscv_create_target_description() creates the same kind of strings.

 Well, that's exactly where `gdbserver' gets its string from.

> Anyways, this seems to be a simple issue with bfd/cpu-riscv.c using
> bfd_default_scan.  It needs to be fixed to use a riscv specific scan
> function that ignores trailing characters in the string when they
> don't affect the bfd arch match.  I was able to reproduce the problem,
> and wrote a bfd patch that is working for me.  This should not be a
> blocking factor for the patch, as I can get the bfd patch in tomorrow
> or so, unless maybe you want to try it first.

 Native regression-testing of 1/4 has now completed successfully, so I'll 
run remote testing now with your patch preapplied and adjustments made to 
4/4.  We'll see how it goes.

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]