You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I set a breakpoint and then restart the process sometimes the breakpoint changes to address 0 which effectively disables the breakpoint. How do I prevent losing breakpoints after a restart?
For example here you can see that breakpoint 2 changed from a valid address to 0 on restart. Breakpoint 1 did not change so it is still valid after the restart:
/Volumes/git/x $ cat main.go
package main
func main() {
println("Hello, world!")
}
/Volumes/git/x $ dlv debug .
Type 'help' for list of commands.
(dlv) b main.main
Breakpoint 1 set at 0x105fb66 for main.main() ./main.go:3
(dlv) c
> main.main() ./main.go:3 (hits goroutine(1):1 total:1) (PC: 0x105fb66)
1: package main
2:
=> 3: func main() {
4: println("Hello, world!")
5: }
(dlv) b 4
Breakpoint 2 set at 0x105fb74 for main.main() ./main.go:4
(dlv) c
> main.main() ./main.go:4 (hits goroutine(1):1 total:1) (PC: 0x105fb74)
1: package main
2:
3: func main() {
=> 4: println("Hello, world!")
5: }
(dlv) bp
Breakpoint runtime-fatal-throw (enabled) at 0x1031aa0,0x1031ba0 for (multiple functions)() <multiple locations>:0 (0)
Breakpoint unrecovered-panic (enabled) at 0x1031f40 for runtime.fatalpanic() /usr/local/go/src/runtime/panic.go:1145 (0)
print runtime.curg._panic.arg
Breakpoint 1 (enabled) at 0x105fb66 for main.main() ./main.go:3 (1)
Breakpoint 2 (enabled) at 0x105fb74 for main.main() ./main.go:4 (1)
(dlv) r
Process restarted with PID 24326
(dlv) c
> main.main() ./main.go:3 (hits goroutine(1):1 total:1) (PC: 0x105fb66)
1: package main
2:
=> 3: func main() {
4: println("Hello, world!")
5: }
(dlv) bp
Breakpoint runtime-fatal-throw (enabled) at 0x1031aa0,0x1031ba0 for (multiple functions)() <multiple locations>:0 (0)
Breakpoint unrecovered-panic (enabled) at 0x1031f40 for runtime.fatalpanic() /usr/local/go/src/runtime/panic.go:1145 (0)
print runtime.curg._panic.arg
Breakpoint 1 (enabled) at 0x105fb66 for main.main() ./main.go:3 (1)
Breakpoint 2 (enabled) at 0x0 for main.main() ./main.go:4 (0)
(dlv) c
Hello, world!
Process 24326 has exited with status 0
(dlv)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If I set a breakpoint and then restart the process sometimes the breakpoint changes to address 0 which effectively disables the breakpoint. How do I prevent losing breakpoints after a restart?
For example here you can see that breakpoint 2 changed from a valid address to 0 on restart. Breakpoint 1 did not change so it is still valid after the restart:
Beta Was this translation helpful? Give feedback.
All reactions