(module wazero.CompiledModule)
| 55 | ) |
| 56 | |
| 57 | func 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 | |
| 86 | func newDwarfParserFromBin(wasmbin []byte) (dwarfparser, error) { |
| 87 | info := wasmCustomSection(wasmbin, debugInfo) |
no test coverage detected