Documentation
¶
Overview ¶
Package debug provides interactive protocol debugging with breakpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatHexView ¶
func FormatHexView(data []byte, states []FieldState) string
FormatHexView formats data as annotated hex view.
Types ¶
type Breakpoint ¶
type Breakpoint struct {
Field string `json:"field"`
Condition string `json:"condition,omitempty"` // e.g. "== 4", "> 100"
}
Breakpoint defines a debug breakpoint.
type FieldState ¶
type FieldState struct {
Name string `json:"name"`
Type string `json:"type"`
BitWidth int `json:"bit_width"`
Offset int `json:"offset_bits"`
Value any `json:"value,omitempty"`
HexView string `json:"hex_view"`
}
FieldState represents the state of a field during decoding.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is an interactive debug session.
func NewSession ¶
func NewSession(s *schema.ProtocolSchema, data []byte) *Session
NewSession creates a new debug session.
func (*Session) AddBreakpoint ¶
func (s *Session) AddBreakpoint(bp Breakpoint)
AddBreakpoint adds a breakpoint.
func (*Session) StepAll ¶
func (s *Session) StepAll() []FieldState
StepAll decodes all fields and returns their states.
Click to show internal directories.
Click to hide internal directories.