binutils-gdb/gdb/testsuite/gdb.arch/riscv-tdesc-loading-04.xml
Andrew Burgess 3b9fce9660 gdb/riscv: Improve support for matching against target descriptions
For the RISC-V target it is desirable if the three floating pointer
status CSRs fflags, frm, and fcsr can be placed into either the FPU
feature or the CSR feature.  This allows different targets to build
the features in a way that better reflects their target.

The change to support this within GDB is fairly simple, so this is
done in this commit, and some tests added to check this new
functionality.

gdb/ChangeLog:

	* riscv-tdep.c (value_of_riscv_user_reg): Moved to here from later
	in the file.
	(class riscv_pending_register_alias): Likewise.
	(riscv_register_feature::register_info): Change 'required_p' field
	to 'required', and change its type.  Add 'check' member function.
	(riscv_register_feature::register_info::check): Define new member
	function.
	(riscv_xreg_feature): Change initialisation of 'required' field.
	(riscv_freg_feature): Likewise.
	(riscv_virtual_feature): Likewise.
	(riscv_csr_feature): Likewise.
	(riscv_check_tdesc_feature): Take extra parameter, the csr
	tdesc_feature, rewrite the function to use the new
	riscv_register_feature::register_info::check function.
	(riscv_gdbarch_init): Pass the csr tdesc_feature where needed.

gdb/testsuite/ChangeLog:

	* gdb.arch/riscv-tdesc-loading-01.xml: New file.
	* gdb.arch/riscv-tdesc-loading-02.xml: New file.
	* gdb.arch/riscv-tdesc-loading-03.xml: New file.
	* gdb.arch/riscv-tdesc-loading-04.xml: New file.
	* gdb.arch/riscv-tdesc-loading.exp: New file.
2020-06-25 18:07:31 +01:00

78 lines
3.3 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target>
<architecture>riscv</architecture>
<feature name="org.gnu.gdb.riscv.cpu">
<reg name="zero" bitsize="32" type="int"/>
<reg name="ra" bitsize="32" type="code_ptr"/>
<reg name="sp" bitsize="32" type="data_ptr"/>
<reg name="gp" bitsize="32" type="data_ptr"/>
<reg name="tp" bitsize="32" type="data_ptr"/>
<reg name="t0" bitsize="32" type="int"/>
<reg name="t1" bitsize="32" type="int"/>
<reg name="t2" bitsize="32" type="int"/>
<reg name="fp" bitsize="32" type="data_ptr"/>
<reg name="s1" bitsize="32" type="int"/>
<reg name="a0" bitsize="32" type="int"/>
<reg name="a1" bitsize="32" type="int"/>
<reg name="a2" bitsize="32" type="int"/>
<reg name="a3" bitsize="32" type="int"/>
<reg name="a4" bitsize="32" type="int"/>
<reg name="a5" bitsize="32" type="int"/>
<reg name="a6" bitsize="32" type="int"/>
<reg name="a7" bitsize="32" type="int"/>
<reg name="s2" bitsize="32" type="int"/>
<reg name="s3" bitsize="32" type="int"/>
<reg name="s4" bitsize="32" type="int"/>
<reg name="s5" bitsize="32" type="int"/>
<reg name="s6" bitsize="32" type="int"/>
<reg name="s7" bitsize="32" type="int"/>
<reg name="s8" bitsize="32" type="int"/>
<reg name="s9" bitsize="32" type="int"/>
<reg name="s10" bitsize="32" type="int"/>
<reg name="s11" bitsize="32" type="int"/>
<reg name="t3" bitsize="32" type="int"/>
<reg name="t4" bitsize="32" type="int"/>
<reg name="t5" bitsize="32" type="int"/>
<reg name="t6" bitsize="32" type="int"/>
<reg name="pc" bitsize="32" type="code_ptr"/>
</feature>
<feature name="org.gnu.gdb.riscv.fpu">
<reg name="ft0" bitsize="32" type="float"/>
<reg name="ft1" bitsize="32" type="float"/>
<reg name="ft2" bitsize="32" type="float"/>
<reg name="ft3" bitsize="32" type="float"/>
<reg name="ft4" bitsize="32" type="float"/>
<reg name="ft5" bitsize="32" type="float"/>
<reg name="ft6" bitsize="32" type="float"/>
<reg name="ft7" bitsize="32" type="float"/>
<reg name="fs0" bitsize="32" type="float"/>
<reg name="fs1" bitsize="32" type="float"/>
<reg name="fa0" bitsize="32" type="float"/>
<reg name="fa1" bitsize="32" type="float"/>
<reg name="fa2" bitsize="32" type="float"/>
<reg name="fa3" bitsize="32" type="float"/>
<reg name="fa4" bitsize="32" type="float"/>
<reg name="fa5" bitsize="32" type="float"/>
<reg name="fa6" bitsize="32" type="float"/>
<reg name="fa7" bitsize="32" type="float"/>
<reg name="fs2" bitsize="32" type="float"/>
<reg name="fs3" bitsize="32" type="float"/>
<reg name="fs4" bitsize="32" type="float"/>
<reg name="fs5" bitsize="32" type="float"/>
<reg name="fs6" bitsize="32" type="float"/>
<reg name="fs7" bitsize="32" type="float"/>
<reg name="fs8" bitsize="32" type="float"/>
<reg name="fs9" bitsize="32" type="float"/>
<reg name="fs10" bitsize="32" type="float"/>
<reg name="fs11" bitsize="32" type="float"/>
<reg name="ft8" bitsize="32" type="float"/>
<reg name="ft9" bitsize="32" type="float"/>
<reg name="ft10" bitsize="32" type="float"/>
<reg name="ft11" bitsize="32" type="float"/>
<reg name="fflags" bitsize="32" type="int"/>
<reg name="frm" bitsize="32" type="int"/>
<reg name="fcsr" bitsize="32" type="int"/>
</feature>
</target>