Skip to content

Commit f8080ed

Browse files
shuLhangopherbot
authored andcommitted
[release-branch.go1.23] runtime: fix TestGdbAutotmpTypes on gdb version 15
On Arch Linux with gdb version 15.1, the test for TestGdbAutotmpTypes print the following output, ---- ~/src/go/src/runtime $ go test -run=TestGdbAutotmpTypes -v === RUN TestGdbAutotmpTypes === PAUSE TestGdbAutotmpTypes === CONT TestGdbAutotmpTypes runtime-gdb_test.go:78: gdb version 15.1 runtime-gdb_test.go:570: gdb output: Loading Go Runtime support. Target 'exec' cannot support this command. Breakpoint 1 at 0x46e416: file /tmp/TestGdbAutotmpTypes750485513/001/main.go, line 8. This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.archlinux.org> Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal] Debuginfod has been disabled. To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit. [New LWP 355373] [New LWP 355374] [New LWP 355375] [New LWP 355376] Thread 1 "a.exe" hit Breakpoint 1, main.main () at /tmp/TestGdbAutotmpTypes750485513/001/main.go:8 8 func main() { 9 var iface interface{} = map[string]astruct{} All types matching regular expression "astruct": File runtime: []main.astruct bucket<string,main.astruct> hash<string,main.astruct> main.astruct typedef hash<string,main.astruct> * map[string]main.astruct; typedef noalg.[8]main.astruct noalg.[8]main.astruct; noalg.map.bucket[string]main.astruct runtime-gdb_test.go:587: could not find []main.astruct; in 'info typrs astruct' output !!! FAIL exit status 1 FAIL runtime 0.273s $ ---- In the back trace for "File runtime", each output lines does not end with ";" anymore, while in test we check the string with it. While at it, print the expected string with "%q" instead of "%s" for better error message. For #67089 Fixes #69746 Change-Id: If6019ee68c0d8e495c920f98568741462c7d0fd0 Reviewed-on: https://go-review.googlesource.com/c/go/+/598135 Reviewed-by: David Chase <[email protected]> Reviewed-by: Meng Zhuo <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]> (cherry picked from commit ff695ca) Reviewed-on: https://go-review.googlesource.com/c/go/+/617455 Reviewed-by: Michael Knyszek <[email protected]> Auto-Submit: Michael Knyszek <[email protected]>
1 parent ed07b32 commit f8080ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/runtime/runtime-gdb_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,15 +575,15 @@ func TestGdbAutotmpTypes(t *testing.T) {
575575

576576
// Check that the backtrace matches the source code.
577577
types := []string{
578-
"[]main.astruct;",
579-
"bucket<string,main.astruct>;",
580-
"hash<string,main.astruct>;",
581-
"main.astruct;",
582-
"hash<string,main.astruct> * map[string]main.astruct;",
578+
"[]main.astruct",
579+
"bucket<string,main.astruct>",
580+
"hash<string,main.astruct>",
581+
"main.astruct",
582+
"hash<string,main.astruct> * map[string]main.astruct",
583583
}
584584
for _, name := range types {
585585
if !strings.Contains(sgot, name) {
586-
t.Fatalf("could not find %s in 'info typrs astruct' output", name)
586+
t.Fatalf("could not find %q in 'info typrs astruct' output", name)
587587
}
588588
}
589589
}

0 commit comments

Comments
 (0)