Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
b8e80746
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,发现更多精彩内容 >>
提交
b8e80746
编写于
8月 29, 2018
作者:
A
aarzilli
提交者:
Derek Parker
8月 30, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proc/native: implement Copy/RestoreRegisters on windows
上级
438e51f3
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
28 addition
and
18 deletion
+28
-18
pkg/proc/native/proc_windows.go
pkg/proc/native/proc_windows.go
+1
-0
pkg/proc/native/registers_linux_amd64.go
pkg/proc/native/registers_linux_amd64.go
+12
-1
pkg/proc/native/registers_windows_amd64.go
pkg/proc/native/registers_windows_amd64.go
+8
-2
pkg/proc/native/threads_windows.go
pkg/proc/native/threads_windows.go
+4
-1
pkg/proc/registers.go
pkg/proc/registers.go
+1
-1
pkg/proc/test/support.go
pkg/proc/test/support.go
+2
-13
未找到文件。
pkg/proc/native/proc_windows.go
浏览文件 @
b8e80746
...
...
@@ -57,6 +57,7 @@ func Launch(cmd []string, wd string, foreground bool) (*Process, error) {
var
p
*
os
.
Process
dbp
:=
New
(
0
)
dbp
.
common
=
proc
.
NewCommonProcess
(
true
)
dbp
.
execPtraceFunc
(
func
()
{
attr
:=
&
os
.
ProcAttr
{
Dir
:
wd
,
...
...
pkg/proc/native/registers_linux_amd64.go
浏览文件 @
b8e80746
...
...
@@ -325,5 +325,16 @@ func (thread *Thread) fpRegisters() (regs []proc.Register, fpregs proc.LinuxX86X
}
func
(
r
*
Regs
)
Copy
()
proc
.
Registers
{
return
r
var
rr
Regs
rr
.
regs
=
&
sys
.
PtraceRegs
{}
rr
.
fpregset
=
&
proc
.
LinuxX86Xstate
{}
*
(
rr
.
regs
)
=
*
(
r
.
regs
)
if
r
.
fpregset
!=
nil
{
*
(
rr
.
fpregset
)
=
*
(
r
.
fpregset
)
}
if
r
.
fpregs
!=
nil
{
rr
.
fpregs
=
make
([]
proc
.
Register
,
len
(
r
.
fpregs
))
copy
(
rr
.
fpregs
,
r
.
fpregs
)
}
return
&
rr
}
pkg/proc/native/registers_windows_amd64.go
浏览文件 @
b8e80746
...
...
@@ -33,6 +33,7 @@ type Regs struct {
fs
uint64
gs
uint64
tls
uint64
context
*
_CONTEXT
fltSave
*
_XMM_SAVE_AREA32
}
...
...
@@ -374,11 +375,16 @@ func registers(thread *Thread, floatingPoint bool) (proc.Registers, error) {
if
floatingPoint
{
regs
.
fltSave
=
&
context
.
FltSave
}
regs
.
context
=
context
return
regs
,
nil
}
func
(
r
*
Regs
)
Copy
()
proc
.
Registers
{
//TODO(aarzilli): implement this to support function calls
return
nil
var
rr
Regs
rr
=
*
r
rr
.
context
=
newCONTEXT
()
*
(
rr
.
context
)
=
*
(
r
.
context
)
rr
.
fltSave
=
&
rr
.
context
.
FltSave
return
&
rr
}
pkg/proc/native/threads_windows.go
浏览文件 @
b8e80746
...
...
@@ -125,6 +125,9 @@ 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
}
var
count
uintptr
err
:=
_WriteProcessMemory
(
t
.
dbp
.
os
.
hProcess
,
addr
,
&
data
[
0
],
uintptr
(
len
(
data
)),
&
count
)
if
err
!=
nil
{
...
...
@@ -151,5 +154,5 @@ func (t *Thread) ReadMemory(buf []byte, addr uintptr) (int, error) {
}
func
(
t
*
Thread
)
restoreRegisters
(
savedRegs
proc
.
Registers
)
error
{
return
errors
.
New
(
"not implemented"
)
return
_SetThreadContext
(
t
.
os
.
hThread
,
savedRegs
.
(
*
Regs
)
.
context
)
}
pkg/proc/registers.go
浏览文件 @
b8e80746
...
...
@@ -24,7 +24,7 @@ type Registers interface {
GAddr
()
(
uint64
,
bool
)
Get
(
int
)
(
uint64
,
error
)
Slice
()
[]
Register
// Copy returns a copy of th
is
registers that is guaranteed not to change
// Copy returns a copy of th
e
registers that is guaranteed not to change
// when the registers of the associated thread change.
Copy
()
Registers
}
...
...
pkg/proc/test/support.go
浏览文件 @
b8e80746
...
...
@@ -251,18 +251,7 @@ func MustSupportFunctionCalls(t *testing.T, testBackend string) {
t
.
Skip
(
"this version of Go does not support function calls"
)
}
const
unsupported
=
"this backend does not support function calls"
if
testBackend
==
"rr"
{
t
.
Skip
(
unsupported
)
}
switch
runtime
.
GOOS
{
case
"darwin"
:
if
testBackend
==
"native"
{
t
.
Skip
(
unsupported
)
}
case
"windows"
:
t
.
Skip
(
unsupported
)
if
testBackend
==
"rr"
||
(
runtime
.
GOOS
==
"darwin"
&&
testBackend
==
"native"
)
{
t
.
Skip
(
"this backend does not support function calls"
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录