diff --git a/pkg/proc/native/proc_linux.go b/pkg/proc/native/proc_linux.go index 2e9aa0e0edf0495d35c6026f7c9e6c5f6269f323..8cece477c2a7385483bc67cc91a05112ea9b8d4d 100644 --- a/pkg/proc/native/proc_linux.go +++ b/pkg/proc/native/proc_linux.go @@ -603,9 +603,10 @@ func (dbp *nativeProcess) stop(trapthread *nativeThread) (*nativeThread, error) } if switchTrapthread { + trapthreadID := trapthread.ID trapthread = nil for _, th := range dbp.threads { - if th.os.setbp && th.ThreadID() != trapthread.ThreadID() { + if th.os.setbp && th.ThreadID() != trapthreadID { return th, nil } }