delve/pkg/proc/native/registers_windows.go
Quim Muntal 4455d6a9ef
Add support for windows/arm64 (#3063)
* Add support for windows/arm64

* split sentinel files and add winarm64 experiment

* update loadBinaryInfoPE to support PIE binaries

* skip TestDump on windows/arm64

* run windows/arm64 compilation on windows/amd64

* add entry point check for pie binaries

* delete unusded code

* document windows/arm64 breakpoint

* implement changing windows/arm64 fp registers

* update crosscall offset names

* fix G load when using CGO

* fix testvariablescgo

* remove DerefGStructOffset

* derefrence gstructoffset in GStructOffset() if necessary
2022-09-21 13:39:44 -07:00

36 lines
734 B
Go

package native
import "github.com/go-delve/delve/pkg/dwarf/op"
// SetPC sets the RIP register to the value specified by `pc`.
func (thread *nativeThread) setPC(pc uint64) error {
context := newContext()
context.SetFlags(_CONTEXT_ALL)
err := thread.getContext(context)
if err != nil {
return err
}
context.SetPC(pc)
return thread.setContext(context)
}
// SetReg changes the value of the specified register.
func (thread *nativeThread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
context := newContext()
context.SetFlags(_CONTEXT_ALL)
err := thread.getContext(context)
if err != nil {
return err
}
err = context.SetReg(regNum, reg)
if err != nil {
return err
}
return thread.setContext(context)
}