---
name: "kdb_rd"
section: "3"
platform: "linux"
package: "kernel-patch-kdb"
version: "2.1-3-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/kdb_rd/3"
---

# kdb\_rd(3)

## NAME

rd, rm- Register manipulation commands

## SYNOPSIS

rd \[c\|d\|u\]

rm *register-name* *new-contents*

ef \<address\>

## DESCRIPTION

The **rd** command is used to display the contents of processor registers. Without any arguments, the rd command displays the contents of the general register set at the point at which the kernel debugger was entered.

With the 'c' argument, the processor control registers %cr0, %cr1, %cr2 and %cr4 are displayed, while with the 'd' argument the processor debug registers are displayed.  If the 'u' argument is supplied, the registers for the current task as of the last time the current task entered the kernel are displayed.

On ix86, the **rm** command allows modification of a register.  The following  register names are valid:  **%eax**, **%ebx**, **%ecx**, **%edx**, **%esi**, **%edi**, **%esp**, **%eip**,  and **%ebp**.   Note that if two '%' symbols are used  consecutively, the register set displayed by the 'u' argument to the **rd** command is modified.

The debug registers, **dr0** through **dr3** and both **dr6** and **dr7** can also be modified with the **rm** command.

On sparc64, the valid registers are named **%g0** through **%g7**, **%l0** through **%l7**, **%o0** through **%o7**, and **%i0** through **%i7**, with the exceptions that **%o6** is called **%sp** and that **%i6** is called **%fp**. The registers **%tstate**, **%tpc**, **%tnpc**, **%y**, and **%fprs** provide state information at the time the system entered kdb. Additionally, when viewing registers, two convenience names are provided: **%&regs** shows the address on the stack of the current registers, and **%csp** shows the current stack pointer within kdb itself.

The **ef** command displays an exception frame at the specified address.

## LIMITATIONS

Currently the **rm** command will not allow modification of the control registers.

Currently neither the **rd** command nor the **rm** command will display or modify the model specific registers on the Pentium and Pentium Pro families.

## ENVIRONMENT

None.

## SMP CONSIDERATIONS

None.

## EXAMPLES

- rd

  Display general register set.

- rm %eax 0

  Set the contents of **%eax** to zero.  This will be the value of %eax when kdb returns from the condition which  invoked it.

- rm %%eax 0

  Set the value of the **%eax** register to zero.  This will be the value the user-mode application will see upon returning from the kernel.

- rm dr0 0xc1287220

  Set the value of the **dr0 register to** `0xc1287220`**.**
