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


Hi Andrew,

> [PATCH] gdb/riscv: Use legacy register numbers in default target description
> 
> When the target description support was added to RISC-V, the register
> numbers assigned to the fflags, frm, and fcsr control registers in the
> default target descriptions didn't match the register numbers used by
> GDB before the target description support was added.
> 
> What this means is that if a tools exists in the wild that is using
> hard-coded register number, setup to match GDB's old behaviour, then
> this will have been broken (for fflags, frm, and fcsr) by the move to
> target descriptions.  QEMU is such a tool.
> 
> There are a couple of solutions that could be used to work around this
> issue:
> 
>  - The user can create their own xml description file with the
>    register numbers setup to match their old tool, then load this by
>    telling GDB 'set tdesc filename FILENAME'.
> 
>  - Update their old tool to use the newer default numbering scheme, or
>    better yet add proper target description support to their tool.
> 
>  - We could have RISC-V GDB change to maintain the old defaults.
> 
> This patch implements the last of these ideas, changing the default
> numbering to match the old behaviour.
> 
> This change is only visible to targets that don't supply their own xml
> description file and instead rely on GDB's default numbering.
> 
> gdb/ChangeLog:
> 
> 	* features/riscv/32bit-cpu.xml: Add register numbers.
> 	* features/riscv/32bit-fpu.c: Regenerate.
> 	* features/riscv/32bit-fpu.xml: Add register numbers.
> 	* features/riscv/64bit-cpu.xml: Add register numbers.
> 	* features/riscv/64bit-fpu.c: Regenerate.
> 	* features/riscv/64bit-fpu.xml: Add register numbers.

I've had a chance to look at the patch, and fwiw, it looks good to me.
If others agree that it is OK, I think it would be nice if we pushed
the patch before I create the gdb-8.3-branch, and then create the first
pre-release (8.2.90).

-- 
Joel


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