Some debug adapters will run custom DAP requests on session start, such as the cortex-debug extension here, and will break, as the session has not been initialized yet.
2022-11-24T13:19:18.818Z root ERROR [hosted-plugin: 30330] /Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:16423
if (this.serverController.customRequest(command, response, args)) {
^
TypeError: Cannot read properties of undefined (reading 'customRequest')
at GDBDebugSession.<anonymous> (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:16423:39)
at Generator.next (<anonymous>)
at /Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:15519:71
at new Promise (<anonymous>)
at __webpack_modules__../src/gdb.ts.__awaiter (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:15515:12)
at GDBDebugSession.customRequest (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:16418:16)
at GDBDebugSession.dispatchRequest (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:515:22)
at GDBDebugSession.dispatchRequest (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:1183:15)
at GDBDebugSession.handleMessage (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:1364:18)
at GDBDebugSession._handleData (/Users/a.kitta/dev/git/theia/plugins/cortex-debug/extension/dist/debugadapter.js:1458:34)
Bug Description:
As the title says, the debug-ext will incorrectly fire the
didStart
event, ondidCreate
and will call the debug adapter. It's too early.https://github.com/eclipse-theia/theia/blob/b58de21ca1a9371ffe8779919a174e85781cfe5a/packages/plugin-ext/src/plugin/debug/debug-ext.ts#L248-L253
Some debug adapters will run custom DAP requests on session start, such as the
cortex-debug
extension here, and will break, as the session has not beeninitialized
yet.Steps to Reproduce:
cortex-debug
VSIX from my fork: https://github.com/kittaakos/cortex-debug/raw/1.5.1/marus25.cortex-debug-1.5.1-development.vsixAdditional Information