gdb/riscv: correct dwarf to gdb register number mapping
authorXiao Zeng <zengxiao@eswincomputing.com>
Tue, 6 Dec 2022 06:59:43 +0000 (14:59 +0800)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 6 Dec 2022 10:18:19 +0000 (10:18 +0000)
commitc8ea5e409b02cf7fa848e44af74b2e8246ad03f1
treef6e56dda5d6f27de6c200d19ee1f105bef162ba0
parent40849d84cbcc7647edf90ab8078d873fab15ffb8
gdb/riscv: correct dwarf to gdb register number mapping

According to the riscv psabi, the mapping relationship between the
DWARF registers and the machine registers is as follows:

  DWARF Number | Register Name | Description
  0 - 31       | x0 - x31      | Integer Registers
  32 - 63      | f0 - f31      | Floating-point Registers

This is not modelled quite right in riscv_dwarf_reg_to_regnum, the
DWARF register numbers 31 and 63 are not handled correctly due to a
use of '<' instead of '<='.  This commit fixes this issue.
gdb/riscv-tdep.c