Module debugregs

Source
Expand description

Functions to read and write debug registers.

  • The dr{0,1,2,3} registers are used to set break points.
  • The dr6 register contains debug conditions that were sampled at the time the last debug exception.
  • The dr7 register enables or disables breakpoints and sets breakpoint conditions.

See Intel Vol. 3a Chapter 17, “Debug, Branch, Profile, TSC … Features”

§Potential API Improvements

Maybe Breakpoint should be a linear type, and functions that mutate dr0-dr3 should take &mut self. That would mean we’d have to remove BREAKPOINT_REGS and a client maintains some mutable instance to the registers on every core on its own.

Structs§

Dr6
Debug register 6 (dr6) flags.
Dr7

Enums§

BreakCondition
Specifies the breakpoint condition for a corresponding breakpoint.
BreakSize
Specify the size of the memory location at the address specified in the corresponding breakpoint address register (DR0 through DR3).
Breakpoint
Specifies available hardware breakpoints.

Constants§

BREAKPOINT_REGS
An array list of all available breakpoint registers.

Functions§

dr0
Read dr0.
dr0_write
Write dr0.
dr1
Read dr1.
dr2
Read dr2.
dr3
Read dr3.
dr6
Read dr6.
dr7
Read dr7.
dr1_write
Write dr1.
dr2_write
Write dr2.
dr3_write
Write dr3.
dr6_write
Write dr6.
dr7_write
Write dr7.