Documentation
¶
Overview ¶
Package browserdebug converts standards-based WebAssembly DWARF into the compact query index used by LLGo's Chrome Language Extension. DWARF remains the source of truth; the index is generated for a debug session and is not a compiler-owned replacement debug format.
Index ¶
Constants ¶
const IndexVersion = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressRange ¶
type Bundle ¶
type Bundle struct {
Index Index
MainPath string
SymbolsPath string
SourceFiles map[string]string
// contains filtered or unexported fields
}
Bundle retains the index and the local files needed to serve a browser session. SourceFiles is keyed by Source.ID.
func Load ¶
func Load(mainPath string, mappings []PathMapping, sourceRoots ...string) (*Bundle, error)
Load reads an embedded or external LLGo WebAssembly artifact and builds its browser query index. External sidecars must carry the same standard build_id as the main module. Sources are exposed only within the module directory, explicit mapping destinations, or sourceRoots supplied by a trusted build.
type Function ¶
type Function struct {
Name string `json:"name"`
Ranges []AddressRange `json:"ranges"`
}
type FunctionValue ¶ added in v1.0.9
type FunctionValue struct {
Index uint32 `json:"index"`
Name string `json:"name"`
Environment string `json:"environment,omitempty"`
}
FunctionValue joins a module-owned indirect-call index to its DWARF name and optional, compiler-described closure environment pointer type.
type Index ¶
type Index struct {
Contract string `json:"contract"`
Version int `json:"version"`
BuildID string `json:"build_id"`
Artifact string `json:"artifact"`
Record Record `json:"record"`
Sources []Source `json:"sources"`
Lines []LineRange `json:"lines"`
Functions []Function `json:"functions"`
FunctionValues []FunctionValue `json:"function_values,omitempty"`
Variables []Variable `json:"variables"`
Types []Type `json:"types"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
Index is the transport-neutral state consumed by the browser extension.
type MissingSymbolsError ¶
MissingSymbolsError reports an unavailable external_debug_info target.
func (*MissingSymbolsError) Error ¶
func (e *MissingSymbolsError) Error() string
func (*MissingSymbolsError) Unwrap ¶
func (e *MissingSymbolsError) Unwrap() error
type PathMapping ¶
PathMapping maps a source prefix recorded by the compiler to a local source prefix. The longest matching From prefix wins.
func ParsePathMapping ¶
func ParsePathMapping(value string) (PathMapping, error)
ParsePathMapping parses the debugger spelling FROM=TO.
type Record ¶
type Record struct {
RecordVersion uint8 `json:"record_version"`
SchemaVersion uint8 `json:"schema_version"`
RuntimeLayoutVersion uint8 `json:"runtime_layout_version"`
LLGoABIVersion uint8 `json:"llgo_abi_version"`
PointerSize uint8 `json:"pointer_size"`
ByteOrder debugabi.ByteOrder `json:"byte_order"`
}
type Type ¶
type Type struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
Size int64 `json:"size"`
Signed bool `json:"signed,omitempty"`
Elem string `json:"elem,omitempty"`
Count int64 `json:"count,omitempty"`
Fields []TypeField `json:"fields,omitempty"`
Enum []EnumValue `json:"enum,omitempty"`
Complete bool `json:"complete"`
}
type Variable ¶
type Variable struct {
Name string `json:"name"`
Scope string `json:"scope"`
Type string `json:"type"`
Ranges []AddressRange `json:"ranges,omitempty"`
Locations []Location `json:"locations,omitempty"`
FrameBase []Location `json:"frame_base,omitempty"`
Constant *Constant `json:"constant,omitempty"`
Depth int `json:"depth"`
}