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:
|
go:
|
||||||
- tip
|
- tip
|
||||||
|
- 1.11.x
|
||||||
- 1.10.x
|
- 1.10.x
|
||||||
- 1.9.x
|
- 1.9.x
|
||||||
- 1.8.x
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
|||||||
@ -1189,8 +1189,9 @@ func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *Thread) RestoreRegisters(regs proc.SavedRegisters) error {
|
func (t *Thread) RestoreRegisters(regs proc.SavedRegisters) error {
|
||||||
//TODO(aarzilli): implement
|
gdbregs := regs.(*gdbRegisters)
|
||||||
return errors.New("not implemented")
|
t.regs = *gdbregs
|
||||||
|
return t.writeRegisters()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Thread) Arch() proc.Arch {
|
func (t *Thread) Arch() proc.Arch {
|
||||||
@ -1345,6 +1346,18 @@ func (t *Thread) writeSomeRegisters(regNames ...string) error {
|
|||||||
return nil
|
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 {
|
func (t *Thread) readSomeRegisters(regNames ...string) error {
|
||||||
if t.p.gcmdok {
|
if t.p.gcmdok {
|
||||||
return t.p.conn.readRegisters(t.strID, t.regs.buf)
|
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) {
|
if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 11) {
|
||||||
t.Skip("this version of Go does not support function calls")
|
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")
|
t.Skip("this backend does not support function calls")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user