Skip to content

Commit 6703469

Browse files
committed
src/debugAdapter: revert cl/253578
There were some issues caused by not sending a stopped event to the client every time that the continue callback was called. This change reverts the logic to skip calling handleReenterDebug in order to get back to a state where the debugger issues stopped events every time. This should fix issues with the debugger appearing to be running when it is stopped. Updates #149, #172, and #759 Change-Id: I70aae05bc3bf50499b046594a43d972ec01091cf Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/262257 Run-TryBot: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Trust: Suzy Mueller <suzmue@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
1 parent d2fbb62 commit 6703469

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/debugAdapter/goDebug.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,26 +2274,21 @@ export class GoDebugSession extends LoggingDebugSession {
22742274
log('continue state', state);
22752275
this.debugState = state;
22762276

2277-
// Check if the current thread was stopped on a breakpoint.
2278-
// Other stopping events (eg pause) create their own StoppedEvents,
2279-
// if necessary.
2277+
let reason = 'breakpoint';
2278+
// Check if the current thread was stopped on 'panic' or 'fatal error'.
22802279
if (!!state.currentThread && !!state.currentThread.breakPoint) {
22812280
const bp = state.currentThread.breakPoint;
22822281
if (bp.id === unrecoveredPanicID) {
22832282
// If the breakpoint is actually caused by a panic,
22842283
// we want to return on "panic".
2285-
this.handleReenterDebug('panic');
2284+
reason = 'panic';
22862285
} else if (bp.id === fatalThrowID) {
22872286
// If the breakpoint is actually caused by a fatal throw,
22882287
// we want to return on "fatal error".
2289-
this.handleReenterDebug('fatal error');
2290-
} else {
2291-
this.handleReenterDebug('breakpoint');
2288+
reason = 'fatal error';
22922289
}
2293-
} else if (state.exited) {
2294-
// Notify the client if the program has exited.
2295-
this.handleReenterDebug('');
22962290
}
2291+
this.handleReenterDebug(reason);
22972292
};
22982293

22992294
// If called when setting breakpoint internally, we want the error to bubble up.

0 commit comments

Comments
 (0)