From a14e122ae2ecf27a8cace7e0d1dda8606d5e4eca Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 25 Jan 2018 23:10:35 +0000 Subject: compiler: deref receiver types in mangled names This was the original intent, as reflected in the long comment at the start of names.cc, but I forgot to implement it. Also, remove a leading ".0" from the final name. That could occur for a method whose receiver type starts with 'u', as in that case we prepend a space to the mangled name, to avoid confusion with the Unicode mangling, and the space turns into ".0". Also, if the Unicode encoding would cause the final to start with "..u" or "..U", add a leading underscore. Patch gotest to not get fooled by some names. The result of these changes is that all symbols start with a letter or an underscore. Reviewed-on: https://go-review.googlesource.com/90015 From-SVN: r257068 --- libgo/go/runtime/pprof/pprof_test.go | 2 +- libgo/testsuite/gotest | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libgo') diff --git a/libgo/go/runtime/pprof/pprof_test.go b/libgo/go/runtime/pprof/pprof_test.go index ae6ec6d..07a7946 100644 --- a/libgo/go/runtime/pprof/pprof_test.go +++ b/libgo/go/runtime/pprof/pprof_test.go @@ -730,7 +730,7 @@ func TestMutexProfile(t *testing.T) { stks := stacks(p) for _, want := range [][]string{ // {"sync.(*Mutex).Unlock", "pprof.blockMutex.func1"}, - {".1sync.Mutex.Unlock", "pprof.blockMutex..func1"}, + {"sync.Mutex.Unlock", "pprof.blockMutex..func1"}, } { if !containsStack(stks, want) { t.Errorf("No matching stack entry for %+v", want) diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index 8ec12cd..1b23b6d 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -518,7 +518,7 @@ localname() { pattern='Test([^a-z].*)?' # The -p option tells GNU nm not to sort. # The -v option tells Solaris nm to sort by value. - tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) + tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) if [ "x$tests" = x ]; then echo 'gotest: warning: no tests matching '$pattern in _gotest_.o $xofile 1>&2 exit 2 -- cgit v1.1