Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
97f7bdd6
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,发现更多精彩内容 >>
提交
97f7bdd6
编写于
5月 16, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: allow to set focussed thread with no call stack
fixes #6214
上级
f2baddbf
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
19 addition
and
11 deletion
+19
-11
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+3
-2
src/vs/workbench/parts/debug/common/debugViewModel.ts
src/vs/workbench/parts/debug/common/debugViewModel.ts
+4
-2
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+10
-5
src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts
.../workbench/parts/debug/test/common/debugViewModel.test.ts
+2
-2
未找到文件。
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
97f7bdd6
...
...
@@ -134,13 +134,14 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
private
createCallStackDecorations
(
modelUrlStr
:
string
):
editorcommon
.
IModelDeltaDecoration
[]
{
const
result
:
editorcommon
.
IModelDeltaDecoration
[]
=
[];
const
focusedStackFrame
=
this
.
debugService
.
getViewModel
().
getFocusedStackFrame
();
const
focusedThreadId
=
this
.
debugService
.
getViewModel
().
getFocusedThreadId
();
const
allThreads
=
this
.
debugService
.
getModel
().
getThreads
();
if
(
!
focusedStackFrame
||
!
allThreads
[
focused
StackFrame
.
threadId
]
||
!
allThreads
[
focusedStackFrame
.
t
hreadId
].
getCachedCallStack
())
{
if
(
!
focusedStackFrame
||
!
allThreads
[
focused
ThreadId
]
||
!
allThreads
[
focusedT
hreadId
].
getCachedCallStack
())
{
return
result
;
}
// only show decorations for the currently focussed thread.
const
thread
=
allThreads
[
focused
StackFrame
.
t
hreadId
];
const
thread
=
allThreads
[
focused
T
hreadId
];
thread
.
getCachedCallStack
().
filter
(
sf
=>
sf
.
source
.
uri
.
toString
()
===
modelUrlStr
).
forEach
(
sf
=>
{
const
wholeLineRange
=
createRange
(
sf
.
lineNumber
,
sf
.
column
,
sf
.
lineNumber
,
Number
.
MAX_VALUE
);
...
...
src/vs/workbench/parts/debug/common/debugViewModel.ts
浏览文件 @
97f7bdd6
...
...
@@ -9,6 +9,7 @@ import debug = require('vs/workbench/parts/debug/common/debug');
export
class
ViewModel
implements
debug
.
IViewModel
{
private
focusedStackFrame
:
debug
.
IStackFrame
;
private
focusedThread
:
debug
.
IThread
;
private
selectedExpression
:
debug
.
IExpression
;
private
selectedFunctionBreakpoint
:
debug
.
IFunctionBreakpoint
;
private
_onDidFocusStackFrame
:
Emitter
<
debug
.
IStackFrame
>
;
...
...
@@ -31,8 +32,9 @@ export class ViewModel implements debug.IViewModel {
return
this
.
focusedStackFrame
;
}
public
setFocusedStackFrame
(
focusedStackFrame
:
debug
.
IStackFrame
):
void
{
public
setFocusedStackFrame
(
focusedStackFrame
:
debug
.
IStackFrame
,
focusedThread
:
debug
.
IThread
):
void
{
this
.
focusedStackFrame
=
focusedStackFrame
;
this
.
focusedThread
=
focusedThread
;
this
.
_onDidFocusStackFrame
.
fire
(
focusedStackFrame
);
}
...
...
@@ -41,7 +43,7 @@ export class ViewModel implements debug.IViewModel {
}
public
getFocusedThreadId
():
number
{
return
this
.
focused
StackFrame
?
this
.
focusedStackFrame
.
threadId
:
0
;
return
this
.
focused
Thread
?
this
.
focusedThread
.
threadId
:
0
;
}
public
getSelectedExpression
():
debug
.
IExpression
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
97f7bdd6
...
...
@@ -251,17 +251,18 @@ export class DebugService implements debug.IDebugService {
allThreadsStopped
:
event
.
body
.
allThreadsStopped
});
this
.
model
.
getThreads
()[
threadId
].
getCallStack
(
this
).
then
(
callStack
=>
{
const
thread
=
this
.
model
.
getThreads
()[
threadId
];
thread
.
getCallStack
(
this
).
then
(
callStack
=>
{
if
(
callStack
.
length
>
0
)
{
// focus first stack frame from top that has source location
const
stackFrameToFocus
=
arrays
.
first
(
callStack
,
sf
=>
sf
.
source
&&
sf
.
source
.
available
,
callStack
[
0
]);
this
.
setFocusedStackFrameAndEvaluate
(
stackFrameToFocus
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
setFocusedStackFrameAndEvaluate
(
stackFrameToFocus
,
thread
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
windowService
.
getWindow
().
focus
();
aria
.
alert
(
nls
.
localize
(
'
debuggingPaused
'
,
"
Debugging paused, reason {0}, {1} {2}
"
,
event
.
body
.
reason
,
stackFrameToFocus
.
source
?
stackFrameToFocus
.
source
.
name
:
''
,
stackFrameToFocus
.
lineNumber
));
return
this
.
openOrRevealSource
(
stackFrameToFocus
.
source
,
stackFrameToFocus
.
lineNumber
,
false
,
false
);
}
else
{
this
.
setFocusedStackFrameAndEvaluate
(
null
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
setFocusedStackFrameAndEvaluate
(
null
,
thread
).
done
(
null
,
errors
.
onUnexpectedError
);
}
});
},
errors
.
onUnexpectedError
);
...
...
@@ -394,8 +395,12 @@ export class DebugService implements debug.IDebugService {
return
!!
this
.
contextService
.
getWorkspace
();
}
public
setFocusedStackFrameAndEvaluate
(
focusedStackFrame
:
debug
.
IStackFrame
):
TPromise
<
void
>
{
this
.
viewModel
.
setFocusedStackFrame
(
focusedStackFrame
);
public
setFocusedStackFrameAndEvaluate
(
focusedStackFrame
:
debug
.
IStackFrame
,
thread
?:
debug
.
IThread
):
TPromise
<
void
>
{
if
(
!
thread
&&
focusedStackFrame
)
{
thread
=
this
.
model
.
getThreads
()[
focusedStackFrame
.
threadId
];
}
this
.
viewModel
.
setFocusedStackFrame
(
focusedStackFrame
,
thread
);
if
(
focusedStackFrame
)
{
return
this
.
model
.
evaluateWatchExpressions
(
this
.
session
,
focusedStackFrame
);
}
else
{
...
...
src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts
浏览文件 @
97f7bdd6
...
...
@@ -5,7 +5,7 @@
import
assert
=
require
(
'
assert
'
);
import
{
ViewModel
}
from
'
vs/workbench/parts/debug/common/debugViewModel
'
;
import
{
StackFrame
,
Expression
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
StackFrame
,
Expression
,
Thread
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
suite
(
'
Debug - View Model
'
,
()
=>
{
var
model
:
ViewModel
;
...
...
@@ -22,7 +22,7 @@ suite('Debug - View Model', () => {
assert
.
equal
(
model
.
getFocusedStackFrame
(),
null
);
assert
.
equal
(
model
.
getFocusedThreadId
(),
0
);
const
frame
=
new
StackFrame
(
1
,
1
,
null
,
'
app.js
'
,
1
,
1
);
model
.
setFocusedStackFrame
(
frame
);
model
.
setFocusedStackFrame
(
frame
,
new
Thread
(
'
myThread
'
,
1
)
);
assert
.
equal
(
model
.
getFocusedStackFrame
(),
frame
);
assert
.
equal
(
model
.
getFocusedThreadId
(),
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录