From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tom@tromey.com>
Cc: Nelson Chu <nelson.chu@sifive.com>, gdb-patches@sourceware.org
Subject: Re: [0/1] RISC-V: Update CSR to priv 1.11.
Date: Mon, 8 Jun 2020 22:39:27 +0100 [thread overview]
Message-ID: <20200608213927.GC2737@embecosm.com> (raw)
In-Reply-To: <87r1upefg8.fsf@tromey.com>
* Tom Tromey <tom@tromey.com> [2020-06-08 09:37:43 -0600]:
> >>>>> ">" == Nelson Chu <nelson.chu@sifive.com> writes:
>
> >> Since RISCV priv spec 1.11 has been officially released, it would be good if
> >> binutils, gdb, qemu and OpenOCD can support the new CSR. Therfore, I update
> >> the CSR to 1.11 in binutils, and the gdm xml files and gas/testsuite/gas/riscv/csr-dw-regnums
> >> also need to be updated. There are two difference between 1.10 and 1.11,
>
> >> 1. 0x320 is mcountinhibit rather than mucounteren. You can still use the
> >> mucounteren, but objdump will show mcountinhibit for it.
>
> >> 2. 0x7b2 is dscratch0 rather than dscratch, and 0x7b3 is dscratch1. You
> >> can still use the old naming, but objdump will show the new one.
>
> I noticed that this patch broke compatibility between gdb and some
> versions of qemu.
>
> We're using qemu 4.0.0. Our internal test suite has many failures if I
> run an unpatched gdb against this version -- locally I've backed out all
> RISC-V patches since this one, but that's getting cumbersome, and I
> belated realized I should probably just bring this up.
>
> A typical failure looks like:
>
> (gdb) info registers dscratch
> dscratch Could not fetch register "dscratch"; remote failure reply 'E14'
>
> It seems to me that the best thing to do would be to have gdb adapt to
> the registers that are reported by the remote. Is there a reason this
> was not done?
Unless I misunderstand here, you asking why we don't use the xml
target descriptions? We do. Or we _should_ do. Maybe it's not
working? Is your target definitely sending back a description? And
it definitely includes register "dscratch" ?
This patch (the only you replied too) is only changing the default xml
description, the one that gets picked up if the target doesn't supply
a description.
I'll try to get QEMU built and running tomorrow and see if I can give
you a better answer, however, the patch below might help. It adds an
alias from 'dscratch' to 'dscratch0', so your 'info registers
dscratch' should start working again.
Let me know if this helps at all.
Thanks,
Andrew
---
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 6edf77a0ce0..42ca6440756 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -3380,6 +3380,10 @@ riscv_gdbarch_init (struct gdbarch_info info,
riscv_setup_register_aliases (gdbarch, &riscv_freg_feature);
riscv_setup_register_aliases (gdbarch, &riscv_csr_feature);
+ static int dscratch_regnum = RISCV_CSR_DSCRATCH0_REGNUM;
+ user_reg_add (gdbarch, "dscratch", value_of_riscv_user_reg,
+ &dscratch_regnum);
+
/* Compile command hooks. */
set_gdbarch_gcc_target_options (gdbarch, riscv_gcc_target_options);
set_gdbarch_gnu_triplet_regexp (gdbarch, riscv_gnu_triplet_regexp);
next prev parent reply other threads:[~2020-06-08 21:39 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 10:00 Nelson Chu
2020-03-12 10:00 ` [PATCH] RISC-V: Update CSR to privileged spec 1.11 Nelson Chu
2020-03-24 5:05 ` [PING] " Nelson Chu
2020-03-24 8:51 ` Andrew Burgess
2020-03-24 9:11 ` Nelson Chu
2020-06-08 15:37 ` [0/1] RISC-V: Update CSR to priv 1.11 Tom Tromey
2020-06-08 21:39 ` Andrew Burgess [this message]
2020-06-09 1:19 ` Jim Wilson
2020-06-09 10:27 ` Andrew Burgess
2020-06-09 20:12 ` Tom Tromey
2020-06-09 17:30 ` [RFC] gdb/riscv: Improved register alias name creation Andrew Burgess
2020-06-09 20:14 ` Jim Wilson
2020-06-09 22:47 ` Andrew Burgess
2020-06-10 9:31 ` Nelson Chu
2020-06-10 10:55 ` Andrew Burgess
2020-06-10 13:26 ` Nelson Chu
2020-06-09 20:54 ` Tom Tromey
2020-06-09 22:30 ` Andrew Burgess
[not found] ` <8736735bjx.fsf@tromey.com>
2020-06-10 13:01 ` Tom Tromey
2020-06-10 20:37 ` Jim Wilson
2020-06-11 8:28 ` Andrew Burgess
2020-06-09 22:58 ` Andrew Burgess
2020-06-10 12:53 ` Tom Tromey
[not found] ` <87mu5b3vm3.fsf@tromey.com>
2020-06-10 14:46 ` Tom Tromey
2020-06-11 13:16 ` [PATCH 0/2] [PATCHv2] " Andrew Burgess
2020-06-11 13:16 ` [PATCH 1/2] " Andrew Burgess
2020-06-11 13:16 ` [PATCH 2/2] gdb/riscv: Take CSR names from target description Andrew Burgess
2020-06-11 14:06 ` [PATCH 0/2] [PATCHv2] gdb/riscv: Improved register alias name creation Tom Tromey
2020-06-12 22:34 ` Andrew Burgess
2020-06-15 20:27 ` Tom Tromey
2020-06-16 7:56 ` Andrew Burgess
2020-06-16 12:03 ` Tom Tromey
2020-06-16 20:39 ` Andrew Burgess
2020-06-10 20:34 ` [RFC] " Jim Wilson
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=20200608213927.GC2737@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=nelson.chu@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