Page MenuHomeFreeBSD

riscv: improve register dumping
ClosedPublic

Authored by christos on Jul 1 2023, 6:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 9:11 AM
Unknown Object (File)
Tue, Oct 14, 9:11 AM
Unknown Object (File)
Tue, Oct 14, 9:11 AM
Unknown Object (File)
Tue, Oct 14, 9:11 AM
Unknown Object (File)
Mon, Oct 13, 7:15 PM
Unknown Object (File)
Tue, Sep 30, 6:43 PM
Unknown Object (File)
Tue, Sep 30, 6:35 PM
Unknown Object (File)
Tue, Sep 30, 6:27 PM
Subscribers

Details

Summary

Search for and print kernel symbols in case a register's value is a
kernel address. Also improve column alignment.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 1 2023, 9:06 PM

Sample output:

   t[0]: 0x0000000000000000
   t[1]: 0x0000000000000000
   t[2]: 0x0000000000000008
   t[3]: 0x00ff000000000000
   t[4]: 0x000000000000ff00
   t[5]: 0xfefefefefefefeff
   t[6]: 0x8080808080808080
   s[0]: 0xffffffc095566770 (end + 0x94a8b158)
   s[1]: 0x0000000551bae478
   s[2]: 0x0000000551bae490
   s[3]: 0xffffffc095756280 (end + 0x94c7ac68)
   s[4]: 0xffffffc0955668a8 (end + 0x94a8b290)
   s[5]: 0xffffffc095566988 (end + 0x94a8b370)
   s[6]: 0xffffffd003181538
   s[7]: 0x0000000000000000
   s[8]: 0x0000000000000000
   s[9]: 0x0000000000000000
  s[10]: 0x0000000000200400
  s[11]: 0xffffffffffffffff
   a[0]: 0xffffffc04ad0e008 (end + 0x4a2329f0)
   a[1]: 0x0000000551bae478
   a[2]: 0x0000000000000013
   a[3]: 0x0000000551bae48b
   a[4]: 0x62696c2f7273752f
   a[5]: 0xffffffc04ad0e008 (end + 0x4a2329f0)
   a[6]: 0xffffffc0005b6630 (copyio_fault + 0x0)
   a[7]: 0x0000000000040000
     ra: 0xffffffc0002bab70 (exec_copyout_strings + 0x80)
     sp: 0xffffffc0955666c0 (end + 0x94a8b0a8)
     gp: 0xffffffc095566610 (end + 0x94a8aff8)
     tp: 0xffffffc000ad5380 (__pcpu + 0x100)
   sepc: 0xffffffc0005b66ac (copyout + 0x5c)
sstatus: 0x8000000200046120

Thanks, this is a nice improvement.

sys/riscv/riscv/trap.c
138

Consider giving this function a name that include "print", for example, print_with_symbol().

christos marked an inline comment as done.

Address Mitchell's comment.

This revision now requires review to proceed.Jul 3 2023, 5:00 PM
This revision is now accepted and ready to land.Jul 3 2023, 5:07 PM
This revision was automatically updated to reflect the committed changes.