From bcab0be35a9e6f96f9259d04c7c6e383cc262a40 Mon Sep 17 00:00:00 2001 From: Graham Bates Date: Sat, 18 Nov 2023 21:40:40 +0000 Subject: [PATCH] ignore output messages for request --- src/debugSession.ts | 7 ------- src/gdbClient.ts | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/debugSession.ts b/src/debugSession.ts index 321c0e4..34bd7b3 100644 --- a/src/debugSession.ts +++ b/src/debugSession.ts @@ -129,7 +129,6 @@ export class UAEDebugSession extends LoggingDebugSession { protected trace = false; protected stopOnEntry = false; protected exceptionMask = defaultArgs.exceptionMask; - protected awaitingStopOnEntry = false; protected breakpoints?: BreakpointManager; protected variables?: VariableManager; @@ -159,10 +158,6 @@ export class UAEDebugSession extends LoggingDebugSession { const mutex = new Mutex(); this.gdb.on("stop", (haltStatus) => { - if (this.awaitingStopOnEntry) { - this.awaitingStopOnEntry = false; - return; - } mutex.runExclusive(async () => { return this.handleStop(haltStatus).catch((err) => { logger.error(this.errorString(err)); @@ -348,8 +343,6 @@ export class UAEDebugSession extends LoggingDebugSession { if (args.stopOnEntry) { logger.log("[LAUNCH] Stopping on entry"); - // Tell the standard stop hander to ignore - this.awaitingStopOnEntry = true; await this.gdb.stepIn(Threads.CPU); this.sendStoppedEvent(Threads.CPU, "entry"); } diff --git a/src/gdbClient.ts b/src/gdbClient.ts index d40677b..73f0465 100644 --- a/src/gdbClient.ts +++ b/src/gdbClient.ts @@ -312,8 +312,8 @@ export class GdbClient { clearTimeout(timeout); reject(new GdbError(message)); } else if ( - !expectedResponse || - message.startsWith(expectedResponse) + !message.match(/^O[0-9a-f]/i) && // Ignore output + (!expectedResponse || message.startsWith(expectedResponse)) ) { this.responseCallback = undefined; clearTimeout(timeout);