OpenBoot 3.x Command Reference Manual

Displaying Registers

You can enter the User Interface from the middle of an executing program as a result of a program crash, a user abort, or an encountered breakpoint. (Breakpoints are discussed on "Breakpoints".) In all these cases, the User Interface automatically saves all the CPU data register values in a buffer area. These values can then be inspected or altered for debugging purposes.

SPARC Registers

Table 6-2 lists the SPARC register commands.

Table 6-2 SPARC Register Commands

Command  

Stack Diagram 

Description 

%g0 through %g7

( -- value ) 

Return the value in the specified global register. 

%i0 through %i7

( -- value ) 

Return the value in the specified input register. 

%l0 through %l7

( -- value ) 

Return the value in the specified local register. 

%o0 through %o7

( -- value ) 

Return the value in the specified output register. 

%pc %npc %y

( -- value ) 

Return the value in the specified register. 

%f0 through %f31

( -- value ) 

Return the value in the specified floating point register. 

.fregisters

( -- ) 

Display the values in %f0 through %f31.

.locals

( -- ) 

Display the values in the i, l and o registers.

.registers

( -- ) 

Display values in processor registers. 

.window

( window# -- ) 

Same as w .locals; display the desired window.

ctrace

( -- ) 

Display the return stack showing C subroutines. 

set-pc

( new-value -- ) 

Set %pc to new-value, and set %npc to (new-value+4).

to regname

( new-value -- ) 

Change the value stored in any of the above registers. Use in the form: new-value to regname.

w

( window# -- ) 

Set the current window for displaying %ix, %lx, or %ox.

Table 6-3 SPARC V9 Register Commands

Command 

Stack Diagram 

Description 

%fprs

%asi

%pstate

%tl-c

%pil

%tstate

%tt

%tba

%cwp

%cansave

%canrestore

%otherwin

%wstate

%cleanwin

( -- value ) 

Return the value in the specified register. 

.pstate

( -- ) 

Formatted display of the processor state register. 

.ver

( -- ) 

Formatted display of the version register. 

.ccr

( -- ) 

Formatted display of the %ccr register.

.trap-registers

( -- ) 

Display trap-related registers. 

The values of all of these registers are saved and can be altered with to. After the values have been inspected and/or modified, program execution can be continued with the go command. The saved (and possibly modified) register values are copied back into the CPU, and execution resumes at the location specified by the saved program counter.

If you change %pc with to, you should also change %npc. (It is easier to use set-pc, which changes both registers automatically.)

On SPARC V9 systems, if Nis the current window, N-1 specifies the window for the caller, N-2 specifies the callers's caller, etc.