service/dap: support evaluate requests with expressions and calls (#2185)

* Support evaluate request

* Fix failing tests

* Call support

* Remove debugger.CurrentThread() that got accidentally reintroduced during merge

* Address review comments

* Function to stringify stop reason

* Add resetHandlesForStop

* Handle stop inside call

* More tests

* Address review comments

* Check all threads to determine if call completed

* Fix test

* Fix test

* Fix test

* Address review comments

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
This commit is contained in:
polinasok
2020-11-12 15:24:31 -08:00
committed by GitHub
parent 0843376018
commit c94db60d27
10 changed files with 647 additions and 88 deletions

View File

@ -644,6 +644,7 @@ func TestIssue387(t *testing.T) {
}
func listIsAt(t *testing.T, term *FakeTerminal, listcmd string, cur, start, end int) {
t.Helper()
outstr := term.MustExec(listcmd)
lines := strings.Split(outstr, "\n")
@ -688,10 +689,10 @@ func TestListCmd(t *testing.T) {
withTestTerminal("testvariables", t, func(term *FakeTerminal) {
term.MustExec("continue")
term.MustExec("continue")
listIsAt(t, term, "list", 25, 20, 30)
listIsAt(t, term, "list 69", 69, 64, 70)
listIsAt(t, term, "frame 1 list", 62, 57, 67)
listIsAt(t, term, "frame 1 list 69", 69, 64, 70)
listIsAt(t, term, "list", 27, 22, 32)
listIsAt(t, term, "list 69", 69, 64, 73)
listIsAt(t, term, "frame 1 list", 65, 60, 70)
listIsAt(t, term, "frame 1 list 69", 69, 64, 73)
_, err := term.Exec("frame 50 list")
if err == nil {
t.Fatalf("Expected error requesting 50th frame")