Documentation
¶
Overview ¶
Package wasmdebug implements the WebAssembly tool-conventions packaging for embedded and external DWARF custom sections.
Index ¶
- func BuildID(module []byte) ([]byte, bool, error)
- func DWARFSections(module []byte) (map[string][]byte, error)
- func DebuggerRecord(module []byte) (debugabi.Record, bool, error)
- func EnsureBuildID(module []byte) ([]byte, []byte, error)
- func ExternalURL(module []byte) (string, bool, error)
- func Externalize(module []byte, url string) ([]byte, error)
- func HasDWARF(module []byte) (bool, error)
- func RefreshBuildID(module []byte) ([]byte, []byte, error)
- func SetBuildID(module, id []byte) ([]byte, error)
- func SetDebuggerRecord(module []byte, record debugabi.Record) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildID ¶
BuildID returns the unique WebAssembly tool-conventions build_id, if present. Build IDs are arbitrary bytes and are not interpreted as UTF-8.
func DWARFSections ¶
DWARFSections returns the unique embedded DWARF custom sections keyed by their standard section names. Returned contents do not alias module.
func DebuggerRecord ¶
DebuggerRecord returns the unique LLGo debugger ABI record, if present.
func EnsureBuildID ¶
EnsureBuildID preserves an existing valid build ID or installs a deterministic SHA-256 ID over the complete module without a build_id section. Calling it before externalization gives the main module and DWARF sidecar the same identity for stale-sidecar checks.
func ExternalURL ¶
ExternalURL returns the external_debug_info URL, if present.
func Externalize ¶
Externalize removes embedded DWARF custom sections and appends the standard external_debug_info URL record. The original module is suitable for use as the sidecar because the convention permits it to retain code and data.
func RefreshBuildID ¶
RefreshBuildID computes a content identity after debugger metadata is added. It validates an existing ID, then hashes every section except build_id so repeated packaging is deterministic and ABI edits invalidate old sidecars. Call it before externalization to give both artifacts the same identity.
func SetBuildID ¶
SetBuildID replaces the WebAssembly tool-conventions build_id section.
Types ¶
This section is empty.