RISC-V: Support the ISA-dependent CSR checking.
[deliverable/binutils-gdb.git] / gdb / features / riscv / rebuild-csr-xml.sh
index e21aaba6afff71c259282ca639b4d185037e92c3..1adb18009d31020db631e4e1a09790b8f51d298b 100755 (executable)
@@ -19,10 +19,18 @@ function gen_csr_xml ()
 <feature name="org.gnu.gdb.riscv.csr">
 EOF
 
+if [ "$bitsize" = "64" ]; then
     grep "^DECLARE_CSR(" ${RISCV_OPC_FILE} \
-        | sed -e "s!DECLARE_CSR(\(.*\), .*!  <reg name=\"\1\" bitsize=\"$bitsize\"/>!"
+        | sed /CSR_CLASS_.*_32/d \
+        | sed -e "s!DECLARE_CSR(\(.*\), .*, .*!  <reg name=\"\1\" bitsize=\"$bitsize\"/>!"
 
     echo "</feature>"
+else
+    grep "^DECLARE_CSR(" ${RISCV_OPC_FILE} \
+        | sed -e "s!DECLARE_CSR(\(.*\), .*, .*!  <reg name=\"\1\" bitsize=\"$bitsize\"/>!"
+
+    echo "</feature>"
+fi
 }
 
 gen_csr_xml 32 > ${RISCV_FEATURE_DIR}/32bit-csr.xml
This page took 0.02329 seconds and 4 git commands to generate.