[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The OpenRISC 1000 has one particular feature that is difficult for GDB. GDB models target processors with a register bank and a block of memory. The internals of GDB assume that there are not a huge number of registers in total.
The OpenRISC 1000 Special Purpose Registers (SPR) do not really fit well into
this structure. There are too many of them (12 groups each with 2000+ entries
so far, with up to 32 groups permitted) to be implemented as ordinary
registers in GDB. Think what this would mean for the command
info registers all
. However they cannot be considered memory, since
they do not reside in the main memory map.
The solution is to add two new commands to GDB to see the value of a particular SPR and to set the value of a particular SPR.
info spr
is used to show the value of a SPR or group of SPRs.
spr
is used to set the value of an individual SPR.
2.1 Using the info spr Command | Using the “info spr” command | |
2.2 Using the spr Command | Using the spr command |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
info spr
Command The value of an SPR is read by specifying either the unique name of the SPR,
or the its group and index in that group. For example the Debug Reason
Register (DRR
, register 21 in group 6 (Debug)) can be read using any of
the following commands:
|
In each case the output will be:
|
It is also possible to inspect all the registers in a group. For example to look at all the Programmable Interrupt Controller registers (group 9), either of the following commands could be used:
|
And the output would be:
|
Indicating that interrupts 0 and 4 are enabled and interrupt 4 is pending.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
spr
Command The value of an SPR is written by specifying the unique name of the SPR or its
group and index in the same manner as for the info spr
command. An
additional argument specifies the value to be written. So for example the
Programmable Interrupt Controller mask register could be changed to enable
interrupts 5 and 3 only by any of the following commands.
|
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Jeremy Bennett on November, 12 2008 using texi2html 1.78.