Skip to content

Commit 18c350b

Browse files
Merge pull request #919 from OmniSharp/master
Implement support for using pipeTransport with attach (#918)
2 parents 6512e58 + 58c5b8d commit 18c350b

File tree

3 files changed

+432
-56
lines changed

3 files changed

+432
-56
lines changed

package.json

Lines changed: 173 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
"onCommand:dotnet.restore",
253253
"onCommand:csharp.downloadDebugger",
254254
"onCommand:csharp.listProcess",
255+
"onCommand:csharp.listRemoteProcess",
255256
"workspaceContains:project.json"
256257
],
257258
"contributes": {
@@ -359,6 +360,11 @@
359360
"command": "csharp.listProcess",
360361
"title": "List process for attach",
361362
"category": "CSharp"
363+
},
364+
{
365+
"command" : "csharp.listRemoteProcess",
366+
"title" : "List processes on remote connection for attach",
367+
"category": "CSharp"
362368
}
363369
],
364370
"keybindings": [
@@ -402,7 +408,8 @@
402408
"runtime": "node",
403409
"runtimeArgs": [],
404410
"variables": {
405-
"pickProcess": "csharp.listProcess"
411+
"pickProcess": "csharp.listProcess",
412+
"pickRemoteProcess": "csharp.listRemoteProcess"
406413
},
407414
"program": "./out/src/coreclr-debug/proxy.js",
408415
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
@@ -611,7 +618,8 @@
611618
"default": {
612619
"pipeCwd": "${workspaceRoot}",
613620
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
614-
"pipeArgs": []
621+
"pipeArgs": [],
622+
"debuggerPath" : "enter the path for the debugger on the target machine, for example ~/clrdbg/clrdbg"
615623
},
616624
"properties": {
617625
"pipeCwd": {
@@ -632,6 +640,11 @@
632640
},
633641
"default": []
634642
},
643+
"debuggerPath" : {
644+
"type" : "string",
645+
"description" : "The full path to the debugger on the target machine.",
646+
"default" : "~/clrdbg/clrdbg"
647+
},
635648
"pipeEnv": {
636649
"type": "object",
637650
"additionalProperties": {
@@ -844,6 +857,163 @@
844857
"default": false
845858
}
846859
}
860+
},
861+
"pipeTransport": {
862+
"type": "object",
863+
"required": [
864+
"debuggerPath"
865+
],
866+
"description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the .NET Core debugger backend executable (clrdbg).",
867+
"default": {
868+
"pipeCwd": "${workspaceRoot}",
869+
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
870+
"pipeArgs": [],
871+
"debuggerPath" : "enter the path for the debugger, for example ~/clrdbg/clrdbg"
872+
},
873+
"properties": {
874+
"pipeCwd": {
875+
"type": "string",
876+
"description": "The fully qualified path to the working directory for the pipe program.",
877+
"default": "${workspaceRoot}"
878+
},
879+
"pipeProgram": {
880+
"type": "string",
881+
"description": "The fully qualified pipe command to execute.",
882+
"default": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'"
883+
},
884+
"pipeArgs": {
885+
"type": "array",
886+
"description": "Command line arguments passed to the pipe program.",
887+
"items": {
888+
"type": "string"
889+
},
890+
"default": []
891+
},
892+
"debuggerPath" : {
893+
"type" : "string",
894+
"description" : "The full path to the debugger on the target machine.",
895+
"default" : "~/clrdbg/clrdbg"
896+
},
897+
"pipeEnv": {
898+
"type": "object",
899+
"additionalProperties": {
900+
"type": "string"
901+
},
902+
"description": "Environment variables passed to the pipe program.",
903+
"default": {}
904+
},
905+
"windows": {
906+
"type": "object",
907+
"description": "Windows-specific pipe launch configuration options",
908+
"default": {
909+
"pipeCwd": "${workspaceRoot}",
910+
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
911+
"pipeArgs": []
912+
},
913+
"properties": {
914+
"pipeCwd": {
915+
"type": "string",
916+
"description": "The fully qualified path to the working directory for the pipe program.",
917+
"default": "${workspaceRoot}"
918+
},
919+
"pipeProgram": {
920+
"type": "string",
921+
"description": "The fully qualified pipe command to execute.",
922+
"default": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'"
923+
},
924+
"pipeArgs": {
925+
"type": "array",
926+
"description": "Command line arguments passed to the pipe program.",
927+
"items": {
928+
"type": "string"
929+
},
930+
"default": []
931+
},
932+
"pipeEnv": {
933+
"type": "object",
934+
"additionalProperties": {
935+
"type": "string"
936+
},
937+
"description": "Environment variables passed to the pipe program.",
938+
"default": {}
939+
}
940+
}
941+
},
942+
"osx": {
943+
"type": "object",
944+
"description": "OSX-specific pipe launch configuration options",
945+
"default": {
946+
"pipeCwd": "${workspaceRoot}",
947+
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
948+
"pipeArgs": []
949+
},
950+
"properties": {
951+
"pipeCwd": {
952+
"type": "string",
953+
"description": "The fully qualified path to the working directory for the pipe program.",
954+
"default": "${workspaceRoot}"
955+
},
956+
"pipeProgram": {
957+
"type": "string",
958+
"description": "The fully qualified pipe command to execute.",
959+
"default": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'"
960+
},
961+
"pipeArgs": {
962+
"type": "array",
963+
"description": "Command line arguments passed to the pipe program.",
964+
"items": {
965+
"type": "string"
966+
},
967+
"default": []
968+
},
969+
"pipeEnv": {
970+
"type": "object",
971+
"additionalProperties": {
972+
"type": "string"
973+
},
974+
"description": "Environment variables passed to the pipe program.",
975+
"default": {}
976+
}
977+
}
978+
},
979+
"linux": {
980+
"type": "object",
981+
"description": "Linux-specific pipe launch configuration options",
982+
"default": {
983+
"pipeCwd": "${workspaceRoot}",
984+
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
985+
"pipeArgs": []
986+
},
987+
"properties": {
988+
"pipeCwd": {
989+
"type": "string",
990+
"description": "The fully qualified path to the working directory for the pipe program.",
991+
"default": "${workspaceRoot}"
992+
},
993+
"pipeProgram": {
994+
"type": "string",
995+
"description": "The fully qualified pipe command to execute.",
996+
"default": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'"
997+
},
998+
"pipeArgs": {
999+
"type": "array",
1000+
"description": "Command line arguments passed to the pipe program.",
1001+
"items": {
1002+
"type": "string"
1003+
},
1004+
"default": []
1005+
},
1006+
"pipeEnv": {
1007+
"type": "object",
1008+
"additionalProperties": {
1009+
"type": "string"
1010+
},
1011+
"description": "Environment variables passed to the pipe program.",
1012+
"default": {}
1013+
}
1014+
}
1015+
}
1016+
}
8471017
}
8481018
}
8491019
}
@@ -900,4 +1070,4 @@
9001070
}
9011071
]
9021072
}
903-
}
1073+
}

