
* 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
39 lines
995 B
Go
39 lines
995 B
Go
package native
|
|
|
|
import (
|
|
"github.com/go-delve/delve/pkg/proc"
|
|
"github.com/go-delve/delve/pkg/proc/winutil"
|
|
)
|
|
|
|
func newContext() *winutil.ARM64CONTEXT {
|
|
return winutil.NewARM64CONTEXT()
|
|
}
|
|
|
|
func registers(t *nativeThread) (proc.Registers, error) {
|
|
context := newContext()
|
|
|
|
context.SetFlags(_CONTEXT_ALL)
|
|
err := t.getContext(context)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return winutil.NewARM64Registers(context, t.dbp.iscgo), nil
|
|
}
|
|
|
|
func newRegisters(context *winutil.ARM64CONTEXT, TebBaseAddress uint64, iscgo bool) *winutil.ARM64Registers {
|
|
return winutil.NewARM64Registers(context, iscgo)
|
|
}
|
|
|
|
func (t *nativeThread) setContext(context *winutil.ARM64CONTEXT) error {
|
|
return _SetThreadContext(t.os.hThread, context)
|
|
}
|
|
|
|
func (t *nativeThread) getContext(context *winutil.ARM64CONTEXT) error {
|
|
return _GetThreadContext(t.os.hThread, context)
|
|
}
|
|
|
|
func (t *nativeThread) restoreRegisters(savedRegs proc.Registers) error {
|
|
return t.setContext(savedRegs.(*winutil.ARM64Registers).Context)
|
|
}
|