public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/27887] New: RiscV remote registers interpreted as 64-bit when client architecture set to rv32
@ 2021-05-18 15:13 roseledesma at ucdavis dot edu
  0 siblings, 0 replies; only message in thread
From: roseledesma at ucdavis dot edu @ 2021-05-18 15:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27887

            Bug ID: 27887
           Summary: RiscV remote registers interpreted as 64-bit when
                    client architecture set to rv32
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: remote
          Assignee: unassigned at sourceware dot org
          Reporter: roseledesma at ucdavis dot edu
  Target Milestone: ---

Hello,

I am implementing a remote stub for an educational rv32 simulator. Currently,
when the GDB client requests the contents of the registers via the g packet, my
server responds with some dummy data. However, the client only seems to accept
my response if the packet contains 528 bytes, despite setting the target
architecture to rv32 in the client.

In the GDB client I specify the architecture of the remote system using:

(gdb) set architecture riscv:rv32 

If my server responds to the g packet with 264 bytes (i.e. 33 registers *
4-byte wide * 2 ASCII digits), I receive the following error from the client:

Truncated register 16 in remote 'g' packet

When I send 528 bytes, the client accepts my packet and displays 64-bit
registers.

(gdb) i  r
ra             0xffffffffffffffff       0xffffffffffffffff
sp             0xffffffffffffffff       0xffffffffffffffff
gp             0xffffffffffffffff       0xffffffffffffffff
tp             0xffffffffffffffff       0xffffffffffffffff
t0             0xffffffffffffffff       -1
...
(gdb) show architecture
The target architecture is set to "riscv:rv32".

While supporting the "qXfer:features:read" packet in my server implementation
(to communicate an XML description of the target) resolved this issue, the
behavior is misleading. It was unclear why setting the architecture on the
client was not sufficient for setting the correct register width. If GDB can't
use the architecture I ask it to, a warning or error message would be helpful.

Thank you,
Noah

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-18 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 15:13 [Bug remote/27887] New: RiscV remote registers interpreted as 64-bit when client architecture set to rv32 roseledesma at ucdavis dot edu

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).