Page MenuHomeFreeBSD

Add a kdb show command to print arbitrary SPRs on PowerPC
ClosedPublic

Authored by jhibbits on Aug 3 2016, 1:28 AM.

Details

Summary

There is often a need at the debugger to print arbitrary special
purpose registers (SPRs) on PowerPC. Using a rewritable asm stub, print any SPR
provided on the command line.

Note, as there is no checking in this, attempting to print a nonexistent SPR
may cause a Program exception (illegal instruction, or boundedly undefined).

Note also that this relies on the kernel text pages being writable. If in the
future this is made not the case, this will need to be reworked.

Test Plan

Printing the Processor Version Register (PVR, SPR 287):

db> show spr 11f
SPR 287(11f): 80240012

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhibbits retitled this revision from to Add a kdb show command to print arbitrary SPRs on PowerPC.
jhibbits updated this object.
jhibbits edited the test plan for this revision. (Show Details)
jhibbits added reviewers: PowerPC, nwhitehorn.
This revision was automatically updated to reflect the committed changes.