*: switch to int64 for goroutine IDs (#3110)

Go 1.20 switched to uint64 to represent goroutine IDs, we can't
actually follow suit because we have allowed clients to use -1 to refer
to the currently selected goroutine, however we should at least switch
to int64 and also update the rtype check to accept the 1.20 type.
This commit is contained in:
Alessandro Arzilli
2022-08-16 18:31:11 +02:00
committed by GitHub
parent 0c09fc9bdd
commit 5b9f65dac2
19 changed files with 122 additions and 99 deletions

View File

@ -168,7 +168,7 @@ type Thread struct {
Function *Function `json:"function,omitempty"`
// ID of the goroutine running on this thread
GoroutineID int `json:"goroutineID"`
GoroutineID int64 `json:"goroutineID"`
// Breakpoint this thread is stopped at
Breakpoint *Breakpoint `json:"breakPoint,omitempty"`
@ -358,7 +358,7 @@ type LoadConfig struct {
// internal G structure.
type Goroutine struct {
// ID is a unique identifier for the goroutine.
ID int `json:"id"`
ID int64 `json:"id"`
// Current location of the goroutine
CurrentLoc Location `json:"currentLoc"`
// Current location of the goroutine, excluding calls inside runtime
@ -391,7 +391,7 @@ type DebuggerCommand struct {
ThreadID int `json:"threadID,omitempty"`
// GoroutineID is used to specify which thread to use with the SwitchGoroutine
// and Call commands.
GoroutineID int `json:"goroutineID,omitempty"`
GoroutineID int64 `json:"goroutineID,omitempty"`
// When ReturnInfoLoadConfig is not nil it will be used to load the value
// of any return variables.
ReturnInfoLoadConfig *LoadConfig
@ -426,7 +426,7 @@ type BreakpointInfo struct {
// EvalScope is the scope a command should
// be evaluated in. Describes the goroutine and frame number.
type EvalScope struct {
GoroutineID int
GoroutineID int64
Frame int
DeferredCall int // when DeferredCall is n > 0 this eval scope is relative to the n-th deferred call in the current frame
}