package dwarf
import (
+ "cmd/internal/objabi"
"errors"
"fmt"
"sort"
// be rewritten, since it would change the offsets of the
// child DIEs (which we're relying on in order for abstract
// origin references to work).
- fullname = s.Importpath + "." + s.Name[3:]
+ fullname = objabi.PathToPrefix(s.Importpath) + "." + s.Name[3:]
}
putattr(ctxt, s.Absfn, abbrev, DW_FORM_string, DW_CLS_STRING, int64(len(fullname)), fullname)
}
}
+func TestAbstractOriginSanityIssue26237(t *testing.T) {
+ testenv.MustHaveGoBuild(t)
+
+ if runtime.GOOS == "plan9" {
+ t.Skip("skipping on plan9; no DWARF symbol table in executables")
+ }
+ if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" {
+ t.Skip("skipping on solaris and darwin, pending resolution of issue #23168")
+ }
+ if wd, err := os.Getwd(); err == nil {
+ gopathdir := filepath.Join(wd, "testdata", "issue26237")
+ abstractOriginSanity(t, gopathdir, DefaultOpt)
+ } else {
+ t.Fatalf("os.Getwd() failed %v", err)
+ }
+}
+
func TestRuntimeTypeAttr(t *testing.T) {
testenv.MustHaveGoBuild(t)