mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
debugger: add missing targetMutex protection to CreateWatchpoint() (#3973)
as discussed in https://github.com/go-delve/delve/issues/3970#issuecomment-2779013352 , CreateWatchpoint() is missing mutex protection. This commit corrects this oversight
This commit is contained in:
@ -989,6 +989,9 @@ func (d *Debugger) findBreakpointByName(name string) *api.Breakpoint {
|
||||
|
||||
// CreateWatchpoint creates a watchpoint on the specified expression.
|
||||
func (d *Debugger) CreateWatchpoint(goid int64, frame, deferredCall int, expr string, wtype api.WatchType) (*api.Breakpoint, error) {
|
||||
d.targetMutex.Lock()
|
||||
defer d.targetMutex.Unlock()
|
||||
|
||||
p := d.target.Selected
|
||||
|
||||
s, err := proc.ConvertEvalScope(p, goid, frame, deferredCall)
|
||||
|
||||
Reference in New Issue
Block a user