From: Alessandro Arzilli Date: Sun, 9 May 2021 07:05:45 +0000 (+0200) Subject: cmd/compile: record regabi status in DW_AT_producer X-Git-Tag: go1.17beta1~106 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b83610699a4ea7da22a146c0eefe0ae4d5ac4610;p=gostls13.git cmd/compile: record regabi status in DW_AT_producer Records if regabi was enabled during compilation in the DW_AT_producer attribute of each compile unit. This is useful to debuggers that support the debugCall protocol. Change-Id: I5ad2c48ebf126aeb8bfb459b53a1a5304550036a Reviewed-on: https://go-review.googlesource.com/c/go/+/318050 Trust: Dmitri Shuralyov Reviewed-by: Than McIntosh Reviewed-by: Cherry Mui Run-TryBot: Than McIntosh TryBot-Result: Go Bot --- diff --git a/src/cmd/compile/internal/dwarfgen/dwarf.go b/src/cmd/compile/internal/dwarfgen/dwarf.go index 5d7dc320aa..0e22b61bc3 100644 --- a/src/cmd/compile/internal/dwarfgen/dwarf.go +++ b/src/cmd/compile/internal/dwarfgen/dwarf.go @@ -531,6 +531,14 @@ func RecordFlags(flags ...string) { fmt.Fprintf(&cmd, " -%s=%v", f.Name, getter.Get()) } + // Adds flag to producer string singalling whether regabi is turned on or + // off. + // Once regabi is turned on across the board and the relative GOEXPERIMENT + // knobs no longer exist this code should be removed. + if buildcfg.Experiment.RegabiArgs { + cmd.Write([]byte(" regabi")) + } + if cmd.Len() == 0 { return }