src/features/commands.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as path from 'path';
1414
import * as protocol from '../omnisharp/protocol';
1515
import * as vscode from 'vscode';
1616
import * as dotnetTest from './dotnetTest';
17-
import {DotNetAttachItemsProviderFactory, AttachPicker} from './processPicker';
17+
import {DotNetAttachItemsProviderFactory, AttachPicker, RemoteAttachPicker} from './processPicker';
1818
import {generateAssets} from '../assets';
1919

2020
let channel = vscode.window.createOutputChannel('.NET');
@@ -37,11 +37,11 @@ export default function registerCommands(server: OmniSharpServer, extensionPath:
3737
let attachItemsProvider = DotNetAttachItemsProviderFactory.Get();
3838
let attacher = new AttachPicker(attachItemsProvider);
3939
let d8 = vscode.commands.registerCommand('csharp.listProcess', () => attacher.ShowAttachEntries());
40-
4140
// Register command for generating tasks.json and launch.json assets.
4241
let d9 = vscode.commands.registerCommand('dotnet.generateAssets', () => generateAssets(server));
42+
let d10 = vscode.commands.registerCommand('csharp.listRemoteProcess', (args) => RemoteAttachPicker.ShowAttachEntries(args));
4343

44-
return vscode.Disposable.from(d1, d2, d3, d4, d5, d6, d7, d8, d9);
44+
return vscode.Disposable.from(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10);
4545
}
4646

4747
function restartOmniSharp(server: OmniSharpServer) {
@@ -186,4 +186,4 @@ function dotnetRestore(cwd: string, fileName?: string) {
186186
reject(err);
187187
});
188188
});
189-
}
189+
}

0 commit comments

Comments
 (0)