Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pubx
delve
提交
326e65ef
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,发现更多精彩内容 >>
提交
326e65ef
编写于
8月 17, 2015
作者:
D
Derek Parker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Misc: Source code formatting
上级
f0afd41d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
21 deletion
+0
-21
terminal/command.go
terminal/command.go
+0
-21
未找到文件。
terminal/command.go
浏览文件 @
326e65ef
...
...
@@ -171,12 +171,10 @@ func thread(client service.Client, args ...string) error {
if
err
!=
nil
{
return
err
}
oldState
,
err
:=
client
.
GetState
()
if
err
!=
nil
{
return
err
}
newState
,
err
:=
client
.
SwitchThread
(
tid
)
if
err
!=
nil
{
return
err
...
...
@@ -190,7 +188,6 @@ func thread(client service.Client, args ...string) error {
if
newState
.
CurrentThread
!=
nil
{
newThread
=
strconv
.
Itoa
(
newState
.
CurrentThread
.
ID
)
}
fmt
.
Printf
(
"Switched from %s to %s
\n
"
,
oldThread
,
newThread
)
return
nil
}
...
...
@@ -256,12 +253,10 @@ func clear(client service.Client, args ...string) error {
if
len
(
args
)
==
0
{
return
fmt
.
Errorf
(
"not enough arguments"
)
}
id
,
err
:=
strconv
.
Atoi
(
args
[
0
])
if
err
!=
nil
{
return
err
}
bp
,
err
:=
client
.
ClearBreakpoint
(
id
)
if
err
!=
nil
{
return
err
...
...
@@ -315,12 +310,10 @@ func breakpoints(client service.Client, args ...string) error {
for
i
:=
range
bp
.
Variables
{
attrs
=
append
(
attrs
,
bp
.
Variables
[
i
])
}
if
len
(
attrs
)
>
0
{
fmt
.
Printf
(
"
\t
%s
\n
"
,
strings
.
Join
(
attrs
,
" "
))
}
}
return
nil
}
...
...
@@ -328,7 +321,6 @@ func setBreakpoint(client service.Client, tracepoint bool, args ...string) error
if
len
(
args
)
<
1
{
return
fmt
.
Errorf
(
"address required, specify either a function name or <file:line>"
)
}
requestedBp
:=
&
api
.
Breakpoint
{}
for
i
:=
1
;
i
<
len
(
args
);
i
++
{
...
...
@@ -348,17 +340,14 @@ func setBreakpoint(client service.Client, tracepoint bool, args ...string) error
}
requestedBp
.
Tracepoint
=
tracepoint
locs
,
err
:=
client
.
FindLocation
(
args
[
0
])
if
err
!=
nil
{
return
err
}
thing
:=
"Breakpoint"
if
tracepoint
{
thing
=
"Tracepoint"
}
for
_
,
loc
:=
range
locs
{
requestedBp
.
Addr
=
loc
.
PC
...
...
@@ -369,7 +358,6 @@ func setBreakpoint(client service.Client, tracepoint bool, args ...string) error
fmt
.
Printf
(
"%s %d set at %#v for %s %s:%d
\n
"
,
thing
,
bp
.
ID
,
bp
.
Addr
,
bp
.
FunctionName
,
bp
.
File
,
bp
.
Line
)
}
return
nil
}
...
...
@@ -385,12 +373,10 @@ func printVar(client service.Client, args ...string) error {
if
len
(
args
)
==
0
{
return
fmt
.
Errorf
(
"not enough arguments"
)
}
val
,
err
:=
client
.
EvalVariable
(
args
[
0
])
if
err
!=
nil
{
return
err
}
fmt
.
Println
(
val
.
Value
)
return
nil
}
...
...
@@ -519,11 +505,9 @@ func listCommand(client service.Client, args ...string) error {
if
err
!=
nil
{
return
err
}
if
len
(
locs
)
>
1
{
return
debugger
.
AmbiguousLocationError
{
Location
:
args
[
0
],
CandidatesLocation
:
locs
}
}
printfile
(
locs
[
0
]
.
File
,
locs
[
0
]
.
Line
,
false
)
return
nil
}
...
...
@@ -543,13 +527,11 @@ func printcontext(state *api.DebuggerState) error {
fmt
.
Println
(
"No current thread available"
)
return
nil
}
if
len
(
state
.
CurrentThread
.
File
)
==
0
{
fmt
.
Printf
(
"Stopped at: 0x%x
\n
"
,
state
.
CurrentThread
.
PC
)
fmt
.
Printf
(
"
\0
33[34m=>
\0
33[0m no source available
\n
"
)
return
nil
}
var
fn
*
api
.
Function
if
state
.
CurrentThread
.
Function
!=
nil
{
fn
=
state
.
CurrentThread
.
Function
...
...
@@ -582,11 +564,9 @@ func printcontext(state *api.DebuggerState) error {
printStack
(
bpi
.
Stacktrace
,
"
\t\t
"
)
}
}
if
state
.
Breakpoint
!=
nil
&&
state
.
Breakpoint
.
Tracepoint
{
return
nil
}
return
printfile
(
state
.
CurrentThread
.
File
,
state
.
CurrentThread
.
Line
,
true
)
}
...
...
@@ -598,7 +578,6 @@ func printfile(filename string, line int, showArrow bool) error {
defer
file
.
Close
()
var
context
[]
string
buf
:=
bufio
.
NewReader
(
file
)
l
:=
line
for
i
:=
1
;
i
<
l
-
5
;
i
++
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录