cmd/dlv: print out message with stack trace when breakpoint is hit but has no waiting client (#3632)

* Print out message and dump stack on pause

* Fix test

* Move the logic to debugger layer

* Remove unused fields

* Do not use defer to get state

* move channel to connection

* remove lock on isClosed

* Use mutex

* Remove unwanted changes
This commit is contained in:
Fata Nugraha
2024-06-13 02:31:46 +07:00
committed by GitHub
parent 2ec2e831d6
commit 15a9f9d353
8 changed files with 136 additions and 21 deletions

View File

@ -6736,7 +6736,7 @@ func launchDebuggerWithTargetRunning(t *testing.T, fixture string) (*protest.Fix
var err error
go func() {
t.Helper()
_, err = dbg.Command(&api.DebuggerCommand{Name: api.Continue}, running)
_, err = dbg.Command(&api.DebuggerCommand{Name: api.Continue}, running, nil)
select {
case <-running:
default:
@ -6934,7 +6934,7 @@ func (s *MultiClientCloseServerMock) stop(t *testing.T) {
// they are part of dap.Session.
// We must take it down manually as if we are in rpccommon::ServerImpl::Stop.
if s.debugger.IsRunning() {
s.debugger.Command(&api.DebuggerCommand{Name: api.Halt}, nil)
s.debugger.Command(&api.DebuggerCommand{Name: api.Halt}, nil, nil)
}
s.debugger.Detach(true)
}