RISC-V: Correct printing of MSTATUS and MISA.
* riscv-tdep.c (riscv_print_one_register_info): For MSTATUS, add comment for SD field, and correct xlen calculation. For MISA, add comment for MXL field, add call to register_size, and correct base calculation.
This commit is contained in:
parent
0903806253
commit
b7c8601a7f
|
@ -1,3 +1,10 @@
|
||||||
|
2018-12-13 Jim Wilson <jimw@sifive.com>
|
||||||
|
|
||||||
|
* riscv-tdep.c (riscv_print_one_register_info): For MSTATUS, add
|
||||||
|
comment for SD field, and correct xlen calculation. For MISA, add
|
||||||
|
comment for MXL field, add call to register_size, and correct base
|
||||||
|
calculation.
|
||||||
|
|
||||||
2018-12-13 Stafford Horne <shorne@gmail.com>
|
2018-12-13 Stafford Horne <shorne@gmail.com>
|
||||||
|
|
||||||
* NEWS(New targets): Add or1k*-*-linux*.
|
* NEWS(New targets): Add or1k*-*-linux*.
|
||||||
|
|
|
@ -701,8 +701,10 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
|
||||||
int size = register_size (gdbarch, regnum);
|
int size = register_size (gdbarch, regnum);
|
||||||
unsigned xlen;
|
unsigned xlen;
|
||||||
|
|
||||||
|
/* The SD field is always in the upper bit of MSTATUS, regardless
|
||||||
|
of the number of bits in MSTATUS. */
|
||||||
d = value_as_long (val);
|
d = value_as_long (val);
|
||||||
xlen = size * 4;
|
xlen = size * 8;
|
||||||
fprintf_filtered (file,
|
fprintf_filtered (file,
|
||||||
"\tSD:%X VM:%02X MXR:%X PUM:%X MPRV:%X XS:%X "
|
"\tSD:%X VM:%02X MXR:%X PUM:%X MPRV:%X XS:%X "
|
||||||
"FS:%X MPP:%x HPP:%X SPP:%X MPIE:%X HPIE:%X "
|
"FS:%X MPP:%x HPP:%X SPP:%X MPIE:%X HPIE:%X "
|
||||||
|
@ -731,9 +733,13 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
|
||||||
int base;
|
int base;
|
||||||
unsigned xlen, i;
|
unsigned xlen, i;
|
||||||
LONGEST d;
|
LONGEST d;
|
||||||
|
int size = register_size (gdbarch, regnum);
|
||||||
|
|
||||||
|
/* The MXL field is always in the upper two bits of MISA,
|
||||||
|
regardless of the number of bits in MISA. Mask out other
|
||||||
|
bits to ensure we have a positive value. */
|
||||||
d = value_as_long (val);
|
d = value_as_long (val);
|
||||||
base = d >> 30;
|
base = (d >> ((size * 8) - 2)) & 0x3;
|
||||||
xlen = 16;
|
xlen = 16;
|
||||||
|
|
||||||
for (; base > 0; base--)
|
for (; base > 0; base--)
|
||||||
|
|
Loading…
Reference in New Issue