Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pubx
delve
提交
ee04df4a
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,发现更多精彩内容 >>
提交
ee04df4a
编写于
12月 28, 2014
作者:
E
epipho
提交者:
Derek Parker
12月 28, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added info functions
上级
148d6083
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
21 addition
and
8 deletion
+21
-8
command/command.go
command/command.go
+21
-8
未找到文件。
command/command.go
浏览文件 @
ee04df4a
...
@@ -263,7 +263,7 @@ func printVar(p *proctl.DebuggedProcess, args ...string) error {
...
@@ -263,7 +263,7 @@ func printVar(p *proctl.DebuggedProcess, args ...string) error {
func
info
(
p
*
proctl
.
DebuggedProcess
,
args
...
string
)
error
{
func
info
(
p
*
proctl
.
DebuggedProcess
,
args
...
string
)
error
{
if
len
(
args
)
==
0
{
if
len
(
args
)
==
0
{
return
fmt
.
Errorf
(
"not enough arguments"
)
return
fmt
.
Errorf
(
"not enough arguments
. expected info type [regex].
"
)
}
}
// Allow for optional regex
// Allow for optional regex
...
@@ -275,23 +275,36 @@ func info(p *proctl.DebuggedProcess, args ...string) error {
...
@@ -275,23 +275,36 @@ func info(p *proctl.DebuggedProcess, args ...string) error {
}
}
}
}
var
data
[]
string
switch
args
[
0
]
{
switch
args
[
0
]
{
case
"sources"
:
case
"sources"
:
files
:
=
make
([]
string
,
0
,
len
(
p
.
GoSymTable
.
Files
))
data
=
make
([]
string
,
0
,
len
(
p
.
GoSymTable
.
Files
))
for
f
:=
range
p
.
GoSymTable
.
Files
{
for
f
:=
range
p
.
GoSymTable
.
Files
{
if
filter
==
nil
||
filter
.
Match
([]
byte
(
f
))
{
if
filter
==
nil
||
filter
.
Match
([]
byte
(
f
))
{
files
=
append
(
files
,
f
)
data
=
append
(
data
,
f
)
}
}
}
}
break
sort
.
Sort
(
sort
.
StringSlice
(
files
))
case
"functions"
:
data
=
make
([]
string
,
0
,
len
(
p
.
GoSymTable
.
Funcs
))
for
_
,
f
:=
range
files
{
for
_
,
f
:=
range
p
.
GoSymTable
.
Funcs
{
fmt
.
Printf
(
"%s
\n
"
,
f
)
if
f
.
Sym
!=
nil
&&
(
filter
==
nil
||
filter
.
Match
([]
byte
(
f
.
Name
)))
{
data
=
append
(
data
,
f
.
Name
)
}
}
}
break
default
:
default
:
return
fmt
.
Errorf
(
"unsupported info type, must be sources"
)
return
fmt
.
Errorf
(
"unsupported info type, must be sources or functions"
)
}
// sort and output data
sort
.
Sort
(
sort
.
StringSlice
(
data
))
for
_
,
d
:=
range
data
{
fmt
.
Printf
(
"%s
\n
"
,
d
)
}
}
return
nil
return
nil
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录