proc: allow evaluator to reference previous frames (#3534)

Fixes #3515
This commit is contained in:
Derek Parker
2023-10-24 09:57:39 -07:00
committed by GitHub
parent b9b553bccd
commit 1e2338d233
7 changed files with 121 additions and 29 deletions

View File

@ -1242,6 +1242,19 @@ func TestHitCondBreakpoint(t *testing.T) {
})
}
func TestCondBreakpointWithFrame(t *testing.T) {
withTestTerminal("condframe", t, func(term *FakeTerminal) {
term.MustExec("break bp1 callme2")
term.MustExec("condition bp1 runtime.frame(1).i == 3")
term.MustExec("continue")
out := term.MustExec("frame 1 print i")
t.Logf("%q", out)
if !strings.Contains(out, "3\n") {
t.Fatalf("wrong value of i")
}
})
}
func TestClearCondBreakpoint(t *testing.T) {
withTestTerminal("break", t, func(term *FakeTerminal) {
term.MustExec("break main.main:4")