Skip to content

Commit

Permalink
Make it actually compile
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Apr 18, 2021
1 parent 3433286 commit 7fa2e89
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _scripts/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func installedExecutablePath() string {
// i.e. cgo enabled and the legacy SDK headers:
// https://forums.developer.apple.com/thread/104296
func canMacnative() bool {
if !(runtime.GOOS == "darwin" && runtime.GOARCH == "amd64") {
if !(runtime.GOOS == "darwin") {
return false
}
if strings.TrimSpace(getoutput("go", "env", "CGO_ENABLED")) != "1" {
Expand Down
10 changes: 10 additions & 0 deletions pkg/proc/native/registers_darwin_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"errors"
"fmt"

"github.com/go-delve/delve/pkg/dwarf/op"
"github.com/go-delve/delve/pkg/dwarf/regnum"
"github.com/go-delve/delve/pkg/proc"
"golang.org/x/arch/arm64/arm64asm"
)
Expand Down Expand Up @@ -142,6 +144,14 @@ func (thread *nativeThread) SetPC(pc uint64) error {
return nil
}

// SetReg changes the value of the specified register.
func (thread *nativeThread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
if regNum != regnum.ARM64_PC {
return fmt.Errorf("changing register %d not implemented", regNum)
}
return thread.SetPC(reg.Uint64Val)
}

// SetSP sets the RSP register to the value specified by `pc`.
func (thread *nativeThread) SetSP(sp uint64) error {
return errors.New("not implemented")
Expand Down
2 changes: 1 addition & 1 deletion pkg/proc/native/threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (t *nativeThread) SetCurrentBreakpoint(adjustPC bool) error {

if bp, ok := t.dbp.FindBreakpoint(pc, adjustPC); ok {
if adjustPC {
if err = t.setPC(bp.Addr); err != nil {
if err = t.SetPC(bp.Addr); err != nil {
return err
}
}
Expand Down

0 comments on commit 7fa2e89

Please sign in to comment.