Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pubx
delve
提交
23dc9f92
D
delve
项目概览
pubx
/
delve
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
delve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
23dc9f92
编写于
3月 02, 2020
作者:
A
a
提交者:
Derek Parker
3月 02, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proc/gdbserial: disable async preemption on macOS
Disables async preemption on macOS Fixes #1905
上级
241f2422
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
11 deletion
+22
-11
pkg/proc/gdbserial/gdbserver.go
pkg/proc/gdbserial/gdbserver.go
+5
-2
pkg/proc/native/proc_windows.go
pkg/proc/native/proc_windows.go
+1
-9
pkg/proc/proc.go
pkg/proc/proc.go
+16
-0
未找到文件。
pkg/proc/gdbserial/gdbserver.go
浏览文件 @
23dc9f92
...
...
@@ -390,6 +390,10 @@ func LLDBLaunch(cmd []string, wd string, foreground bool, debugInfoDirs []string
process
.
SysProcAttr
=
sysProcAttr
(
foreground
)
if
runtime
.
GOOS
==
"darwin"
{
process
.
Env
=
proc
.
DisableAsyncPreemptEnv
()
}
err
:=
process
.
Start
()
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -406,7 +410,7 @@ func LLDBLaunch(cmd []string, wd string, foreground bool, debugInfoDirs []string
if
err
!=
nil
{
return
nil
,
err
}
return
proc
.
NewTarget
(
p
,
false
),
nil
return
proc
.
NewTarget
(
p
,
runtime
.
GOOS
==
"darwin"
),
nil
}
// LLDBAttach starts an instance of lldb-server and connects to it, asking
...
...
@@ -655,7 +659,6 @@ continueLoop:
var
err
error
var
sig
uint8
tu
.
Reset
()
//TODO: pass thread list to resume, which should use it to pass the correct signals
threadID
,
sig
,
err
=
p
.
conn
.
resume
(
p
.
threads
,
&
tu
)
if
err
!=
nil
{
if
_
,
exited
:=
err
.
(
proc
.
ErrProcessExited
);
exited
{
...
...
pkg/proc/native/proc_windows.go
浏览文件 @
23dc9f92
...
...
@@ -7,7 +7,6 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"syscall"
"unsafe"
...
...
@@ -56,14 +55,7 @@ func Launch(cmd []string, wd string, foreground bool, _ []string) (*proc.Target,
}
closer
.
Close
()
env
:=
os
.
Environ
()
for
i
:=
range
env
{
if
strings
.
HasPrefix
(
env
[
i
],
"GODEBUG="
)
{
// Go 1.14 asynchronous preemption mechanism is incompatible with
// debuggers, see: https://github.com/golang/go/issues/36494
env
[
i
]
+=
",asyncpreemptoff=1"
}
}
env
:=
proc
.
DisableAsyncPreemptEnv
()
var
p
*
os
.
Process
dbp
:=
New
(
0
)
...
...
pkg/proc/proc.go
浏览文件 @
23dc9f92
...
...
@@ -7,8 +7,10 @@ import (
"go/ast"
"go/constant"
"go/token"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/go-delve/delve/pkg/goversion"
)
...
...
@@ -845,3 +847,17 @@ func setAsyncPreemptOff(p *Target, v int64) {
err
=
scope
.
setValue
(
asyncpreemptoffv
,
newConstant
(
constant
.
MakeInt64
(
v
),
scope
.
Mem
),
""
)
logger
.
Warnf
(
"could not set asyncpreemptoff %v"
,
err
)
}
// DisableAsyncPreemptEnv returns a process environment (like os.Environ)
// where asyncpreemptoff is set to 1.
func
DisableAsyncPreemptEnv
()
[]
string
{
env
:=
os
.
Environ
()
for
i
:=
range
env
{
if
strings
.
HasPrefix
(
env
[
i
],
"GODEBUG="
)
{
// Go 1.14 asynchronous preemption mechanism is incompatible with
// debuggers, see: https://github.com/golang/go/issues/36494
env
[
i
]
+=
",asyncpreemptoff=1"
}
}
return
env
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录