flag.BoolVar(&pure_go, "complete", false, "compiling complete package (no C or assembly)")
flag.StringVar(&debugstr, "d", "", "print debug information about items in `list`; try -d help")
flag.BoolVar(&flagDWARF, "dwarf", true, "generate DWARF symbols")
- flag.BoolVar(&Ctxt.Flag_locationlists, "dwarflocationlists", false, "add location lists to DWARF in optimized mode")
+ flag.BoolVar(&Ctxt.Flag_locationlists, "dwarflocationlists", true, "add location lists to DWARF in optimized mode")
flag.IntVar(&genDwarfInline, "gendwarfinl", 2, "generate DWARF inline info records")
objabi.Flagcount("e", "no limit on number of errors reported", &Debug['e'])
objabi.Flagcount("f", "debug stack frames", &Debug['f'])
t.Skip(skipReasons[:len(skipReasons)-2])
}
- optFlags := "-dwarflocationlists"
+ optFlags := "" // Whatever flags are needed to test debugging of optimized code.
if !*useDelve && !*inlines {
// For gdb (default), disable inlining so that a compiler test does not depend on library code.
- // TODO: This may not be necessary with 1.10 and later.
+ // TODO: Technically not necessary in 1.10, but it causes a largish regression that needs investigation.
optFlags += " -l"
}
t.Fatalf("print strvar failed: %s", bl)
}
- // Issue 16338: ssa decompose phase can split a structure into
- // a collection of scalar vars holding the fields. In such cases
+ // The exact format of composite values has changed over time.
+ // For issue 16338: ssa decompose phase split a slice into
+ // a collection of scalar vars holding its fields. In such cases
// the DWARF variable location expression should be of the
// form "var.field" and not just "field".
- infoLocalsRe := regexp.MustCompile(`.*\sslicevar.cap = `)
+ // However, the newer dwarf location list code reconstituted
+ // aggregates from their fields and reverted their printing
+ // back to its original form.
+
+ infoLocalsRe := regexp.MustCompile(`slicevar *= *\[\]string *= *{"def"}`)
if bl := blocks["info locals"]; !infoLocalsRe.MatchString(bl) {
t.Fatalf("info locals failed: %s", bl)
}