Created
June 15, 2016 15:21
-
-
Save dr2chase/40de9f72c7d69e125248a56e1fab5f2a to your computer and use it in GitHub Desktop.
Buggy output debugging duffsteptest.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dlv debug | |
Type 'help' for list of commands. | |
(dlv) b main.foo | |
Breakpoint 1 set at 0x2058 for main.foo() ./code.go:14 | |
(dlv) c | |
> main.foo() ./code.go:14 (hits goroutine(1):1 total:1) (PC: 0x2058) | |
9: // Expect to be stopped in fmt.Printf or runtime.duffzero | |
10: import "fmt" | |
11: | |
12: var v int = 99 | |
13: | |
=> 14: func foo(x, y int) (z int) { // c goes here | |
15: fmt.Printf("x=%d, y=%d, z=%d\n", x, y, z) // s #1 goes here | |
16: z = x + y | |
17: return | |
18: } | |
19: | |
(dlv) s | |
> main.foo() ./code.go:15 (PC: 0x2087) | |
10: import "fmt" | |
11: | |
12: var v int = 99 | |
13: | |
14: func foo(x, y int) (z int) { // c goes here | |
=> 15: fmt.Printf("x=%d, y=%d, z=%d\n", x, y, z) // s #1 goes here | |
16: z = x + y | |
17: return | |
18: } | |
19: | |
20: func main() { | |
(dlv) s | |
x=99, y=9801, z=0 | |
z=9900 | |
Process 12863 has exited with status 0 | |
(dlv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment