1
0
mirror of https://github.com/golang/go synced 2024-11-23 01:30:02 -07:00

runtime: make gdb test resilient to line numbering

Don't break on line number, instead break on the actual call.
This makes the test more robust to line numbering changes in the backend.

A CL (28950) changed the generated code line numbering slightly.  A MOVW
$0, R0 instruction at the start of the function changed to line
10 (because several constant zero instructions got CSEd, and one gets
picked arbitrarily).  That's too fragile for a test.

Change-Id: I5d6a8ef0603de7d727585004142780a527e70496
Reviewed-on: https://go-review.googlesource.com/29085
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Keith Randall 2016-09-12 15:19:36 -07:00
parent 6ca7c2055b
commit d00a3cead8

View File

@ -105,17 +105,20 @@ func TestGdbPython(t *testing.T) {
"-ex", "set startup-with-shell off", "-ex", "set startup-with-shell off",
"-ex", "info auto-load python-scripts", "-ex", "info auto-load python-scripts",
"-ex", "set python print-stack full", "-ex", "set python print-stack full",
"-ex", "br main.go:10", "-ex", "br fmt.Println",
"-ex", "run", "-ex", "run",
"-ex", "echo BEGIN info goroutines\n", "-ex", "echo BEGIN info goroutines\n",
"-ex", "info goroutines", "-ex", "info goroutines",
"-ex", "echo END\n", "-ex", "echo END\n",
"-ex", "up", // up from fmt.Println to main
"-ex", "echo BEGIN print mapvar\n", "-ex", "echo BEGIN print mapvar\n",
"-ex", "print mapvar", "-ex", "print mapvar",
"-ex", "echo END\n", "-ex", "echo END\n",
"-ex", "echo BEGIN print strvar\n", "-ex", "echo BEGIN print strvar\n",
"-ex", "print strvar", "-ex", "print strvar",
"-ex", "echo END\n"} "-ex", "echo END\n",
"-ex", "down", // back to fmt.Println (goroutine 2 below only works at bottom of stack. TODO: fix that)
}
// without framepointer, gdb cannot backtrace our non-standard // without framepointer, gdb cannot backtrace our non-standard
// stack frames on RISC architectures. // stack frames on RISC architectures.