Skip to content

Commit

Permalink
Merge pull request #3 from Blinningjr/stop-erdb-server-properly
Browse files Browse the repository at this point in the history
Fixed problem with `ERDB` server not stopping
  • Loading branch information
Blinningjr authored Oct 4, 2022
2 parents d932052 + cb07692 commit e7fa084
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 28 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
* Initial release
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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

Expand Down
2 changes: 0 additions & 2 deletions erdb/run-erdb.sh

This file was deleted.

9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@
{
"type": "ERDB",
"label": "ERDB",
"linux": {
"program": "./erdb/run-erdb.sh"
},
"args": [
"-m",
"server",
"-v",
"info"
],
"languages": [
"rust"
],
Expand Down
11 changes: 5 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -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");
Expand Down Expand Up @@ -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;
}
}

0 comments on commit e7fa084

Please sign in to comment.