Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
a19bca22
D
delve
项目概览
HugeYuan
/
delve
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
delve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a19bca22
编写于
6月 29, 2017
作者:
A
Alessandro Arzilli
提交者:
Derek Parker
6月 29, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proc/native/windows: inline PtraceDetach delete ptrace_windows.go (#903)
Windows doesn't actually have ptrace. Fixes #778
上级
50f63823
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
32 deletion
+29
-32
pkg/proc/native/proc.go
pkg/proc/native/proc.go
+1
-13
pkg/proc/native/proc_darwin.go
pkg/proc/native/proc_darwin.go
+12
-2
pkg/proc/native/proc_linux.go
pkg/proc/native/proc_linux.go
+14
-2
pkg/proc/native/proc_windows.go
pkg/proc/native/proc_windows.go
+2
-2
pkg/proc/native/ptrace_windows.go
pkg/proc/native/ptrace_windows.go
+0
-13
未找到文件。
pkg/proc/native/proc.go
浏览文件 @
a19bca22
...
...
@@ -370,19 +370,7 @@ func (dbp *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool) {
}
// Returns a new Process struct.
func
initializeDebugProcess
(
dbp
*
Process
,
path
string
,
attach
bool
)
(
*
Process
,
error
)
{
if
attach
{
var
err
error
dbp
.
execPtraceFunc
(
func
()
{
err
=
PtraceAttach
(
dbp
.
pid
)
})
if
err
!=
nil
{
return
nil
,
err
}
_
,
_
,
err
=
dbp
.
wait
(
dbp
.
pid
,
0
)
if
err
!=
nil
{
return
nil
,
err
}
}
func
initializeDebugProcess
(
dbp
*
Process
,
path
string
)
(
*
Process
,
error
)
{
process
,
err
:=
os
.
FindProcess
(
dbp
.
pid
)
if
err
!=
nil
{
return
nil
,
err
...
...
pkg/proc/native/proc_darwin.go
浏览文件 @
a19bca22
...
...
@@ -116,7 +116,7 @@ func Launch(cmd []string, wd string) (*Process, error) {
}
dbp
.
os
.
initialized
=
true
dbp
,
err
=
initializeDebugProcess
(
dbp
,
argv0Go
,
false
)
dbp
,
err
=
initializeDebugProcess
(
dbp
,
argv0Go
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -142,7 +142,17 @@ func Attach(pid int) (*Process, error) {
dbp
.
os
.
initialized
=
true
return
initializeDebugProcess
(
dbp
,
""
,
true
)
var
err
error
dbp
.
execPtraceFunc
(
func
()
{
err
=
PtraceAttach
(
dbp
.
pid
)
})
if
err
!=
nil
{
return
nil
,
err
}
_
,
_
,
err
=
dbp
.
wait
(
dbp
.
pid
,
0
)
if
err
!=
nil
{
return
nil
,
err
}
return
initializeDebugProcess
(
dbp
,
""
)
}
// Kill kills the process.
...
...
pkg/proc/native/proc_linux.go
浏览文件 @
a19bca22
...
...
@@ -73,12 +73,24 @@ func Launch(cmd []string, wd string) (*Process, error) {
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"waiting for target execve failed: %s"
,
err
)
}
return
initializeDebugProcess
(
dbp
,
process
.
Path
,
false
)
return
initializeDebugProcess
(
dbp
,
process
.
Path
)
}
// Attach to an existing process with the given PID.
func
Attach
(
pid
int
)
(
*
Process
,
error
)
{
return
initializeDebugProcess
(
New
(
pid
),
""
,
true
)
dbp
:=
New
(
pid
)
var
err
error
dbp
.
execPtraceFunc
(
func
()
{
err
=
PtraceAttach
(
dbp
.
pid
)
})
if
err
!=
nil
{
return
nil
,
err
}
_
,
_
,
err
=
dbp
.
wait
(
dbp
.
pid
,
0
)
if
err
!=
nil
{
return
nil
,
err
}
return
initializeDebugProcess
(
dbp
,
""
)
}
// Kill kills the target process.
...
...
pkg/proc/native/proc_windows.go
浏览文件 @
a19bca22
...
...
@@ -114,7 +114,7 @@ func newDebugProcess(dbp *Process, exepath string) (*Process, error) {
return
nil
,
err
}
return
initializeDebugProcess
(
dbp
,
exepath
,
false
)
return
initializeDebugProcess
(
dbp
,
exepath
)
}
// findExePath searches for process pid, and returns its executable path.
...
...
@@ -451,7 +451,7 @@ func (dbp *Process) detach(kill bool) error {
}
}
}
return
PtraceDetach
(
dbp
.
pid
,
0
)
return
_DebugActiveProcessStop
(
uint32
(
dbp
.
pid
)
)
}
func
killProcess
(
pid
int
)
error
{
...
...
pkg/proc/native/ptrace_windows.go
已删除
100644 → 0
浏览文件 @
50f63823
package
native
import
(
"fmt"
)
func
PtraceAttach
(
pid
int
)
error
{
return
fmt
.
Errorf
(
"not implemented: PtraceAttach"
)
}
func
PtraceDetach
(
tid
,
sig
int
)
error
{
return
_DebugActiveProcessStop
(
uint32
(
tid
))
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录