package wasmdebug
Import Path
github.com/tetratelabs/wazero/internal/wasmdebug (on go.dev)
Dependency Relation
imports 13 packages, and imported by 5 packages
Involved Source Files
Package wasmdebug contains utilities used to give consistent search keys between stack traces and error messages.
Note: This is named wasmdebug to avoid conflicts with the normal go module.
Note: This only imports "api" as importing "wasm" would create a cyclic dependency.
dwarf.go
Package-Level Type Names (total 2)
DWARFLines is used to retrieve source code line information from the DWARF data.
Line returns the line information for the given instructionOffset which is an offset in
the code section of the original Wasm binary. Returns empty string if the info is not found.
func NewDWARFLines(d *dwarf.Data) *DWARFLines
ErrorBuilder helps build consistent errors, particularly adding a WASM stack trace.
AddFrame should be called beginning at the frame that panicked until no more frames exist. Once done, call Format.
AddFrame adds the next frame.
* funcName should be from FuncName
* paramTypes should be from wasm.FunctionType
* resultTypes should be from wasm.FunctionType
* sources is the source code information for this frame and can be empty.
Note: paramTypes and resultTypes are present because signature misunderstanding, mismatch or overflow are common.
FromRecovered returns an error with the wasm stack trace appended to it.
func NewErrorBuilder() ErrorBuilder
Package-Level Functions (total 3)
FuncName returns the naming convention of "moduleName.funcName".
- moduleName is the possibly empty name the module was instantiated with.
- funcName is the name in the Custom Name section.
- funcIdx is the position in the function index, prefixed with
imported functions.
Note: "moduleName.$funcIdx" is used when the funcName is empty, as commonly
the case in TinyGo.
NewDWARFLines returns DWARFLines for the given *dwarf.Data.
func NewErrorBuilder() ErrorBuilder
Package-Level Constants (total 2)
GoRuntimeErrorTracePrefix is the prefix coming before the Go runtime stack trace included in the face of runtime.Error.
This is exported for testing purpose.
MaxFrames is the maximum number of frames to include in the stack trace.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |