• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂b7c8601a7f2874de1bbe0dc38ef86ea053593ad8 (tree)
時間2018-12-14 03:48:23
作者Jim Wilson <jimw@sifi...>
CommiterJim Wilson

Log Message

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.

Change Summary

差異

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
1+2018-12-13 Jim Wilson <jimw@sifive.com>
2+
3+ * riscv-tdep.c (riscv_print_one_register_info): For MSTATUS, add
4+ comment for SD field, and correct xlen calculation. For MISA, add
5+ comment for MXL field, add call to register_size, and correct base
6+ calculation.
7+
18 2018-12-13 Stafford Horne <shorne@gmail.com>
29
310 * NEWS(New targets): Add or1k*-*-linux*.
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -701,8 +701,10 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
701701 int size = register_size (gdbarch, regnum);
702702 unsigned xlen;
703703
704+ /* The SD field is always in the upper bit of MSTATUS, regardless
705+ of the number of bits in MSTATUS. */
704706 d = value_as_long (val);
705- xlen = size * 4;
707+ xlen = size * 8;
706708 fprintf_filtered (file,
707709 "\tSD:%X VM:%02X MXR:%X PUM:%X MPRV:%X XS:%X "
708710 "FS:%X MPP:%x HPP:%X SPP:%X MPIE:%X HPIE:%X "
@@ -731,9 +733,13 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
731733 int base;
732734 unsigned xlen, i;
733735 LONGEST d;
736+ int size = register_size (gdbarch, regnum);
734737
738+ /* The MXL field is always in the upper two bits of MISA,
739+ regardless of the number of bits in MISA. Mask out other
740+ bits to ensure we have a positive value. */
735741 d = value_as_long (val);
736- base = d >> 30;
742+ base = (d >> ((size * 8) - 2)) & 0x3;
737743 xlen = 16;
738744
739745 for (; base > 0; base--)