Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0e3e5bd8
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,发现更多精彩内容 >>
提交
0e3e5bd8
编写于
10月 04, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: add hit condition to breakpoint model
上级
512ce315
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
36 addition
and
28 deletion
+36
-28
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+21
-18
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+3
-0
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+7
-5
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+3
-3
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+2
-2
未找到文件。
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
0e3e5bd8
...
...
@@ -200,11 +200,12 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
const
data
:
IRawBreakpoint
[]
=
[];
const
enabledAndConditions
:
{
[
key
:
number
]:
{
enabled
:
boolean
,
c
ondition
:
string
}
}
=
{};
const
lineToBreakpointDataMap
:
{
[
key
:
number
]:
{
enabled
:
boolean
,
condition
:
string
,
hitC
ondition
:
string
}
}
=
{};
this
.
debugService
.
getModel
().
getBreakpoints
().
filter
(
bp
=>
bp
.
source
.
uri
.
toString
()
===
modelUrlStr
).
forEach
(
bp
=>
{
enabledAndConditions
[
bp
.
lineNumber
]
=
{
lineToBreakpointDataMap
[
bp
.
lineNumber
]
=
{
enabled
:
bp
.
enabled
,
condition
:
bp
.
condition
condition
:
bp
.
condition
,
hitCondition
:
bp
.
hitCondition
};
});
...
...
@@ -217,8 +218,9 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
data
.
push
({
uri
:
modelUrl
,
lineNumber
:
decorationRange
.
startLineNumber
,
enabled
:
enabledAndConditions
[
modelData
.
breakpointLines
[
i
]].
enabled
,
condition
:
enabledAndConditions
[
modelData
.
breakpointLines
[
i
]].
condition
enabled
:
lineToBreakpointDataMap
[
modelData
.
breakpointLines
[
i
]].
enabled
,
condition
:
lineToBreakpointDataMap
[
modelData
.
breakpointLines
[
i
]].
condition
,
hitCondition
:
lineToBreakpointDataMap
[
modelData
.
breakpointLines
[
i
]].
hitCondition
});
}
}
...
...
@@ -280,7 +282,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
let
result
=
(
!
breakpoint
.
enabled
||
!
activated
)
?
DebugEditorModelManager
.
BREAKPOINT_DISABLED_DECORATION
:
debugActive
&&
modelData
&&
modelData
.
dirty
&&
!
breakpoint
.
verified
?
DebugEditorModelManager
.
BREAKPOINT_DIRTY_DECORATION
:
debugActive
&&
!
breakpoint
.
verified
?
DebugEditorModelManager
.
BREAKPOINT_UNVERIFIED_DECORATION
:
!
breakpoint
.
condition
?
DebugEditorModelManager
.
BREAKPOINT_DECORATION
:
null
;
!
breakpoint
.
condition
&&
!
breakpoint
.
hitCondition
?
DebugEditorModelManager
.
BREAKPOINT_DECORATION
:
null
;
if
(
result
&&
breakpoint
.
message
)
{
result
=
objects
.
clone
(
result
);
...
...
@@ -291,10 +293,14 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
return
result
;
}
if
(
!
session
||
session
.
configuration
.
capabilities
.
supportsConditionalBreakpoints
)
{
if
(
session
&&
!
session
.
configuration
.
capabilities
.
supportsConditionalBreakpoints
)
{
return
DebugEditorModelManager
.
BREAKPOINT_UNSUPPORTED_DECORATION
;
}
const
mode
=
modelData
?
modelData
.
model
.
getMode
()
:
null
;
const
modeId
=
mode
?
mode
.
getId
()
:
''
;
const
glyphMarginHoverMessage
=
`
\`\`\`
${
modeId
}
\n
${
breakpoint
.
condition
}
\`\`\`
`
;
const
condition
=
breakpoint
.
condition
?
breakpoint
.
condition
:
breakpoint
.
hitCondition
;
const
glyphMarginHoverMessage
=
`
\`\`\`
${
modeId
}
\n
${
condition
}
\`\`\`
`
;
return
{
glyphMarginClassName
:
'
debug-breakpoint-conditional-glyph
'
,
...
...
@@ -303,9 +309,6 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
};
}
return
DebugEditorModelManager
.
BREAKPOINT_UNSUPPORTED_DECORATION
;
}
// editor decorations
private
static
BREAKPOINT_DECORATION
:
editorcommon
.
IModelDecorationOptions
=
{
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
0e3e5bd8
...
...
@@ -130,6 +130,7 @@ export interface IRawBreakpoint {
lineNumber
:
number
;
enabled
?:
boolean
;
condition
?:
string
;
hitCondition
?:
string
;
}
export
interface
IBreakpoint
extends
IEnablement
{
...
...
@@ -137,6 +138,7 @@ export interface IBreakpoint extends IEnablement {
lineNumber
:
number
;
desiredLineNumber
:
number
;
condition
:
string
;
hitCondition
:
string
;
verified
:
boolean
;
idFromAdapter
:
number
;
message
:
string
;
...
...
@@ -146,6 +148,7 @@ export interface IFunctionBreakpoint extends IEnablement {
name
:
string
;
verified
:
boolean
;
idFromAdapter
:
number
;
hitCondition
:
string
;
}
export
interface
IExceptionBreakpoint
extends
IEnablement
{
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
0e3e5bd8
...
...
@@ -410,7 +410,8 @@ export class Breakpoint implements debug.IBreakpoint {
public
source
:
Source
,
public
desiredLineNumber
:
number
,
public
enabled
:
boolean
,
public
condition
:
string
public
condition
:
string
,
public
hitCondition
:
string
)
{
if
(
enabled
===
undefined
)
{
this
.
enabled
=
true
;
...
...
@@ -431,7 +432,7 @@ export class FunctionBreakpoint implements debug.IFunctionBreakpoint {
public
verified
:
boolean
;
public
idFromAdapter
:
number
;
constructor
(
public
name
:
string
,
public
enabled
:
boolean
)
{
constructor
(
public
name
:
string
,
public
enabled
:
boolean
,
public
hitCondition
:
string
)
{
this
.
verified
=
false
;
this
.
id
=
uuid
.
generateUuid
();
}
...
...
@@ -563,7 +564,7 @@ export class Model implements debug.IModel {
public
addBreakpoints
(
rawData
:
debug
.
IRawBreakpoint
[]):
void
{
this
.
breakpoints
=
this
.
breakpoints
.
concat
(
rawData
.
map
(
rawBp
=>
new
Breakpoint
(
new
Source
(
Source
.
toRawSource
(
rawBp
.
uri
,
this
)),
rawBp
.
lineNumber
,
rawBp
.
enabled
,
rawBp
.
condition
)));
new
Breakpoint
(
new
Source
(
Source
.
toRawSource
(
rawBp
.
uri
,
this
)),
rawBp
.
lineNumber
,
rawBp
.
enabled
,
rawBp
.
condition
,
rawBp
.
hitCondition
)));
this
.
breakpointsActivated
=
true
;
this
.
_onDidChangeBreakpoints
.
fire
();
}
...
...
@@ -612,17 +613,18 @@ export class Model implements debug.IModel {
}
public
addFunctionBreakpoint
(
functionName
:
string
):
void
{
this
.
functionBreakpoints
.
push
(
new
FunctionBreakpoint
(
functionName
,
true
));
this
.
functionBreakpoints
.
push
(
new
FunctionBreakpoint
(
functionName
,
true
,
null
));
this
.
_onDidChangeBreakpoints
.
fire
();
}
public
updateFunctionBreakpoints
(
data
:
{
[
id
:
string
]:
{
name
?:
string
,
verified
?:
boolean
;
id
?:
number
}
}):
void
{
public
updateFunctionBreakpoints
(
data
:
{
[
id
:
string
]:
{
name
?:
string
,
verified
?:
boolean
;
id
?:
number
;
hitCondition
?:
string
}
}):
void
{
this
.
functionBreakpoints
.
forEach
(
fbp
=>
{
const
fbpData
=
data
[
fbp
.
getId
()];
if
(
fbpData
)
{
fbp
.
name
=
fbpData
.
name
||
fbp
.
name
;
fbp
.
verified
=
fbpData
.
verified
;
fbp
.
idFromAdapter
=
fbpData
.
id
;
fbp
.
hitCondition
=
fbpData
.
hitCondition
;
}
});
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
0e3e5bd8
...
...
@@ -359,7 +359,7 @@ export class DebugService implements debug.IDebugService {
try
{
result
=
JSON
.
parse
(
this
.
storageService
.
get
(
DEBUG_BREAKPOINTS_KEY
,
StorageScope
.
WORKSPACE
,
'
[]
'
)).
map
((
breakpoint
:
any
)
=>
{
return
new
model
.
Breakpoint
(
new
Source
(
breakpoint
.
source
.
raw
?
breakpoint
.
source
.
raw
:
{
path
:
uri
.
parse
(
breakpoint
.
source
.
uri
).
fsPath
,
name
:
breakpoint
.
source
.
name
}),
breakpoint
.
desiredLineNumber
||
breakpoint
.
lineNumber
,
breakpoint
.
enabled
,
breakpoint
.
condition
);
breakpoint
.
desiredLineNumber
||
breakpoint
.
lineNumber
,
breakpoint
.
enabled
,
breakpoint
.
condition
,
breakpoint
.
hitCondition
);
});
}
catch
(
e
)
{
}
...
...
@@ -370,7 +370,7 @@ export class DebugService implements debug.IDebugService {
let
result
:
debug
.
IFunctionBreakpoint
[];
try
{
result
=
JSON
.
parse
(
this
.
storageService
.
get
(
DEBUG_FUNCTION_BREAKPOINTS_KEY
,
StorageScope
.
WORKSPACE
,
'
[]
'
)).
map
((
fb
:
any
)
=>
{
return
new
model
.
FunctionBreakpoint
(
fb
.
name
,
fb
.
enabled
);
return
new
model
.
FunctionBreakpoint
(
fb
.
name
,
fb
.
enabled
,
fb
.
hitCondition
);
});
}
catch
(
e
)
{
}
...
...
@@ -1045,7 +1045,7 @@ export class DebugService implements debug.IDebugService {
return
this
.
session
.
setBreakpoints
({
source
:
rawSource
,
lines
:
breakpointsToSend
.
map
(
bp
=>
bp
.
desiredLineNumber
),
breakpoints
:
breakpointsToSend
.
map
(
bp
=>
({
line
:
bp
.
desiredLineNumber
,
condition
:
bp
.
condition
})),
breakpoints
:
breakpointsToSend
.
map
(
bp
=>
({
line
:
bp
.
desiredLineNumber
,
condition
:
bp
.
condition
,
hitCondition
:
bp
.
hitCondition
})),
sourceModified
}).
then
(
response
=>
{
if
(
!
response
||
!
response
.
body
)
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
0e3e5bd8
...
...
@@ -1190,8 +1190,8 @@ export class BreakpointsRenderer implements tree.IRenderer {
if
(
breakpoint
.
message
)
{
data
.
breakpoint
.
title
=
breakpoint
.
message
;
}
}
else
if
(
breakpoint
.
condition
)
{
data
.
breakpoint
.
title
=
breakpoint
.
condition
;
}
else
if
(
breakpoint
.
condition
||
breakpoint
.
hitCondition
)
{
data
.
breakpoint
.
title
=
breakpoint
.
condition
?
breakpoint
.
condition
:
breakpoint
.
hitCondition
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录