(mod wazero.CompiledModule)
| 59 | } |
| 60 | |
| 61 | func preparePython(mod wazero.CompiledModule) (*python, error) { |
| 62 | p, err := newDwarfparser(mod) |
| 63 | if err != nil { |
| 64 | return nil, fmt.Errorf("could not build dwarf parser: %w", err) |
| 65 | } |
| 66 | runtimeAddr := pythonAddress(p, runtimeAddrName) |
| 67 | if runtimeAddr == 0 { |
| 68 | return nil, fmt.Errorf("could not find python runtime address") |
| 69 | } |
| 70 | return &python{ |
| 71 | pyrtaddr: ptr32(runtimeAddr), |
| 72 | }, nil |
| 73 | } |
| 74 | |
| 75 | func pythonAddress(p dwarfparser, name string) uint32 { |
| 76 | for { |
no test coverage detected