|
@@ -31,10 +31,13 @@ export class DebugService implements IDebugger.IService {
|
|
this._session = session;
|
|
this._session = session;
|
|
|
|
|
|
this._session.eventMessage.connect((_, event) => {
|
|
this._session.eventMessage.connect((_, event) => {
|
|
|
|
+ console.log({ event });
|
|
if (event.event === 'stopped') {
|
|
if (event.event === 'stopped') {
|
|
this._threadStopped.add(event.body.threadId);
|
|
this._threadStopped.add(event.body.threadId);
|
|
|
|
+ void this.getFramesAllData();
|
|
} else if (event.event === 'continued') {
|
|
} else if (event.event === 'continued') {
|
|
this._threadStopped.delete(event.body.threadId);
|
|
this._threadStopped.delete(event.body.threadId);
|
|
|
|
+ this._model.clearLines.emit();
|
|
}
|
|
}
|
|
this._eventMessage.emit(event);
|
|
this._eventMessage.emit(event);
|
|
});
|
|
});
|
|
@@ -98,16 +101,7 @@ export class DebugService implements IDebugger.IService {
|
|
|
|
|
|
// this will change for after execute cell
|
|
// this will change for after execute cell
|
|
async launch(code: string): Promise<void> {
|
|
async launch(code: string): Promise<void> {
|
|
- let threadId: number = 1;
|
|
|
|
this.frames = [];
|
|
this.frames = [];
|
|
- this.session.eventMessage.connect((_, event: IDebugger.ISession.Event) => {
|
|
|
|
- const eventName = event.event;
|
|
|
|
- if (eventName === 'thread') {
|
|
|
|
- const msg = event as DebugProtocol.ThreadEvent;
|
|
|
|
- threadId = msg.body.threadId;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
const breakpoints: DebugProtocol.SourceBreakpoint[] = this.setBreakpoints();
|
|
const breakpoints: DebugProtocol.SourceBreakpoint[] = this.setBreakpoints();
|
|
const reply = await this.session.sendRequest('dumpCell', {
|
|
const reply = await this.session.sendRequest('dumpCell', {
|
|
code
|
|
code
|
|
@@ -122,7 +116,11 @@ export class DebugService implements IDebugger.IService {
|
|
|
|
|
|
this.session.client.kernel.requestExecute({ code });
|
|
this.session.client.kernel.requestExecute({ code });
|
|
|
|
|
|
- const stackFrames = await this.getFrames(threadId);
|
|
|
|
|
|
+ await this.getFramesAllData();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getFramesAllData = async () => {
|
|
|
|
+ const stackFrames = await this.getFrames(this.currentThread());
|
|
|
|
|
|
stackFrames.forEach(async (frame, index) => {
|
|
stackFrames.forEach(async (frame, index) => {
|
|
const scopes = await this.getScopes(frame);
|
|
const scopes = await this.getScopes(frame);
|
|
@@ -145,7 +143,7 @@ export class DebugService implements IDebugger.IService {
|
|
this._model.sidebar.callstack.model.currentFrameChanged.connect(
|
|
this._model.sidebar.callstack.model.currentFrameChanged.connect(
|
|
this.onChangeFrame
|
|
this.onChangeFrame
|
|
);
|
|
);
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
onChangeFrame = (_: Callstack.IModel, update: Callstack.IFrame) => {
|
|
onChangeFrame = (_: Callstack.IModel, update: Callstack.IFrame) => {
|
|
const frame = this.frames.find(ele => ele.id === update.id);
|
|
const frame = this.frames.find(ele => ele.id === update.id);
|