pkg/proc: Fix ThreadId when ErrNoGoroutine on g0 stack in GetG
Avoid always showing `no G executing on thread 0` when ErrNoGoroutine on g0 stack in GetG.
This commit is contained in:
parent
9239013e39
commit
d0b21fbbf2
@ -509,6 +509,9 @@ func GetG(thread Thread) (*G, error) {
|
||||
}
|
||||
g, err = curgvar.parseG()
|
||||
if err != nil {
|
||||
if _, ok := err.(ErrNoGoroutine); ok {
|
||||
err = ErrNoGoroutine{thread.ThreadID()}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
g.SystemStack = true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user