Various fixes for go 1.22 (#3455)

* proc: correctly update local variables after continue

At various point during the execution of the call injection protocol
the process is resumed and the call injection goroutine could migrate
to a different thread, we must make sure to update our local variables
correctly after every point where the target program is resumed.

'fncall122debug_clean' on 'f469a0a5'.

* go.mod: update golang.org/x/tools

Go 1.22 broke golang.org/x/tools/packages

* cmd/dlv: disable TestStaticcheck with go1.22

Go 1.22 is not yet supported by staticcheck.
This commit is contained in:
Alessandro Arzilli
2023-09-19 18:34:34 +02:00
committed by GitHub
parent 30b70bc606
commit e0b4bfbed3
179 changed files with 3988 additions and 4124 deletions

View File

@ -493,6 +493,11 @@ func (scope *EvalScope) setValue(dstv, srcv *Variable, srcExpr string) error {
if err := allocString(scope, srcv); err != nil {
return err
}
if cm, ok := dstv.mem.(*compositeMemory); ok {
// allocString can change the current thread, recover it so that the
// registers are set on the correct thread.
cm.regs.ChangeFunc = scope.callCtx.p.CurrentThread().SetReg
}
return dstv.writeString(uint64(srcv.Len), uint64(srcv.Base))
}