Skip to content

Commit ae68cf4

Browse files
committed
cmd/compile: Update ssa/debug_test reference files for delve and gdb
Recent changes to compiler backtraces perturbed the line number assignment, some better, some worse, probably net worse. For purposes of passing the long tests, update the reference files (delve's file was also stale). TODO: Figure out a less delicate way to locate statement boundaries for 1.13. Fixes #29511. Change-Id: If0e488341d848ba6012045b126c86b1250408d65 Reviewed-on: https://go-review.googlesource.com/c/156021 Run-TryBot: David Chase <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 57879fe commit ae68cf4

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,57 @@
88
63: hist := make([]int, 7) //gdb-opt=(dx/O,dy/O) // TODO sink is missing if this code is in 'test' instead of 'main'
99
64: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A) // TODO cannedInput/A is missing if this code is in 'test' instead of 'main'
1010
65: if len(os.Args) > 1 {
11+
73: scanner := bufio.NewScanner(reader)
1112
74: for scanner.Scan() { //gdb-opt=(scanner/A)
13+
75: s := scanner.Text()
1214
76: i, err := strconv.ParseInt(s, 10, 64)
1315
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
1416
81: hist = ensure(int(i), hist)
1517
82: hist[int(i)]++
1618
74: for scanner.Scan() { //gdb-opt=(scanner/A)
19+
75: s := scanner.Text()
1720
76: i, err := strconv.ParseInt(s, 10, 64)
1821
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
1922
81: hist = ensure(int(i), hist)
2023
82: hist[int(i)]++
2124
74: for scanner.Scan() { //gdb-opt=(scanner/A)
25+
75: s := scanner.Text()
2226
76: i, err := strconv.ParseInt(s, 10, 64)
2327
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
2428
81: hist = ensure(int(i), hist)
2529
82: hist[int(i)]++
2630
74: for scanner.Scan() { //gdb-opt=(scanner/A)
31+
75: s := scanner.Text()
2732
76: i, err := strconv.ParseInt(s, 10, 64)
2833
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
2934
81: hist = ensure(int(i), hist)
3035
82: hist[int(i)]++
3136
74: for scanner.Scan() { //gdb-opt=(scanner/A)
37+
75: s := scanner.Text()
3238
76: i, err := strconv.ParseInt(s, 10, 64)
3339
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
3440
81: hist = ensure(int(i), hist)
3541
82: hist[int(i)]++
3642
74: for scanner.Scan() { //gdb-opt=(scanner/A)
43+
75: s := scanner.Text()
3744
76: i, err := strconv.ParseInt(s, 10, 64)
3845
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
3946
81: hist = ensure(int(i), hist)
4047
82: hist[int(i)]++
4148
74: for scanner.Scan() { //gdb-opt=(scanner/A)
49+
75: s := scanner.Text()
4250
76: i, err := strconv.ParseInt(s, 10, 64)
4351
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
4452
81: hist = ensure(int(i), hist)
4553
82: hist[int(i)]++
4654
74: for scanner.Scan() { //gdb-opt=(scanner/A)
55+
75: s := scanner.Text()
4756
76: i, err := strconv.ParseInt(s, 10, 64)
4857
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
4958
81: hist = ensure(int(i), hist)
5059
82: hist[int(i)]++
5160
74: for scanner.Scan() { //gdb-opt=(scanner/A)
61+
75: s := scanner.Text()
5262
76: i, err := strconv.ParseInt(s, 10, 64)
5363
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
5464
81: hist = ensure(int(i), hist)
@@ -60,12 +70,14 @@
6070
87: if a == 0 { //gdb-opt=(a,n,t)
6171
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
6272
91: n += a
73+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
6374
90: t += i * a
6475
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
6576
86: for i, a := range hist {
6677
87: if a == 0 { //gdb-opt=(a,n,t)
6778
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
6879
91: n += a
80+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
6981
90: t += i * a
7082
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
7183
86: for i, a := range hist {
@@ -74,12 +86,14 @@
7486
87: if a == 0 { //gdb-opt=(a,n,t)
7587
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
7688
91: n += a
89+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
7790
90: t += i * a
7891
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
7992
86: for i, a := range hist {
8093
87: if a == 0 { //gdb-opt=(a,n,t)
8194
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
8295
91: n += a
96+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
8397
90: t += i * a
8498
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
8599
86: for i, a := range hist {

src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ n = 0
122122
t = 0
123123
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
124124
91: n += a
125+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
125126
90: t += i * a
126127
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
127128
86: for i, a := range hist {
@@ -131,6 +132,7 @@ n = 3
131132
t = 3
132133
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
133134
91: n += a
135+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
134136
90: t += i * a
135137
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
136138
86: for i, a := range hist {
@@ -145,6 +147,7 @@ n = 6
145147
t = 9
146148
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
147149
91: n += a
150+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
148151
90: t += i * a
149152
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
150153
86: for i, a := range hist {
@@ -154,6 +157,7 @@ n = 8
154157
t = 17
155158
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
156159
91: n += a
160+
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
157161
90: t += i * a
158162
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
159163
86: for i, a := range hist {

src/cmd/compile/internal/ssa/testdata/scopes.dlv-opt.nexts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
26: for i := x; i < 3; i++ {
1616
31: fmt.Println(x, y)
1717
30: y = x + y //gdb-dbg=(x,y)//gdb-opt=(x,y)
18+
31: fmt.Println(x, y)
1819
33: for x := 0; x <= 1; x++ { // From delve scopetest.go
1920
35: f1(a)
2021
38: f2(b)
@@ -42,5 +43,4 @@
4243
58: if i == f {
4344
59: fmt.Println("foo")
4445
64: helloworld()
45-
66: }
4646
15: }

src/cmd/compile/internal/ssa/testdata/scopes.gdb-opt.nexts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ y = 1
2323
30: y = x + y //gdb-dbg=(x,y)//gdb-opt=(x,y)
2424
x = 0
2525
y = 5
26+
31: fmt.Println(x, y)
2627
0: 5
2728
35: f1(a)
2829
38: f2(b)

0 commit comments

Comments
 (0)