提交 03b17821 编写于 作者: D Derek Parker

Inline function

上级 ac914fe1
...@@ -41,8 +41,8 @@ func (dbp *DebuggedProcess) LoadInformation() error { ...@@ -41,8 +41,8 @@ func (dbp *DebuggedProcess) LoadInformation() error {
err error err error
) )
if err := dbp.acquireMachTask(); err != nil { if ret := C.acquire_mach_task(C.int(dbp.Pid), &dbp.os.task, &dbp.os.exceptionPort); ret != C.KERN_SUCCESS {
return fmt.Errorf("could not acquire mach task") return fmt.Errorf("could not acquire mach task %d", ret)
} }
exe, err = dbp.findExecutable() exe, err = dbp.findExecutable()
if err != nil { if err != nil {
...@@ -95,14 +95,6 @@ func (dbp *DebuggedProcess) updateThreadList() error { ...@@ -95,14 +95,6 @@ func (dbp *DebuggedProcess) updateThreadList() error {
return nil return nil
} }
func (dbp *DebuggedProcess) acquireMachTask() error {
if ret := C.acquire_mach_task(C.int(dbp.Pid), &dbp.os.task, &dbp.os.exceptionPort); ret != C.KERN_SUCCESS {
return fmt.Errorf("could not acquire mach task %d", ret)
}
return nil
}
// export addThread
func (dbp *DebuggedProcess) addThread(port int, attach bool) (*ThreadContext, error) { func (dbp *DebuggedProcess) addThread(port int, attach bool) (*ThreadContext, error) {
if thread, ok := dbp.Threads[port]; ok { if thread, ok := dbp.Threads[port]; ok {
return thread, nil return thread, nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册