Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
62f00c94
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
62f00c94
编写于
9月 20, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: null guards when getting response from debug adapter
fixes #12123 fixes #12120
上级
8a3d5b2e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
13 deletion
+32
-13
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+8
-3
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+20
-7
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
...workbench/parts/debug/electron-browser/rawDebugSession.ts
+4
-3
未找到文件。
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
62f00c94
...
...
@@ -132,6 +132,10 @@ export class Thread implements debug.IThread {
private
getCallStackImpl
(
debugService
:
debug
.
IDebugService
,
startFrame
:
number
):
TPromise
<
debug
.
IStackFrame
[]
>
{
let
session
=
debugService
.
getActiveSession
();
return
session
.
stackTrace
({
threadId
:
this
.
threadId
,
startFrame
,
levels
:
20
}).
then
(
response
=>
{
if
(
!
response
||
!
response
.
body
)
{
return
[];
}
this
.
stoppedDetails
.
totalFrames
=
response
.
body
.
totalFrames
;
return
response
.
body
.
stackFrames
.
map
((
rsf
,
level
)
=>
{
if
(
!
rsf
)
{
...
...
@@ -295,9 +299,9 @@ export abstract class ExpressionContainer implements debug.IExpressionContainer
count
,
filter
}).
then
(
response
=>
{
return
arrays
.
distinct
(
response
.
body
.
variables
.
filter
(
v
=>
!!
v
),
v
=>
v
.
name
).
map
(
return
response
&&
response
.
body
&&
response
.
body
.
variables
?
arrays
.
distinct
(
response
.
body
.
variables
.
filter
(
v
=>
!!
v
),
v
=>
v
.
name
).
map
(
v
=>
new
Variable
(
this
,
v
.
variablesReference
,
v
.
name
,
v
.
value
,
v
.
namedVariables
,
v
.
indexedVariables
,
v
.
type
)
);
)
:
[]
;
},
(
e
:
Error
)
=>
[
new
Variable
(
this
,
0
,
null
,
e
.
message
,
0
,
0
,
null
,
false
)]);
}
...
...
@@ -384,7 +388,8 @@ export class StackFrame implements debug.IStackFrame {
public
getScopes
(
debugService
:
debug
.
IDebugService
):
TPromise
<
debug
.
IScope
[]
>
{
if
(
!
this
.
scopes
)
{
this
.
scopes
=
debugService
.
getActiveSession
().
scopes
({
frameId
:
this
.
frameId
}).
then
(
response
=>
{
return
response
.
body
.
scopes
.
map
(
rs
=>
new
Scope
(
this
.
threadId
,
rs
.
name
,
rs
.
variablesReference
,
rs
.
expensive
,
rs
.
namedVariables
,
rs
.
indexedVariables
));
return
response
&&
response
.
body
&&
response
.
body
.
scopes
?
response
.
body
.
scopes
.
map
(
rs
=>
new
Scope
(
this
.
threadId
,
rs
.
name
,
rs
.
variablesReference
,
rs
.
expensive
,
rs
.
namedVariables
,
rs
.
indexedVariables
))
:
[];
},
err
=>
[]);
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
62f00c94
...
...
@@ -346,7 +346,9 @@ export class DebugService implements debug.IDebugService {
private
getThreadData
():
TPromise
<
void
>
{
return
this
.
session
.
threads
().
then
(
response
=>
{
response
.
body
.
threads
.
forEach
(
thread
=>
this
.
model
.
rawUpdate
({
threadId
:
thread
.
id
,
thread
}));
if
(
response
&&
response
.
body
&&
response
.
body
.
threads
)
{
response
.
body
.
threads
.
forEach
(
thread
=>
this
.
model
.
rawUpdate
({
threadId
:
thread
.
id
,
thread
}));
}
});
}
...
...
@@ -508,7 +510,9 @@ export class DebugService implements debug.IDebugService {
value
,
variablesReference
:
(
<
model
.
Variable
>
variable
).
parent
.
reference
}).
then
(
response
=>
{
variable
.
value
=
response
.
body
.
value
;
if
(
response
&&
response
.
body
)
{
variable
.
value
=
response
.
body
.
value
;
}
// Evaluate all watch expressions again since changing variable value might have changed some #8118.
return
this
.
setFocusedStackFrameAndEvaluate
(
this
.
viewModel
.
getFocusedStackFrame
());
},
err
=>
{
...
...
@@ -838,8 +842,9 @@ export class DebugService implements debug.IDebugService {
// internal module
if
(
source
.
reference
!==
0
&&
this
.
session
&&
source
.
available
)
{
return
this
.
session
.
source
({
sourceReference
:
source
.
reference
}).
then
(
response
=>
{
const
mime
=
response
.
body
.
mimeType
?
response
.
body
.
mimeType
:
guessMimeTypes
(
source
.
name
)[
0
];
return
this
.
getDebugStringEditorInput
(
source
,
response
.
body
.
content
,
mime
);
const
mime
=
response
&&
response
.
body
&&
response
.
body
.
mimeType
?
response
.
body
.
mimeType
:
guessMimeTypes
(
source
.
name
)[
0
];
const
inputValue
=
response
&&
response
.
body
?
response
.
body
.
content
:
''
;
return
this
.
getDebugStringEditorInput
(
source
,
inputValue
,
mime
);
},
(
err
:
DebugProtocol
.
ErrorResponse
)
=>
{
// Display the error from debug adapter using a temporary editor #8836
return
this
.
getDebugErrorEditorInput
(
source
,
err
.
message
);
...
...
@@ -924,7 +929,7 @@ export class DebugService implements debug.IDebugService {
}
return
this
.
session
.
continue
({
threadId
}).
then
(
response
=>
{
const
allThreadsContinued
=
response
.
body
?
response
.
body
.
allThreadsContinued
!==
false
:
true
;
const
allThreadsContinued
=
response
&&
response
.
body
?
response
.
body
.
allThreadsContinued
!==
false
:
true
;
this
.
lazyTransitionToRunningState
(
allThreadsContinued
?
undefined
:
threadId
);
});
}
...
...
@@ -957,11 +962,11 @@ export class DebugService implements debug.IDebugService {
column
:
position
.
column
,
line
:
position
.
lineNumber
}).
then
(
response
=>
{
return
!
response
?
[]
:
response
.
body
.
targets
.
map
(
item
=>
({
return
response
&&
response
.
body
&&
response
.
body
.
targets
?
response
.
body
.
targets
.
map
(
item
=>
({
label
:
item
.
label
,
insertText
:
item
.
text
||
item
.
label
,
type
:
item
.
type
}));
}))
:
[]
;
},
err
=>
[]);
}
...
...
@@ -1041,6 +1046,10 @@ export class DebugService implements debug.IDebugService {
breakpoints
:
breakpointsToSend
.
map
(
bp
=>
({
line
:
bp
.
desiredLineNumber
,
condition
:
bp
.
condition
})),
sourceModified
}).
then
(
response
=>
{
if
(
!
response
||
!
response
.
body
)
{
return
;
}
const
data
:
{
[
id
:
string
]:
{
line
?:
number
,
verified
:
boolean
}
}
=
{};
for
(
let
i
=
0
;
i
<
breakpointsToSend
.
length
;
i
++
)
{
data
[
breakpointsToSend
[
i
].
getId
()]
=
response
.
body
.
breakpoints
[
i
];
...
...
@@ -1057,6 +1066,10 @@ export class DebugService implements debug.IDebugService {
const
breakpointsToSend
=
this
.
model
.
getFunctionBreakpoints
().
filter
(
fbp
=>
fbp
.
enabled
&&
this
.
model
.
areBreakpointsActivated
());
return
this
.
session
.
setFunctionBreakpoints
({
breakpoints
:
breakpointsToSend
}).
then
(
response
=>
{
if
(
!
response
||
!
response
.
body
)
{
return
;
}
const
data
:
{
[
id
:
string
]:
{
name
?:
string
,
verified
?:
boolean
}
}
=
{};
for
(
let
i
=
0
;
i
<
breakpointsToSend
.
length
;
i
++
)
{
data
[
breakpointsToSend
[
i
].
getId
()]
=
response
.
body
.
breakpoints
[
i
];
...
...
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
浏览文件 @
62f00c94
...
...
@@ -155,8 +155,9 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
protected
send
(
command
:
string
,
args
:
any
,
cancelOnDisconnect
=
true
):
TPromise
<
DebugProtocol
.
Response
>
{
return
this
.
initServer
().
then
(()
=>
{
const
promise
=
super
.
send
(
command
,
args
).
then
(
response
=>
response
,
(
errorResponse
:
DebugProtocol
.
ErrorResponse
)
=>
{
const
error
=
errorResponse
.
body
?
errorResponse
.
body
.
error
:
null
;
const
telemetryMessage
=
error
?
debug
.
formatPII
(
error
.
format
,
true
,
error
.
variables
)
:
errorResponse
.
message
;
const
error
=
errorResponse
&&
errorResponse
.
body
?
errorResponse
.
body
.
error
:
null
;
const
errorMessage
=
errorResponse
?
errorResponse
.
message
:
''
;
const
telemetryMessage
=
error
?
debug
.
formatPII
(
error
.
format
,
true
,
error
.
variables
)
:
errorMessage
;
if
(
error
&&
error
.
sendTelemetry
)
{
this
.
telemetryService
.
publicLog
(
'
debugProtocolErrorResponse
'
,
{
error
:
telemetryMessage
});
if
(
this
.
customTelemetryService
)
{
...
...
@@ -168,7 +169,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
return
TPromise
.
as
(
null
);
}
const
userMessage
=
error
?
debug
.
formatPII
(
error
.
format
,
false
,
error
.
variables
)
:
error
Response
.
m
essage
;
const
userMessage
=
error
?
debug
.
formatPII
(
error
.
format
,
false
,
error
.
variables
)
:
error
M
essage
;
if
(
error
&&
error
.
url
)
{
const
label
=
error
.
urlLabel
?
error
.
urlLabel
:
nls
.
localize
(
'
moreInfo
'
,
"
More Info
"
);
return
TPromise
.
wrapError
(
errors
.
create
(
userMessage
,
{
actions
:
[
CloseAction
,
new
Action
(
'
debug.moreInfo
'
,
label
,
null
,
true
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录