Add function call support for OSX
Implements missing functionality in gdbserial to enable function calls on OSX.
This commit is contained in:
parent
0461af8392
commit
f1e66f075f
@ -7,9 +7,9 @@ os:
|
||||
|
||||
go:
|
||||
- tip
|
||||
- 1.11.x
|
||||
- 1.10.x
|
||||
- 1.9.x
|
||||
- 1.8.x
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
|
||||
@ -1189,8 +1189,9 @@ func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error) {
|
||||
}
|
||||
|
||||
func (t *Thread) RestoreRegisters(regs proc.SavedRegisters) error {
|
||||
//TODO(aarzilli): implement
|
||||
return errors.New("not implemented")
|
||||
gdbregs := regs.(*gdbRegisters)
|
||||
t.regs = *gdbregs
|
||||
return t.writeRegisters()
|
||||
}
|
||||
|
||||
func (t *Thread) Arch() proc.Arch {
|
||||
@ -1345,6 +1346,18 @@ func (t *Thread) writeSomeRegisters(regNames ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *Thread) writeRegisters() error {
|
||||
if t.p.gcmdok {
|
||||
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
|
||||
}
|
||||
for _, r := range t.regs.regs {
|
||||
if err := t.p.conn.writeRegister(t.strID, r.regnum, r.value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *Thread) readSomeRegisters(regNames ...string) error {
|
||||
if t.p.gcmdok {
|
||||
return t.p.conn.readRegisters(t.strID, t.regs.buf)
|
||||
|
||||
@ -250,7 +250,7 @@ func MustSupportFunctionCalls(t *testing.T, testBackend string) {
|
||||
if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 11) {
|
||||
t.Skip("this version of Go does not support function calls")
|
||||
}
|
||||
if runtime.GOOS != "linux" || testBackend != "native" {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("this backend does not support function calls")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user