MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / newDwarfparser

Function newDwarfparser

dwarf.go:57–84  ·  view source on GitHub ↗
(module wazero.CompiledModule)

Source from the content-addressed store, hash-verified

55)
56
57func newDwarfparser(module wazero.CompiledModule) (dwarfparser, error) {
58 sections := module.CustomSections()
59
60 var info, line, ranges, str, abbrev []byte
61 for _, section := range sections {
62 log.Printf("dwarf: found section %s", section.Name())
63 switch section.Name() {
64 case debugInfo:
65 info = section.Data()
66 case debugLine:
67 line = section.Data()
68 case debugStr:
69 str = section.Data()
70 case debugAbbrev:
71 abbrev = section.Data()
72 case debugRanges:
73 ranges = section.Data()
74 }
75 }
76
77 d, err := dwarf.New(abbrev, nil, nil, info, line, nil, ranges, str)
78 if err != nil {
79 return dwarfparser{}, fmt.Errorf("dwarf: %w", err)
80 }
81
82 r := d.Reader()
83 return dwarfparser{d: d, r: r}, nil
84}
85
86func newDwarfParserFromBin(wasmbin []byte) (dwarfparser, error) {
87 info := wasmCustomSection(wasmbin, debugInfo)

Callers 2

preparePythonFunction · 0.85
PrepareMethod · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected