From 4c381ef057fabe83b74b41eb870365891eef51db Mon Sep 17 00:00:00 2001 From: Haneef Mohammed Date: Sun, 4 Dec 2022 11:26:19 -0800 Subject: [PATCH] use stdout for normal gdb exit --- src/backend/mi2/mi2.ts | 2 +- src/gdb.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 4bfbabb1..a8dbf958 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -179,7 +179,7 @@ export class MI2 extends EventEmitter implements IBackend { const sigstr = signal ? `, signal: ${signal}` : ''; const how = this.exiting ? '' : ((code || signal) ? ' unexpectedly' : ''); const msg = `GDB session ended${how}. exit-code: ${codestr}${sigstr}\n`; - this.emit('quit', msg); + this.emit('quit', how ? 'stderr' : 'stdout', msg); } } diff --git a/src/gdb.ts b/src/gdb.ts index b88ec16b..cbd36b78 100755 --- a/src/gdb.ts +++ b/src/gdb.ts @@ -1742,13 +1742,13 @@ export class GDBDebugSession extends LoggingDebugSession { } } - protected quitEvent(msg?: string) { + protected quitEvent(type?: string, msg?: string) { this.quit = true; if (traceThreads) { this.handleMsg('log', '**** quit event\n'); } - if (msg) { - this.handleMsg('stderr', msg); + if (msg && type) { + this.handleMsg(type, msg); } if (this.server && this.server.isProcessRunning()) { // A gdb quit may be happening with VSCode asking us to finish or a crash or user doing something