Enables debug info (a.k.a. DWARF) by default (#924)

This makes DWARF enabled by default, with an opt-out flag. This didn't
need to be experimental as the feature was requested for a long time and
there's no API impact to using it.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-12-15 14:03:20 +09:00
committed by GitHub
parent 126bd9050d
commit 5f7467b3e0
7 changed files with 64 additions and 65 deletions

View File

@@ -138,6 +138,7 @@ func NewRuntimeWithConfig(ctx context.Context, rConfig RuntimeConfig) Runtime {
memoryLimitPages: config.memoryLimitPages,
memoryCapacityFromMax: config.memoryCapacityFromMax,
isInterpreter: config.isInterpreter,
dwarfDisabled: config.dwarfDisabled,
}
}
@@ -149,6 +150,7 @@ type runtime struct {
memoryLimitPages uint32
memoryCapacityFromMax bool
isInterpreter bool
dwarfDisabled bool
compiledModules []*compiledModule
}
@@ -172,9 +174,8 @@ func (r *runtime) CompileModule(ctx context.Context, binary []byte) (CompiledMod
return nil, errors.New("invalid binary")
}
dwarfEnabled := experimentalapi.DWARFBasedStackTraceEnabled(ctx)
internal, err := binaryformat.DecodeModule(binary, r.enabledFeatures,
r.memoryLimitPages, r.memoryCapacityFromMax, dwarfEnabled, false)
r.memoryLimitPages, r.memoryCapacityFromMax, !r.dwarfDisabled, false)
if err != nil {
return nil, err
} else if err = internal.Validate(r.enabledFeatures); err != nil {