From c97c04220daa9fea5cfcbac3ba3cf67daf5ed8f5 Mon Sep 17 00:00:00 2001 From: polinasok <51177946+polinasok@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:51:31 -0700 Subject: [PATCH] service/dap: Change reason to "entry" when stopping on entry (#1976) Co-authored-by: Polina Sokolova --- service/dap/server.go | 2 +- service/dap/server_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service/dap/server.go b/service/dap/server.go index 78646d26..a7262a8e 100644 --- a/service/dap/server.go +++ b/service/dap/server.go @@ -438,7 +438,7 @@ func (s *Server) onConfigurationDoneRequest(request *dap.ConfigurationDoneReques if s.stopOnEntry { e := &dap.StoppedEvent{ Event: *newEvent("stopped"), - Body: dap.StoppedEventBody{Reason: "breakpoint", ThreadId: 1, AllThreadsStopped: true}, + Body: dap.StoppedEventBody{Reason: "entry", ThreadId: 1, AllThreadsStopped: true}, } s.send(e) } diff --git a/service/dap/server_test.go b/service/dap/server_test.go index a462ed95..b86705ba 100644 --- a/service/dap/server_test.go +++ b/service/dap/server_test.go @@ -135,10 +135,10 @@ func TestStopOnEntry(t *testing.T) { client.ConfigurationDoneRequest() stopEvent := client.ExpectStoppedEvent(t) if stopEvent.Seq != 0 || - stopEvent.Body.Reason != "breakpoint" || + stopEvent.Body.Reason != "entry" || stopEvent.Body.ThreadId != 1 || !stopEvent.Body.AllThreadsStopped { - t.Errorf("\ngot %#v\nwant Seq=0, Body={Reason=\"breakpoint\", ThreadId=1, AllThreadsStopped=true}", stopEvent) + t.Errorf("\ngot %#v\nwant Seq=0, Body={Reason=\"entry\", ThreadId=1, AllThreadsStopped=true}", stopEvent) } cdResp := client.ExpectConfigurationDoneResponse(t) if cdResp.Seq != 0 || cdResp.RequestSeq != 5 { -- GitLab