diff --git a/CHANGELOG.md b/CHANGELOG.md index 392ade3..2d00d54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,13 @@ ## 0.1.2 -Added `cwd` to initial configuration and configuration snippet. +* Fixed bug where the ERDB server was not killed when Vscode closed. +* Added `cwd` to initial configuration and configuration snippet. ## 0.1.1 -Added icon. +* Added icon. ## 0.1.0 -Initial release \ No newline at end of file +* Initial release \ No newline at end of file diff --git a/README.md b/README.md index 3e23f3d..e362fc0 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ Extension for the debugger [Embedded Rust Debugger (ERDB)](https://github.com/Bl ERDB is a rust debugger for embedded systems. It currently only works on Linux, and is only tested on a `STM32F411RETx` dev board. -| :warning: WARNING | -|:---------------------------| -| The ERDB server process is not stopped/killed when Vscode is closed. | - ## Features * Flash target. @@ -52,7 +48,6 @@ The MCU chip type that the debug target has. ## Known Issues -* The ERDB server process is not stopped when Vscode is closed. * The launch command does not build the program, therefore always build before debugging. * Only supports having one debug session. * All step buttons perform the same type of step operation, that is stepping a single machine code instruction. @@ -61,15 +56,16 @@ The MCU chip type that the debug target has. ### 0.1.2 -Fixed bug in `attach` and `launch` configuration. +* Fixed bug where the ERDB server was not killed when Vscode closed. +* Fixed bug in `attach` and `launch` configuration. ### 0.1.1 -Added icon. +* Added icon. ### 0.1.0 -Initial release +* Initial release ## License diff --git a/erdb/run-erdb.sh b/erdb/run-erdb.sh deleted file mode 100755 index 4d38a9b..0000000 --- a/erdb/run-erdb.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -erdb $* \ No newline at end of file diff --git a/package.json b/package.json index 8cad3ab..1446310 100644 --- a/package.json +++ b/package.json @@ -39,15 +39,6 @@ { "type": "ERDB", "label": "ERDB", - "linux": { - "program": "./erdb/run-erdb.sh" - }, - "args": [ - "-m", - "server", - "-v", - "info" - ], "languages": [ "rust" ], diff --git a/src/extension.ts b/src/extension.ts index eb42481..c3294d1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -62,7 +62,7 @@ class ErdbDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescriptor if (!this.erdbProcess) { console.log("Starting new server on port %d", session.configuration.port); - let erdbArgs = executable?.args; + let erdbArgs = ["-m", "server", "-v", "info"]; if (session?.configuration.port !== undefined) { erdbArgs?.push("--port", session?.configuration.port.toString()); } @@ -73,10 +73,11 @@ class ErdbDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescriptor // Start ERDB server this.erdbProcess = child_process.spawn( - executable?.command === undefined ? "" : executable?.command, + "erdb", erdbArgs, executable?.options, ); + console.log("process: ", this.erdbProcess); //Create output channel this.erdbChannel = vscode.window.createOutputChannel("ERDB"); @@ -144,9 +145,7 @@ class ErdbDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescriptor } dispose() { - if (this.erdbProcess) { - console.log("kill:", this.erdbProcess?.kill(1)); - this.erdbProcess = undefined; - } + console.log("kill:", this.erdbProcess?.kill(1)); + this.erdbProcess = undefined; } }