Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b2b465bb
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,发现更多精彩内容 >>
提交
b2b465bb
编写于
10月 20, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: add a process to model as soon as created
上级
b3592d3a
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
24 addition
and
20 deletion
+24
-20
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+10
-9
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+3
-2
src/vs/workbench/parts/debug/test/node/debugModel.test.ts
src/vs/workbench/parts/debug/test/node/debugModel.test.ts
+10
-8
未找到文件。
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
b2b465bb
...
...
@@ -31,7 +31,7 @@ export const DEBUG_SCHEME = 'debug';
export
interface
IRawModelUpdate
{
threadId
:
number
;
rawSession
:
ISession
&
ITreeElement
;
sessionId
:
string
;
thread
?:
DebugProtocol
.
Thread
;
callStack
?:
DebugProtocol
.
StackFrame
[];
stoppedDetails
?:
IRawStoppedDetails
;
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
b2b465bb
...
...
@@ -644,6 +644,10 @@ export class Model implements debug.IModel {
return
this
.
processes
;
}
public
addProcess
(
session
:
debug
.
ISession
&
debug
.
ITreeElement
):
void
{
this
.
processes
.
push
(
new
Process
(
session
));
}
public
removeProcess
(
id
:
string
):
void
{
this
.
processes
=
this
.
processes
.
filter
(
p
=>
p
.
getId
()
!==
id
);
this
.
_onDidChangeCallStack
.
fire
();
...
...
@@ -666,18 +670,15 @@ export class Model implements debug.IModel {
}
public
rawUpdate
(
data
:
debug
.
IRawModelUpdate
):
void
{
let
process
=
this
.
processes
.
filter
(
p
=>
p
.
getId
()
===
data
.
rawSession
.
getId
()).
pop
();
if
(
!
process
)
{
process
=
new
Process
(
data
.
rawSession
);
this
.
processes
.
push
(
process
);
}
let
process
=
this
.
processes
.
filter
(
p
=>
p
.
getId
()
===
data
.
sessionId
).
pop
();
if
(
process
)
{
process
.
rawUpdate
(
data
);
this
.
_onDidChangeCallStack
.
fire
();
}
}
public
clearThreads
(
processI
d
:
string
,
removeThreads
:
boolean
,
reference
:
number
=
undefined
):
void
{
const
process
=
this
.
processes
.
filter
(
p
=>
p
.
getId
()
===
processI
d
).
pop
();
public
clearThreads
(
i
d
:
string
,
removeThreads
:
boolean
,
reference
:
number
=
undefined
):
void
{
const
process
=
this
.
processes
.
filter
(
p
=>
p
.
getId
()
===
i
d
).
pop
();
if
(
process
)
{
process
.
clearThreads
(
removeThreads
,
reference
);
this
.
_onDidChangeCallStack
.
fire
();
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
b2b465bb
...
...
@@ -260,7 +260,7 @@ export class DebugService implements debug.IDebugService {
this
.
getThreadData
(
session
).
done
(()
=>
{
this
.
model
.
rawUpdate
({
rawSession
:
session
,
sessionId
:
session
.
getId
()
,
threadId
,
stoppedDetails
:
event
.
body
,
allThreadsStopped
:
event
.
body
.
allThreadsStopped
...
...
@@ -351,7 +351,7 @@ export class DebugService implements debug.IDebugService {
private
getThreadData
(
session
:
RawDebugSession
):
TPromise
<
void
>
{
return
session
.
threads
().
then
(
response
=>
{
if
(
response
&&
response
.
body
&&
response
.
body
.
threads
)
{
response
.
body
.
threads
.
forEach
(
thread
=>
this
.
model
.
rawUpdate
({
rawSession
:
session
,
threadId
:
thread
.
id
,
thread
}));
response
.
body
.
threads
.
forEach
(
thread
=>
this
.
model
.
rawUpdate
({
sessionId
:
session
.
getId
()
,
threadId
:
thread
.
id
,
thread
}));
}
});
}
...
...
@@ -605,6 +605,7 @@ export class DebugService implements debug.IDebugService {
}
const
session
=
this
.
instantiationService
.
createInstance
(
RawDebugSession
,
configuration
.
debugServer
,
this
.
configurationManager
.
adapter
,
this
.
customTelemetryService
);
this
.
model
.
addProcess
(
session
);
this
.
toDisposeOnSessionEnd
[
session
.
getId
()]
=
[];
if
(
client
)
{
this
.
toDisposeOnSessionEnd
[
session
.
getId
()].
push
(
client
);
...
...
src/vs/workbench/parts/debug/test/node/debugModel.test.ts
浏览文件 @
b2b465bb
...
...
@@ -81,8 +81,9 @@ suite('Debug - Model', () => {
var
threadId
=
1
;
var
threadName
=
'
firstThread
'
;
model
.
addProcess
(
rawSession
);
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
threadId
,
thread
:
{
id
:
threadId
,
...
...
@@ -107,8 +108,9 @@ suite('Debug - Model', () => {
const
stoppedReason
=
'
breakpoint
'
;
// Add the threads
model
.
addProcess
(
rawSession
);
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
threadId1
,
thread
:
{
id
:
threadId1
,
...
...
@@ -117,7 +119,7 @@ suite('Debug - Model', () => {
});
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
threadId2
,
thread
:
{
id
:
threadId2
,
...
...
@@ -127,7 +129,7 @@ suite('Debug - Model', () => {
// Stopped event with all threads stopped
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
threadId1
,
stoppedDetails
:
{
reason
:
stoppedReason
,
...
...
@@ -196,10 +198,10 @@ suite('Debug - Model', () => {
const
runningThreadId
=
2
;
const
runningThreadName
=
'
runningThread
'
;
const
stoppedReason
=
'
breakpoint
'
;
model
.
addProcess
(
rawSession
);
// Add the threads
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
stoppedThreadId
,
thread
:
{
id
:
stoppedThreadId
,
...
...
@@ -208,7 +210,7 @@ suite('Debug - Model', () => {
});
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
runningThreadId
,
thread
:
{
id
:
runningThreadId
,
...
...
@@ -218,7 +220,7 @@ suite('Debug - Model', () => {
// Stopped event with only one thread stopped
model
.
rawUpdate
({
rawSession
,
sessionId
:
rawSession
.
getId
()
,
threadId
:
stoppedThreadId
,
stoppedDetails
:
{
reason
:
stoppedReason
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录