
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.
33 lines
244 B
Go
33 lines
244 B
Go
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()
|
|
}
|