runtime: include stderr when objdump fails

If objdump panics, we want the panic included in the test log.

Change-Id: I6a6a636c13c5ba08acaa1c6c8714541a8e91542b
Reviewed-on: https://go-review.googlesource.com/c/go/+/704338
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Michael Pratt 2025-09-16 15:07:08 -04:00 committed by Gopher Robot
parent 8616981ce6
commit 9693b94be0

View file

@ -43,7 +43,7 @@ func TestUnsafePoint(t *testing.T) {
cmd := exec.Command(testenv.GoToolPath(t), "tool", "objdump", "-s", "setGlobalPointer", os.Args[0]) cmd := exec.Command(testenv.GoToolPath(t), "tool", "objdump", "-s", "setGlobalPointer", os.Args[0])
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
t.Fatalf("can't objdump %v", err) t.Fatalf("can't objdump %v:\n%s", err, out)
} }
lines := strings.Split(string(out), "\n")[1:] lines := strings.Split(string(out), "\n")[1:]