Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
78c79927
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 搜索 >>
提交
78c79927
编写于
11月 14, 2015
作者:
A
aarzilli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proc: bugfix: [OS X] desync of mach message queue in Continue
上级
b21686e6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
14 deletion
+40
-14
proc/proc.go
proc/proc.go
+2
-7
proc/proc_darwin.c
proc/proc_darwin.c
+7
-3
proc/proc_darwin.go
proc/proc_darwin.go
+17
-2
proc/proc_darwin.h
proc/proc_darwin.h
+1
-1
proc/proc_linux.go
proc/proc_linux.go
+12
-0
proc/threads_darwin.go
proc/threads_darwin.go
+1
-1
未找到文件。
proc/proc.go
浏览文件 @
78c79927
...
...
@@ -388,13 +388,8 @@ func (dbp *Process) Continue() error {
return
dbp
.
exitGuard
(
err
)
}
dbp
.
SwitchThread
(
thread
.
Id
)
for
_
,
th
:=
range
dbp
.
Threads
{
if
th
.
CurrentBreakpoint
==
nil
{
err
:=
th
.
SetCurrentBreakpoint
()
if
err
!=
nil
{
return
err
}
}
if
err
:=
dbp
.
setExtraBreakpoints
();
err
!=
nil
{
return
err
}
loc
,
err
:=
thread
.
Location
()
if
err
!=
nil
{
...
...
proc/proc_darwin.c
浏览文件 @
78c79927
...
...
@@ -110,7 +110,7 @@ thread_count(task_t task) {
}
mach_port_t
mach_port_wait
(
mach_port_t
port_set
)
{
mach_port_wait
(
mach_port_t
port_set
,
int
nonblocking
)
{
kern_return_t
kret
;
thread_act_t
thread
;
NDR_record_t
*
ndr
;
...
...
@@ -120,9 +120,13 @@ mach_port_wait(mach_port_t port_set) {
mach_msg_header_t
hdr
;
char
data
[
256
];
}
msg
;
mach_msg_option_t
opts
=
MACH_RCV_MSG
|
MACH_RCV_INTERRUPT
;
if
(
nonblocking
)
{
opts
|=
MACH_RCV_TIMEOUT
;
}
// Wait for mach msg.
kret
=
mach_msg
(
&
msg
.
hdr
,
MACH_RCV_MSG
|
MACH_RCV_INTERRUPT
,
kret
=
mach_msg
(
&
msg
.
hdr
,
opts
,
0
,
sizeof
(
msg
.
data
),
port_set
,
0
,
MACH_PORT_NULL
);
if
(
kret
==
MACH_RCV_INTERRUPTED
)
return
kret
;
if
(
kret
!=
MACH_MSG_SUCCESS
)
return
0
;
...
...
@@ -142,7 +146,7 @@ mach_port_wait(mach_port_t port_set) {
if
(
data
[
2
]
==
EXC_SOFT_SIGNAL
)
{
if
(
data
[
3
]
!=
SIGTRAP
)
{
if
(
thread_resume
(
thread
)
!=
KERN_SUCCESS
)
return
0
;
return
mach_port_wait
(
port_set
);
return
mach_port_wait
(
port_set
,
nonblocking
);
}
}
return
thread
;
...
...
proc/proc_darwin.go
浏览文件 @
78c79927
...
...
@@ -111,7 +111,7 @@ func (dbp *Process) Kill() (err error) {
}
}
for
{
port
:=
C
.
mach_port_wait
(
dbp
.
os
.
portSet
)
port
:=
C
.
mach_port_wait
(
dbp
.
os
.
portSet
,
C
.
int
(
0
)
)
if
port
==
dbp
.
os
.
notificationPort
{
break
}
...
...
@@ -268,7 +268,7 @@ func (dbp *Process) findExecutable(path string) (*macho.File, error) {
func
(
dbp
*
Process
)
trapWait
(
pid
int
)
(
*
Thread
,
error
)
{
for
{
port
:=
C
.
mach_port_wait
(
dbp
.
os
.
portSet
)
port
:=
C
.
mach_port_wait
(
dbp
.
os
.
portSet
,
C
.
int
(
0
)
)
switch
port
{
case
dbp
.
os
.
notificationPort
:
...
...
@@ -318,6 +318,21 @@ func (dbp *Process) trapWait(pid int) (*Thread, error) {
}
}
func
(
dbp
*
Process
)
setExtraBreakpoints
()
error
{
for
{
port
:=
C
.
mach_port_wait
(
dbp
.
os
.
portSet
,
C
.
int
(
1
))
if
port
==
0
{
return
nil
}
if
th
,
ok
:=
dbp
.
Threads
[
int
(
port
)];
ok
{
err
:=
th
.
SetCurrentBreakpoint
()
if
err
!=
nil
{
return
err
}
}
}
}
func
(
dbp
*
Process
)
loadProcessInformation
(
wg
*
sync
.
WaitGroup
)
{
wg
.
Done
()
}
...
...
proc/proc_darwin.h
浏览文件 @
78c79927
...
...
@@ -36,7 +36,7 @@ int
thread_count
(
task_t
task
);
mach_port_t
mach_port_wait
(
mach_port_t
);
mach_port_wait
(
mach_port_t
,
int
);
kern_return_t
mach_send_reply
(
mach_msg_header_t
);
...
...
proc/proc_linux.go
浏览文件 @
78c79927
...
...
@@ -378,6 +378,18 @@ func (dbp *Process) wait(pid, options int) (int, *sys.WaitStatus, error) {
}
}
func
(
dbp
*
Process
)
setExtraBreakpoints
()
error
{
for
_
,
th
:=
range
dbp
.
Threads
{
if
th
.
CurrentBreakpoint
==
nil
{
err
:=
th
.
SetCurrentBreakpoint
()
if
err
!=
nil
{
return
err
}
}
}
return
nil
}
func
(
dbp
*
Process
)
exitGuard
(
err
error
)
error
{
if
err
!=
sys
.
ESRCH
{
return
err
...
...
proc/threads_darwin.go
浏览文件 @
78c79927
...
...
@@ -31,7 +31,7 @@ func (t *Thread) singleStep() error {
return
fmt
.
Errorf
(
"could not single step"
)
}
for
{
port
:=
C
.
mach_port_wait
(
t
.
dbp
.
os
.
portSet
)
port
:=
C
.
mach_port_wait
(
t
.
dbp
.
os
.
portSet
,
C
.
int
(
0
)
)
if
port
==
C
.
mach_port_t
(
t
.
Id
)
{
break
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录