runtime: elide instantiated types in tracebacks

They tend to be things like ".shape.int" which are noisy, if not
otherwise confusing.

It would be nice to somehow print the real instantiations here, but that
requires keeping track of the dictionary argument so the instantiating
types could be found. One day, maybe, but not today.

Fixes #48578

Change-Id: I0968d24e110b6d47c9468c45372a6979575a8d29
Reviewed-on: https://go-review.googlesource.com/c/go/+/352118
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
This commit is contained in:
Keith Randall 2021-09-24 14:55:06 -07:00
parent 8d09f7c517
commit a80cbc25bd
3 changed files with 38 additions and 18 deletions

View file

@ -752,22 +752,6 @@ func (l *Loader) NReachableSym() int {
return l.attrReachable.Count()
}
// SymNameLen returns the length of the symbol name, trying hard not to load
// the name.
func (l *Loader) SymNameLen(i Sym) int {
// Not much we can do about external symbols.
if l.IsExternal(i) {
return len(l.SymName(i))
}
r, li := l.toLocal(i)
le := r.Sym(li).NameLen(r.Reader)
if !r.NeedNameExpansion() {
return le
}
// Just load the symbol name. We don't know how expanded it'll be.
return len(l.SymName(i))
}
// Returns the raw (unpatched) name of the i-th symbol.
func (l *Loader) RawSymName(i Sym) string {
if l.IsExternal(i) {