mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
service/dap: support running requests asynchronously (#2423)
* service/dap: refine teardown logic * Address review comments + add missing lock/unlock * Narrow lock scope * Update comments only * Remove redundan temp var from stopNoDebugProcess * Clarify comment * service/dap: support running requests asynchronously * Respond to review comments * Remove debugging printf * Refine locking. Add call TODO. Use -1 for running thread id. * Fix TestAttachStopOnEntry: it can terminate on halt * Respond to review comments * Recover panics in async requests handling * defer releasing asyncSetupDone, so it happens on panic Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
This commit is contained in:
@ -549,7 +549,7 @@ func (d *Debugger) Restart(rerecord bool, pos string, resetArgs bool, newArgs []
|
||||
|
||||
// State returns the current state of the debugger.
|
||||
func (d *Debugger) State(nowait bool) (*api.DebuggerState, error) {
|
||||
if d.isRunning() && nowait {
|
||||
if d.IsRunning() && nowait {
|
||||
return &api.DebuggerState{Running: true}, nil
|
||||
}
|
||||
|
||||
@ -973,7 +973,7 @@ func (d *Debugger) setRunning(running bool) {
|
||||
d.runningMutex.Unlock()
|
||||
}
|
||||
|
||||
func (d *Debugger) isRunning() bool {
|
||||
func (d *Debugger) IsRunning() bool {
|
||||
d.runningMutex.Lock()
|
||||
defer d.runningMutex.Unlock()
|
||||
return d.running
|
||||
@ -1711,7 +1711,7 @@ func (d *Debugger) GetVersion(out *api.GetVersionOut) error {
|
||||
}
|
||||
}
|
||||
|
||||
if !d.isRecording() && !d.isRunning() {
|
||||
if !d.isRecording() && !d.IsRunning() {
|
||||
out.TargetGoVersion = d.target.BinInfo().Producer()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user