Skip to content

Commit

Permalink
Fixed some issues with tracking of the primary thread
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdp committed Mar 1, 2022
1 parent cb95738 commit ae4b8f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/adapters/DebugProtocolAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export class DebugProtocolAdapter {
});

this.socketDebugger.on('suspend', (data) => {
this.clearCache();
this.emit('suspend', data);
});

Expand Down
5 changes: 2 additions & 3 deletions src/debugProtocol/Debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,10 @@ export class Debugger {
}

public async threads() {
let result;
if (this.stopped) {
result = this.makeRequest<ThreadsResponse>(new SmartBuffer({ size: 12 }), COMMANDS.THREADS);
let result = await this.makeRequest<ThreadsResponse>(new SmartBuffer({ size: 12 }), COMMANDS.THREADS);
if (result.errorCode === ERROR_CODES.OK) {
for (let i = 0; i < result.threadCount; i++) {
for (let i = 0; i < result.threadsCount; i++) {
let thread = result.threads[i];
if (thread.isPrimary) {
this.primaryThread = i;
Expand Down

0 comments on commit ae4b8f8

Please sign in to comment.