Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
dcf51a50
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 搜索 >>
提交
dcf51a50
编写于
5月 01, 2017
作者:
A
Alessandro Arzilli
提交者:
Derek Parker
5月 01, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proc/native: error when reading/writing memory of exited process (#812)
Fixes #809
上级
a731eb66
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
0 deletion
+30
-0
pkg/proc/gdbserial/gdbserver.go
pkg/proc/gdbserial/gdbserver.go
+3
-0
pkg/proc/native/threads_darwin.go
pkg/proc/native/threads_darwin.go
+8
-0
pkg/proc/native/threads_linux.go
pkg/proc/native/threads_linux.go
+6
-0
pkg/proc/native/threads_windows.go
pkg/proc/native/threads_windows.go
+6
-0
service/test/common_test.go
service/test/common_test.go
+7
-0
未找到文件。
pkg/proc/gdbserial/gdbserver.go
浏览文件 @
dcf51a50
...
...
@@ -554,6 +554,9 @@ func (p *Process) StepInstruction() error {
}
func
(
p
*
Process
)
SwitchThread
(
tid
int
)
error
{
if
p
.
exited
{
return
proc
.
ProcessExitedError
{
Pid
:
p
.
conn
.
pid
}
}
if
th
,
ok
:=
p
.
threads
[
tid
];
ok
{
p
.
currentThread
=
th
p
.
selectedGoroutine
,
_
=
proc
.
GetG
(
p
.
CurrentThread
())
...
...
pkg/proc/native/threads_darwin.go
浏览文件 @
dcf51a50
...
...
@@ -8,6 +8,8 @@ import (
"unsafe"
sys
"golang.org/x/sys/unix"
"github.com/derekparker/delve/pkg/proc"
)
// WaitStatus is a synonym for the platform-specific WaitStatus
...
...
@@ -105,6 +107,9 @@ func (t *Thread) stopped() bool {
}
func
(
t
*
Thread
)
WriteMemory
(
addr
uintptr
,
data
[]
byte
)
(
int
,
error
)
{
if
t
.
dbp
.
exited
{
return
0
,
proc
.
ProcessExitedError
{
Pid
:
t
.
dbp
.
pid
}
}
if
len
(
data
)
==
0
{
return
0
,
nil
}
...
...
@@ -120,6 +125,9 @@ func (t *Thread) WriteMemory(addr uintptr, data []byte) (int, error) {
}
func
(
t
*
Thread
)
ReadMemory
(
buf
[]
byte
,
addr
uintptr
)
(
int
,
error
)
{
if
t
.
dbp
.
exited
{
return
0
,
proc
.
ProcessExitedError
{
Pid
:
t
.
dbp
.
pid
}
}
if
len
(
buf
)
==
0
{
return
0
,
nil
}
...
...
pkg/proc/native/threads_linux.go
浏览文件 @
dcf51a50
...
...
@@ -97,6 +97,9 @@ func (t *Thread) restoreRegisters() (err error) {
}
func
(
t
*
Thread
)
WriteMemory
(
addr
uintptr
,
data
[]
byte
)
(
written
int
,
err
error
)
{
if
t
.
dbp
.
exited
{
return
0
,
proc
.
ProcessExitedError
{
Pid
:
t
.
dbp
.
pid
}
}
if
len
(
data
)
==
0
{
return
}
...
...
@@ -105,6 +108,9 @@ func (t *Thread) WriteMemory(addr uintptr, data []byte) (written int, err error)
}
func
(
t
*
Thread
)
ReadMemory
(
data
[]
byte
,
addr
uintptr
)
(
n
int
,
err
error
)
{
if
t
.
dbp
.
exited
{
return
0
,
proc
.
ProcessExitedError
{
Pid
:
t
.
dbp
.
pid
}
}
if
len
(
data
)
==
0
{
return
}
...
...
pkg/proc/native/threads_windows.go
浏览文件 @
dcf51a50
...
...
@@ -133,6 +133,9 @@ func (t *Thread) stopped() bool {
}
func
(
t
*
Thread
)
WriteMemory
(
addr
uintptr
,
data
[]
byte
)
(
int
,
error
)
{
if
t
.
dbp
.
exited
{
return
0
,
proc
.
ProcessExitedError
{
Pid
:
t
.
dbp
.
pid
}
}
var
count
uintptr
err
:=
_WriteProcessMemory
(
t
.
dbp
.
os
.
hProcess
,
addr
,
&
data
[
0
],
uintptr
(
len
(
data
)),
&
count
)
if
err
!=
nil
{
...
...
@@ -144,6 +147,9 @@ func (t *Thread) WriteMemory(addr uintptr, data []byte) (int, error) {
var
ErrShortRead
=
errors
.
New
(
"short read"
)
func
(
t
*
Thread
)
ReadMemory
(
buf
[]
byte
,
addr
uintptr
)
(
int
,
error
)
{
if
t
.
dbp
.
exited
{
return
0
,
proc
.
ProcessExitedError
{
Pid
:
t
.
dbp
.
pid
}
}
if
len
(
buf
)
==
0
{
return
0
,
nil
}
...
...
service/test/common_test.go
浏览文件 @
dcf51a50
...
...
@@ -5,6 +5,7 @@ import (
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"github.com/derekparker/delve/service/api"
...
...
@@ -24,6 +25,12 @@ func assertError(err error, t *testing.T, s string) {
fname
:=
filepath
.
Base
(
file
)
t
.
Fatalf
(
"failed assertion at %s:%d: %s (no error)
\n
"
,
fname
,
line
,
s
)
}
if
strings
.
Index
(
err
.
Error
(),
"Internal debugger error"
)
>=
0
{
_
,
file
,
line
,
_
:=
runtime
.
Caller
(
1
)
fname
:=
filepath
.
Base
(
file
)
t
.
Fatalf
(
"failed assertion at %s:%d: %s internal debugger error: %v
\n
"
,
fname
,
line
,
s
,
err
)
}
}
func
init
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录