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:
aarzilli
2018-07-06 09:37:31 +02:00
committed by Derek Parker
parent 932aad9e3d
commit 8f1fc63da8
20 changed files with 388 additions and 117 deletions

32
_fixtures/deferstack.go Normal file
View 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()
}