{"modulePath":"github.com/hsqbyte/protospec","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package debug\n\nPackage debug provides interactive protocol debugging with breakpoints.\n\n## Functions\n\n```go\nfunc FormatHexView(data []byte, states []FieldState) string\n```\nFormatHexView formats data as annotated hex view.\n\n## Types\n\n```go\ntype Breakpoint struct {\n\tField     string `json:\"field\"`\n\tCondition string `json:\"condition,omitempty\"` // e.g. \"== 4\", \"\u003e 100\"\n}\n```\nBreakpoint defines a debug breakpoint.\n\n```go\ntype FieldState struct {\n\tName     string `json:\"name\"`\n\tType     string `json:\"type\"`\n\tBitWidth int    `json:\"bit_width\"`\n\tOffset   int    `json:\"offset_bits\"`\n\tValue    any    `json:\"value,omitempty\"`\n\tHexView  string `json:\"hex_view\"`\n}\n```\nFieldState represents the state of a field during decoding.\n\n```go\ntype Session struct {\n\t// contains filtered or unexported fields\n}\n```\nSession is an interactive debug session.\n\n```go\nfunc NewSession(s *schema.ProtocolSchema, data []byte) *Session\n```\nNewSession creates a new debug session.\n\n```go\nfunc (s *Session) AddBreakpoint(bp Breakpoint)\n```\nAddBreakpoint adds a breakpoint.\n\n```go\nfunc (s *Session) StepAll() []FieldState\n```\nStepAll decodes all fields and returns their states.\n\n","path":"github.com/hsqbyte/protospec/src/debug","name":"debug","synopsis":"Package debug provides interactive protocol debugging with breakpoints.","isRedistributable":true}
