<div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr">Hello,<br>
</div><div dir="ltr"> <br>
</div><div dir="ltr">I find that the DwarfRegNum for riscv’s float point register starts from 32,<br>
</div><div dir="ltr"> <br>
</div><div dir="ltr"><font color="#fb3157">// Floating point registers</font><br>
</div><div dir="ltr"><font color="#fb3157">let RegAltNameIndices = [ABIRegAltName] in {</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F0_H : RISCVReg16<0, "f0", ["ft0"]>, DwarfRegNum<[32]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F1_H : RISCVReg16<1, "f1", ["ft1"]>, DwarfRegNum<[33]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F2_H : RISCVReg16<2, "f2", ["ft2"]>, DwarfRegNum<[34]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F3_H : RISCVReg16<3, "f3", ["ft3"]>, DwarfRegNum<[35]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F4_H : RISCVReg16<4, "f4", ["ft4"]>, DwarfRegNum<[36]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F5_H : RISCVReg16<5, "f5", ["ft5"]>, DwarfRegNum<[37]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F6_H : RISCVReg16<6, "f6", ["ft6"]>, DwarfRegNum<[38]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F7_H : RISCVReg16<7, "f7", ["ft7"]>, DwarfRegNum<[39]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F8_H : RISCVReg16<8, "f8", ["fs0"]>, DwarfRegNum<[40]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F9_H : RISCVReg16<9, "f9", ["fs1"]>, DwarfRegNum<[41]>;</font><br>
</div><div dir="ltr"><font color="#fb3157"> def F10_H : RISCVReg16<10,"f10", ["fa0"]>, DwarfRegNum<[42]>;</font><br>
</div><div dir="ltr"> <br>
</div><div dir="ltr">But for GDB’s implementation, F0 starts from 33, and 32 is vacant. That leads to some errors when I trying to debug llvm compiled ELF with GDB.<br>
</div><div dir="ltr"> <br>
</div><div dir="ltr"><font color="#fb3157">/* RiscV register numbers. */</font><br>
</div><div dir="ltr"><font color="#fb3157">enum</font><br>
</div><div dir="ltr"><font color="#fb3157">{</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_ZERO_REGNUM = 0, /* Read-only register, always 0. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_RA_REGNUM = 1, /* Return Address. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_SP_REGNUM = 2, /* Stack Pointer. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_GP_REGNUM = 3, /* Global Pointer. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_TP_REGNUM = 4, /* Thread Pointer. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_FP_REGNUM = 8, /* Frame Pointer. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_A0_REGNUM = 10, /* First argument. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_A1_REGNUM = 11, /* Second argument. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_A7_REGNUM = 17, /* Seventh argument. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_PC_REGNUM = 32, /* Program Counter. */</font><br>
</div><div dir="ltr"><font color="#fb3157"> </font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_NUM_INTEGER_REGS = 32,</font><br>
</div><div dir="ltr"><font color="#fb3157"> </font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_FIRST_FP_REGNUM = 33, /* First Floating Point Register */</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_FA0_REGNUM = 43,</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_FA1_REGNUM = RISCV_FA0_REGNUM + 1,</font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_LAST_FP_REGNUM = 64, /* Last Floating Point Register */</font><br>
</div><div dir="ltr"><font color="#fb3157"> </font><br>
</div><div dir="ltr"><font color="#fb3157"> RISCV_FIRST_CSR_REGNUM = 65, /* First CSR */</font><br>
</div><div dir="ltr"><font color="#fb3157">}</font><br>
</div><div class="wps_signature"></div>