MCPcopy Create free account
hub / github.com/Marus/cortex-debug / quitEvent

Method quitEvent

src/gdb.ts:1838–1862  ·  view source on GitHub ↗
(type?: string, msg?: string)

Source from the content-addressed store, hash-verified

1836 }
1837
1838 protected quitEvent(type?: string, msg?: string) {
1839 this.quit = true;
1840 if (traceThreads) {
1841 this.handleMsg('log', '**** quit event\n');
1842 }
1843 if (msg && type) {
1844 this.handleMsg(type, msg);
1845 }
1846 if (this.server && this.server.isProcessRunning()) {
1847 // A gdb quit may be happening with VSCode asking us to finish or a crash or user doing something
1848 this.serverConsoleLog('quitEvent: Killing server');
1849 this.server.exit();
1850 }
1851 setTimeout(() => {
1852 // In case GDB quit because of normal processing, let that process finish. Wait for,\
1853 // a disconnect response to be sent before we send a TerminatedEvent();. Note that we could
1854 // also be here because the server crashed/quit on us before gdb-did
1855 try {
1856 this.sendEvent(new TerminatedEvent());
1857 this.serverConsoleLog('quitEvent: sending VSCode TerminatedEvent');
1858 }
1859 catch (e) {
1860 }
1861 }, 10);
1862 }
1863
1864 protected serverQuitEvent() {
1865 if (this.miDebugger.isRunning() && !this.quit) {

Callers 1

startGdbMethod · 0.95

Calls 5

handleMsgMethod · 0.95
serverConsoleLogMethod · 0.95
sendEventMethod · 0.95
isProcessRunningMethod · 0.80
exitMethod · 0.80

Tested by

no test coverage detected