From: Joel Brobecker <brobecker@adacore.com>
To: Jim Wilson <jimw@sifive.com>
Cc: Andrew Burgess <andrew.burgess@embecosm.com>,
Tom Tromey <tom@tromey.com>,
gdb-patches@sourceware.org, Palmer Dabbelt <palmer@sifive.com>,
John Baldwin <jhb@freebsd.org>
Subject: Re: [PATCH] gdb/riscv: Add target description support
Date: Tue, 26 Feb 2019 05:02:00 -0000 [thread overview]
Message-ID: <20190226050220.GA30982@adacore.com> (raw)
In-Reply-To: <CAFyWVabA8ZYrF5kyvQrzacA86sa2Z5jxbYQHhE9vB4mA7easPQ@mail.gmail.com>
Hello,
> On Sat, Feb 23, 2019 at 12:51 PM Andrew Burgess
> <andrew.burgess@embecosm.com> wrote:
> > I think we should be OK. The existing CSR feature file should
> > possibly be deleted, it's not actually used right now.
>
> I added the gdb CSR feature file to qemu in my patch. The lack of
> register numbers means I had to add a table to translate the xml CSR
> register numbers into actual hardware numbers inside qemu. But this
> does work. For the subset of CSRs that both qemu and gdb know about,
> I can print register values from gdb and it works. This is an
> important feature for people using system qemu to debug bootloaders,
> and maybe kernels. This is part of the reason I wrote the qemu
> gdbstub support. For user qemu, we don't allow CSR access of course,
> other than the ones readable from user space like fcsr.
>
> (gdb) target remote :1234
> Remote debugging using :1234
> 0x0000000000001000 in ?? ()
> (gdb) set debug remote 1
> (gdb) info registers misa
> misa Sending packet: $pa0#01...Ack
> Packet received: 2d11140000000080
> Packet p (fetch-register) is supported
> 0x800000000014112d RV64ACDFIMSU
> (gdb)
>
> I'm not sure what adding registers numbers to the gp and fp xml files
> will do to the qemu support. I will have to test that. Hopefully
> there is no effect unless I add the new files to qemu, in which case I
> might need to update the gdbstub support then to match the new
> numbers. My understanding is that the qemu copy of the files is
> supposed to be the same as the gdb copy of these files, but I'm not an
> expert on this. This is true for several targets that I checked.
>
> OpenOCD also has support for sending a csr xml file to gdb, though of
> course it does not use the gdb version of the file. It has (or
> creates) ifs own csr xml file.
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.
I think the work you're doing in QEMU can only be a good thing which
will robustify the debugging, because they will avoid the need to
synchronize QEMU and GDB versions.
I'd like to suggest we do try to restore the original register
numbering in GDB as well, though. I've discovered recently that
it's not always so easy to switch to a newer version of QEMU.
So I think Andrew's patch, if good, should go in as well (and be
backported to GDB 8.3 as well).
--
Joel
next prev parent reply other threads:[~2019-02-26 5:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 16:08 [RFC] " Andrew Burgess
2018-11-08 18:33 ` John Baldwin
2018-11-08 19:32 ` Palmer Dabbelt
2018-11-08 19:41 ` John Baldwin
2018-11-14 14:29 ` Andrew Burgess
2018-11-14 17:42 ` John Baldwin
2018-11-08 21:57 ` Jim Wilson
2018-11-13 15:05 ` Andrew Burgess
2018-11-13 20:08 ` Pedro Alves
2018-11-14 14:58 ` [PATCH] " Andrew Burgess
2018-11-19 3:51 ` Jim Wilson
2018-11-21 11:23 ` Andrew Burgess
2018-11-21 12:37 ` Eli Zaretskii
2018-11-21 13:19 ` Andrew Burgess
2019-02-22 17:42 ` Tom Tromey
2019-02-22 19:24 ` Jim Wilson
2019-02-23 20:51 ` Andrew Burgess
2019-02-24 6:21 ` Jim Wilson
2019-02-26 5:02 ` Joel Brobecker [this message]
2019-02-26 17:26 ` Jim Wilson
2019-02-26 18:22 ` Andrew Burgess
2019-02-26 18:40 ` Jim Wilson
2019-02-26 19:27 ` Jim Wilson
2019-02-26 20:30 ` Andrew Burgess
2019-02-23 20:40 ` Andrew Burgess
2019-02-26 11:55 ` Joel Brobecker
2019-03-04 16:18 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190226050220.GA30982@adacore.com \
--to=brobecker@adacore.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=jhb@freebsd.org \
--cc=jimw@sifive.com \
--cc=palmer@sifive.com \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox