Skip to content

Commit

Permalink
Merge pull request #27 from rogalmic/experimentalWin10support
Browse files Browse the repository at this point in the history
Experimental win10support
  • Loading branch information
rogalmic authored Feb 25, 2017
2 parents f926e1c + 0249f27 commit 350b9a9
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.0.6
=====
## [Bugfix release v0.0.6](https://github.com/rogalmic/vscode-bash-debug/releases/tag/v0.0.6-alpha.6)
- fix for watch feature (https://github.com/rogalmic/vscode-bash-debug/issues/26)
- bashdb installation explained (https://github.com/rogalmic/vscode-bash-debug/issues/18)

0.0.5
=====
## [Feature release v0.0.5](https://github.com/rogalmic/vscode-bash-debug/releases/tag/v0.0.5-alpha.5)
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
# VS Code Bash Debug
A bash debugger GUI frontend based on awesome bashdb scripts.

**Install bashdb** before usage:
* [apt](https://en.wikipedia.org/wiki/Advanced_Packaging_Tool) package manager
```{r, engine='bash'}
sudo apt-get install bashdb
```
* [yum](https://en.wikipedia.org/wiki/Yellowdog_Updater,_Modified) package manager
```{r, engine='bash'}
sudo yum install bashdb
```
* installation from sources (advanced):
```{r, engine='bash'}
tar -xvf bashdb-*.tar.gz
cd bashdb-*
./configure
make
sudo make install
```
* verification
```{r, engine='bash'}
bashdb --version
```

Helpful links:

[https://en.wikipedia.org/wiki/Bash_(Unix_shell)](https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bash-debug",
"displayName": "Bash Debug",
"version": "0.0.5",
"version": "0.0.6",
"publisher": "rogalmic",
"description": "A debugger extension for bash scripts (using bashdb).",
"author": {
Expand Down
11 changes: 9 additions & 2 deletions src/bashDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class BashDebugSession extends DebugSession {
{
frameSourcePath = this.getWindowsPathFromLinux(frameSourcePath);
}

frames.push(new StackFrame(
frameIndex,
frameText,
Expand Down Expand Up @@ -449,6 +449,13 @@ class BashDebugSession extends DebugSession {

protected evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): void {

if (this.debuggerProcess == null){
response.body = { result: `${args.expression} = ''`, variablesReference: 0 };
this.debuggerExecutableBusy = false;
this.sendResponse(response);
return;
}

if (this.debuggerExecutableBusy)
{
this.scheduleExecution(()=> this.evaluateRequest(response, args));
Expand Down Expand Up @@ -518,7 +525,7 @@ class BashDebugSession extends DebugSession {
setTimeout(() => callback(), this.responsivityFactor);
}
}

private getWindowsPathFromLinux(linuxPath:string) : string {
return linuxPath.substr("/mnt/".length, 1).toUpperCase() + ":" + linuxPath.substr("/mnt/".length + 1).split("/").join("\\");
}
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export function activate(context: vscode.ExtensionContext) {
for (var i = 0 ; i < uris.length ; i++){
list.push(uris[i].fsPath);
}
return vscode.window.showQuickPick(list);
return vscode.window.showQuickPick(list).then((result)=>{
return (process.platform == "win32") ? "/mnt/" + result.substr(0, 1).toLowerCase() + result.substr("X:".length).split("\\").join("/") : result;
});
});
}));

Expand Down

0 comments on commit 350b9a9

Please sign in to comment.