mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
proc,service,terminal: read defer list
Adds -defer flag to the stack command that decorates the stack traces by associating each stack frame with its deferred calls. Reworks proc.next to use this feature instead of using proc.DeferPC, laying the groundwork to implement #1240.
This commit is contained in:
32
_fixtures/deferstack.go
Normal file
32
_fixtures/deferstack.go
Normal file
@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
import "runtime"
|
||||
|
||||
func f1() {
|
||||
}
|
||||
|
||||
func f2() {
|
||||
}
|
||||
|
||||
func f3() {
|
||||
}
|
||||
|
||||
func call1() {
|
||||
defer f2()
|
||||
defer f1()
|
||||
call2()
|
||||
}
|
||||
|
||||
func call2() {
|
||||
defer f3()
|
||||
defer f2()
|
||||
call3()
|
||||
}
|
||||
|
||||
func call3() {
|
||||
runtime.Breakpoint()
|
||||
}
|
||||
|
||||
func main() {
|
||||
call1()
|
||||
}
|
||||
Reference in New Issue
Block a user