Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
fe19f3f2
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 搜索 >>
提交
fe19f3f2
编写于
6月 12, 2015
作者:
D
Derek Parker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename: s/EvalSymbol/EvalVariable/
上级
f627044f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
21 addition
and
21 deletion
+21
-21
proctl/proctl.go
proctl/proctl.go
+2
-2
proctl/variables.go
proctl/variables.go
+2
-2
proctl/variables_test.go
proctl/variables_test.go
+6
-6
service/client.go
service/client.go
+4
-4
service/debugger/debugger.go
service/debugger/debugger.go
+2
-2
service/rest/client.go
service/rest/client.go
+2
-2
service/rest/server.go
service/rest/server.go
+2
-2
terminal/command.go
terminal/command.go
+1
-1
未找到文件。
proctl/proctl.go
浏览文件 @
fe19f3f2
...
...
@@ -463,8 +463,8 @@ func (dbp *DebuggedProcess) CurrentBreakpoint() *BreakPoint {
}
// Returns the value of the named symbol.
func
(
dbp
*
DebuggedProcess
)
Eval
Symbol
(
name
string
)
(
*
Variable
,
error
)
{
return
dbp
.
CurrentThread
.
Eval
Symbol
(
name
)
func
(
dbp
*
DebuggedProcess
)
Eval
Variable
(
name
string
)
(
*
Variable
,
error
)
{
return
dbp
.
CurrentThread
.
Eval
Variable
(
name
)
}
// Returns a reader for the dwarf data
...
...
proctl/variables.go
浏览文件 @
fe19f3f2
...
...
@@ -197,8 +197,8 @@ func parseG(thread *ThreadContext, gaddr uint64, deref bool) (*G, error) {
return
g
,
nil
}
// Returns the value of the named
symbol
.
func
(
thread
*
ThreadContext
)
Eval
Symbol
(
name
string
)
(
*
Variable
,
error
)
{
// Returns the value of the named
variable
.
func
(
thread
*
ThreadContext
)
Eval
Variable
(
name
string
)
(
*
Variable
,
error
)
{
pc
,
err
:=
thread
.
PC
()
if
err
!=
nil
{
return
nil
,
err
...
...
proctl/variables_test.go
浏览文件 @
fe19f3f2
...
...
@@ -77,9 +77,9 @@ func TestVariableEvaluation(t *testing.T) {
assertNoError
(
err
,
t
,
"Continue() returned an error"
)
for
_
,
tc
:=
range
testcases
{
variable
,
err
:=
p
.
Eval
Symbol
(
tc
.
name
)
variable
,
err
:=
p
.
Eval
Variable
(
tc
.
name
)
if
tc
.
err
==
nil
{
assertNoError
(
err
,
t
,
"Eval
Symbol
() returned an error"
)
assertNoError
(
err
,
t
,
"Eval
Variable
() returned an error"
)
assertVariable
(
t
,
variable
,
tc
)
}
else
{
if
tc
.
err
.
Error
()
!=
err
.
Error
()
{
...
...
@@ -101,10 +101,10 @@ func TestVariableFunctionScoping(t *testing.T) {
assertNoError
(
err
,
t
,
"Continue() returned an error"
)
p
.
Clear
(
pc
)
_
,
err
=
p
.
Eval
Symbol
(
"a1"
)
_
,
err
=
p
.
Eval
Variable
(
"a1"
)
assertNoError
(
err
,
t
,
"Unable to find variable a1"
)
_
,
err
=
p
.
Eval
Symbol
(
"a2"
)
_
,
err
=
p
.
Eval
Variable
(
"a2"
)
assertNoError
(
err
,
t
,
"Unable to find variable a1"
)
// Move scopes, a1 exists here by a2 does not
...
...
@@ -116,10 +116,10 @@ func TestVariableFunctionScoping(t *testing.T) {
err
=
p
.
Continue
()
assertNoError
(
err
,
t
,
"Continue() returned an error"
)
_
,
err
=
p
.
Eval
Symbol
(
"a1"
)
_
,
err
=
p
.
Eval
Variable
(
"a1"
)
assertNoError
(
err
,
t
,
"Unable to find variable a1"
)
_
,
err
=
p
.
Eval
Symbol
(
"a2"
)
_
,
err
=
p
.
Eval
Variable
(
"a2"
)
if
err
==
nil
{
t
.
Fatalf
(
"Can eval out of scope variable a2"
)
}
...
...
service/client.go
浏览文件 @
fe19f3f2
...
...
@@ -40,12 +40,12 @@ type Client interface {
// ListPackageVariables lists all package variables in the context of the current thread.
ListPackageVariables
(
filter
string
)
([]
api
.
Variable
,
error
)
// Eval
Symbol
returns a variable in the context of the current thread.
Eval
Symbol
(
symbol
string
)
(
*
api
.
Variable
,
error
)
// Eval
Variable
returns a variable in the context of the current thread.
Eval
Variable
(
symbol
string
)
(
*
api
.
Variable
,
error
)
// ListPackageVariablesFor lists all package variables in the context of a thread.
ListPackageVariablesFor
(
threadID
int
,
filter
string
)
([]
api
.
Variable
,
error
)
// Eval
Symbol
For returns a variable in the context of the specified thread.
Eval
Symbol
For
(
threadID
int
,
symbol
string
)
(
*
api
.
Variable
,
error
)
// Eval
Variable
For returns a variable in the context of the specified thread.
Eval
Variable
For
(
threadID
int
,
symbol
string
)
(
*
api
.
Variable
,
error
)
// ListSources lists all source files in the process matching filter.
ListSources
(
filter
string
)
([]
string
,
error
)
...
...
service/debugger/debugger.go
浏览文件 @
fe19f3f2
...
...
@@ -426,14 +426,14 @@ func (d *Debugger) FunctionArguments(threadID int) ([]api.Variable, error) {
return
vars
,
err
}
func
(
d
*
Debugger
)
Eval
Symbol
InThread
(
threadID
int
,
symbol
string
)
(
*
api
.
Variable
,
error
)
{
func
(
d
*
Debugger
)
Eval
Variable
InThread
(
threadID
int
,
symbol
string
)
(
*
api
.
Variable
,
error
)
{
var
variable
*
api
.
Variable
err
:=
d
.
withProcess
(
func
(
p
*
proctl
.
DebuggedProcess
)
error
{
thread
,
found
:=
p
.
Threads
[
threadID
]
if
!
found
{
return
fmt
.
Errorf
(
"couldn't find thread %d"
,
threadID
)
}
v
,
err
:=
thread
.
Eval
Symbol
(
symbol
)
v
,
err
:=
thread
.
Eval
Variable
(
symbol
)
if
err
!=
nil
{
return
err
}
...
...
service/rest/client.go
浏览文件 @
fe19f3f2
...
...
@@ -160,7 +160,7 @@ func (c *RESTClient) GetThread(id int) (*api.Thread, error) {
return
thread
,
nil
}
func
(
c
*
RESTClient
)
Eval
Symbol
(
symbol
string
)
(
*
api
.
Variable
,
error
)
{
func
(
c
*
RESTClient
)
Eval
Variable
(
symbol
string
)
(
*
api
.
Variable
,
error
)
{
var
v
*
api
.
Variable
err
:=
c
.
doGET
(
fmt
.
Sprintf
(
"/eval/%s"
,
symbol
),
&
v
)
if
err
!=
nil
{
...
...
@@ -169,7 +169,7 @@ func (c *RESTClient) EvalSymbol(symbol string) (*api.Variable, error) {
return
v
,
nil
}
func
(
c
*
RESTClient
)
Eval
Symbol
For
(
threadID
int
,
symbol
string
)
(
*
api
.
Variable
,
error
)
{
func
(
c
*
RESTClient
)
Eval
Variable
For
(
threadID
int
,
symbol
string
)
(
*
api
.
Variable
,
error
)
{
var
v
*
api
.
Variable
err
:=
c
.
doGET
(
fmt
.
Sprintf
(
"/threads/%d/eval/%s"
,
threadID
,
symbol
),
&
v
)
if
err
!=
nil
{
...
...
service/rest/server.go
浏览文件 @
fe19f3f2
...
...
@@ -354,7 +354,7 @@ func (s *RESTServer) evalSymbol(request *restful.Request, response *restful.Resp
return
}
v
,
err
:=
s
.
debugger
.
Eval
Symbol
InThread
(
current
.
ID
,
symbol
)
v
,
err
:=
s
.
debugger
.
Eval
Variable
InThread
(
current
.
ID
,
symbol
)
if
err
!=
nil
{
writeError
(
response
,
http
.
StatusInternalServerError
,
err
.
Error
())
return
...
...
@@ -382,7 +382,7 @@ func (s *RESTServer) evalThreadSymbol(request *restful.Request, response *restfu
return
}
v
,
err
:=
s
.
debugger
.
Eval
Symbol
InThread
(
id
,
symbol
)
v
,
err
:=
s
.
debugger
.
Eval
Variable
InThread
(
id
,
symbol
)
if
err
!=
nil
{
writeError
(
response
,
http
.
StatusInternalServerError
,
err
.
Error
())
return
...
...
terminal/command.go
浏览文件 @
fe19f3f2
...
...
@@ -308,7 +308,7 @@ func printVar(client service.Client, args ...string) error {
return
fmt
.
Errorf
(
"not enough arguments"
)
}
val
,
err
:=
client
.
Eval
Symbol
(
args
[
0
])
val
,
err
:=
client
.
Eval
Variable
(
args
[
0
])
if
err
!=
nil
{
return
err
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录