From fdc9cf3c3aaf779387f0341125680f018e5f0275 Mon Sep 17 00:00:00 2001 From: Cosmos Nicolaou Date: Wed, 9 Aug 2023 08:15:51 -0700 Subject: [PATCH] runtime/pprof: fix build breakage on ios CL 503919 breaks tests for ios, this change fixes that. Fixes #61891 Change-Id: I58508a780abb7a2150faec83c0f002cb22abafb7 Reviewed-on: https://go-review.googlesource.com/c/go/+/517795 Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Michael Knyszek Reviewed-by: Bryan Mills Auto-Submit: Bryan Mills --- src/runtime/pprof/proto_test.go | 2 +- src/runtime/pprof/vminfo_darwin_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/runtime/pprof/proto_test.go b/src/runtime/pprof/proto_test.go index eb43816b7c..f788b167da 100644 --- a/src/runtime/pprof/proto_test.go +++ b/src/runtime/pprof/proto_test.go @@ -101,7 +101,7 @@ func testPCs(t *testing.T) (addr1, addr2 uint64, map1, map2 *profile.Mapping) { addr2 = mprof.Mapping[1].Start map2 = mprof.Mapping[1] map2.BuildID, _ = elfBuildID(map2.File) - case "windows", "darwin": + case "windows", "darwin", "ios": addr1 = uint64(abi.FuncPCABIInternal(f1)) addr2 = uint64(abi.FuncPCABIInternal(f2)) diff --git a/src/runtime/pprof/vminfo_darwin_test.go b/src/runtime/pprof/vminfo_darwin_test.go index 3023878fde..c476110b09 100644 --- a/src/runtime/pprof/vminfo_darwin_test.go +++ b/src/runtime/pprof/vminfo_darwin_test.go @@ -2,14 +2,16 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !ios + package pprof import ( "bufio" "bytes" "internal/abi" + "internal/testenv" "os" - "os/exec" "strconv" "strings" "testing" @@ -51,7 +53,8 @@ func TestVMInfo(t *testing.T) { func useVMMap(t *testing.T) (hi, lo uint64) { pid := strconv.Itoa(os.Getpid()) - out, err := exec.Command("vmmap", pid).Output() + testenv.MustHaveExecPath(t, "vmmap") + out, err := testenv.Command(t, "vmmap", pid).Output() if err != nil { t.Fatal(err) } -- 2.50.0