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: [PATCH] gdb/riscv: Add target description support


* Jim Wilson <jimw@sifive.com> [2019-02-26 09:26:04 -0800]:

> On Mon, Feb 25, 2019 at 9:02 PM Joel Brobecker <brobecker@adacore.com> wrote:
> > I think if QEMU sends an XML with the various register description,
> > then whatever numbering GDB uses by default will no longer apply,
> > and so things should just-work(tm) regardless of what GDB decided
> > to do in terms of register numbering.
> 
> Yes, it shouldn't affect qemu until we try to copy the new gdb xml
> files into qemu, at which point we might need to update the qemu
> gdbstub support to work with the changed register numbers.  We can
> worry about this later.  This issues doesn't need to delay any gdb
> work.

Jim, if you're happy then I'll go ahead and merge the fix-up patch.

I'll summarise the changes in the patch, and what impact I think they
will have now I've had a look at the QEMU code (all these changes are
identical for 32 and 64 bit)...

  (1) Added forced register number for register 'zero'.  This will
  have no impact the default register numbering before had the
  x-registers numbered from 0.  I added this just to make the
  numbering explicit.

  (2) Added forced register number 33 to the first floating pointer
  register ($ft0).  Again, this should have no impact as the
  f-registers were traditionally numbered after the 32 x-registers and
  the program-counter.

  (3) Renumbered fflags, frm, and fcsr as 66, 67, and 68.  This is
  where the issues will appear for QEMU, Jim's QEMU patch had adopted
  the "new" default numbering which placed these registers after the
  floating point registers (so they had become 65, 66, and 67).

If we want backward compatibility then we should merge this GDB patch,
and fix QEMU asap to avoid having two incompatible versions in the
wild.

What I don't understand about all this is why QEMU appears to be
discarding one of the big benefits of xml register descriptions; the
ability to disconnect their register numbering from GDB's register
numbering.

Jim: I think your comments above indicate you want my fix merged, but
if you could just confirm then I'll get it merged.

Thanks,
Andrew


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