Skip to content

Commit

Permalink
use stdout for normal gdb exit
Browse files Browse the repository at this point in the history
  • Loading branch information
haneefdm committed Dec 4, 2022
1 parent 49d40af commit 4c381ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/backend/mi2/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c381ef

Please sign in to comment.