Created
June 21, 2016 14:37
-
-
Save dr2chase/50c64443a225a586a5b16e8342e72f14 to your computer and use it in GitHub Desktop.
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 step_hide.go:35 | |
Breakpoint 1 set at 0x237c for main.main() ./step_hide.go:35 | |
(dlv) c | |
> main.main() ./step_hide.go:35 (hits goroutine(1):1 total:1) (PC: 0x237c) | |
30: x := v | |
31: y := x * x | |
32: var z int | |
33: threads() | |
34: for i := 0; i < 10000; i++ { | |
=> 35: z = foo(x, y) | |
36: } | |
37: fmt.Printf("z=%d\n", z) | |
38: } | |
(dlv) goroutine | |
Thread 11779 at ./step_hide.go:35 | |
Goroutine 1: | |
Runtime: /Users/drchase/GoogleDrive/work/go/src/runtime/asm_amd64.s:252 runtime.systemstack_switch (0x4f5a0) | |
User: ./step_hide.go:35 main.main (0x237c) | |
Go: /Users/drchase/GoogleDrive/work/go/src/runtime/asm_amd64.s:152 runtime.rt0_go (0x4f42e) | |
(dlv) s | |
> main.foo() ./step_hide.go:12 (PC: 0x2058) | |
7: | |
8: var v int = 99 | |
9: | |
10: var s string | |
11: | |
=> 12: func foo(x, y int) (z int) { | |
13: s = fmt.Sprintf("x=%d, y=%d, z=%d\n", x, y, z) | |
14: z = x + y | |
15: return | |
16: } | |
17: | |
(dlv) goroutine | |
Thread 13571 at ./step_hide.go:12 | |
Goroutine 8: | |
Runtime: /Users/drchase/GoogleDrive/work/go/src/runtime/proc.go:260 runtime.gopark (0x2905a) | |
User: ./step_hide.go:12 main.foo (0x2058) | |
Go: ./step_hide.go:19 main.threads (0x22df) | |
(dlv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment