Skip to content

Commit

Permalink
Incorproate coreclr-debug into omnisharp extension
Browse files Browse the repository at this point in the history
1. Adds coreclr-debug.ts to implement coreclr-debug acquisition and hooks
   it into omnisharp's activation handler
2. Adds the coreclr-debug directory containing the project.json,
   NuGet.config and dummy.cs required dotnet restore/publish
3. Adds the debugger section to contributes in package.json
4. Adds .vscodeignore to exclude items not needed at runtime from being
   packaged

TODO:
1. Update project.json references
2. Update NuGet.config to not point to http://dbgnuget (switch to
   nuget.org once pacakges are published publicly)
3. Create some completion file that we can check for correct complete
   installation
4. Improve reporting status of acquisition to end user
  • Loading branch information
chuckries committed Feb 24, 2016
1 parent 2c938d0 commit 44fab69
Show file tree
Hide file tree
Showing 11 changed files with 547 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bin
node_modules
out

*.vsix
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "out"
"outDir": "${workspaceRoot}/out"
}
]
}
12 changes: 12 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/*.gitignore
tsconfig.json

src/**
**/*.map

.vscode/**

coreclr-debug/debugAdapters/**
coreclr-debug/bin/**
coreclr-debug/obj/**
coreclr-debug/project.lock.json
4 changes: 4 additions & 0 deletions coreclr-debug/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin
obj
project.lock.json
debugAdapters
11 changes: 11 additions & 0 deletions coreclr-debug/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- TODO: remove this before going public, we must publish to public feeds first -->
<add key="dbgnuget" value="http://dbgnuget/nuget" />
</packageSources>
</configuration>
13 changes: 13 additions & 0 deletions coreclr-debug/dummy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;

namespace Dummy
{
class Dummy
{
static void Main(string[] args) {
// empty boilerplate required by dotnet build/publish to emit an entry point
// The entrypoint created is dummy[.exe], which we rename to OpenDebugAD7[.exe]
// The generated entry point will then run OpenDebugAD7.dll for us
}
}
}
33 changes: 33 additions & 0 deletions coreclr-debug/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "dummy",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.VisualStudio.clrdbg": "14.0.25017-pb-2822693",
"Microsoft.VisualStudio.clrdbg.MIEngine": "14.0.30217-pb-1",
"Microsoft.VisualStudio.OpenDebugAD7": "1.0.20217-pb-1",
"NETStandard.Library": "1.0.0-rc3-23803",
"Newtonsoft.Json": "7.0.1",
"Microsoft.VisualStudio.Debugger.Interop.Portable": "1.0.1",
"System.Collections.Specialized": "4.0.1-rc3-23803",
"System.Collections.Immutable": "1.2.0-rc3-23803",
"System.Diagnostics.Process" : "4.1.0-rc3-23803",
"System.Diagnostics.StackTrace": "4.0.1-rc3-23803",
"System.Dynamic.Runtime": "4.0.11-rc3-23803",
"Microsoft.CSharp": "4.0.1-rc3-23803",
"System.Threading.Tasks.Dataflow": "4.6.0-rc3-23803",
"System.Threading.Thread": "4.0.0-rc3-23803",
"System.Xml.XDocument": "4.0.11-rc3-23803",
"System.Xml.XmlDocument": "4.0.1-rc3-23803",
"System.Xml.XmlSerializer": "4.0.11-rc3-23803",
"System.ComponentModel": "4.0.1-rc3-23803",
"System.ComponentModel.Annotations": "4.1.0-rc3-23803",
"System.ComponentModel.EventBasedAsync": "4.0.11-rc3-23803",
"System.Runtime.Serialization.Primitives": "4.1.0-rc3-23803",
"System.Net.Http": "4.0.1-rc3-23803"
},
"frameworks": {
"dnxcore50": { }
}
}
223 changes: 223 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"activationEvents": [
"onLanguage:csharp",
"onLanguage:fsharp",
"onCommand:o.restart",
"onCommand:o.pickProjectAndStart",
"onCommand:o.restore",
Expand Down Expand Up @@ -128,6 +129,228 @@
"language": "csharp",
"path": "./snippets/csharp.json"
}
],
"debuggers": [
{
"type": "coreclr",
"label": ".NET Core",
"enableBreakpointsFor": { "languageIds": [ "csharp", "fsharp" ] },

"program": "./coreclr-debug/debugAdapters/OpenDebugAD7",
"windows": {
"program": "./coreclr-debug/debugAdapters/OpenDebugAD7.exe"
},

"configurationAttributes": {
"launch": {
"required": [ "program", "cwd" ],
"properties": {
"program": {
"type": "string",
"description": "Path to the program (executable file) to launch. On Windows, a '.exe' suffix is appended if not specified already.",
"default": "${workspaceRoot}/bin/Debug/dnxcore50/<My-Project-Name>"
},
"cwd": {
"type": "string",
"description": "Path to the working directory of the program being debugged. Default is the current workspace.",
"default": "${workspaceRoot}"
},
"args": {
"type": "array",
"description": "Command line arguments passed to the program.",
"items": { "type": "string" },
"default": [ ]
},
"stopAtEntry": {
"type": "boolean",
"description": "If true, the debugger should stop at the entry point of the target.",
"default": false
},
"launchBrowser": {
"type": "object",
"description": "Describes options to launch a web browser as part of launch",
"default": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether web browser launch is enabled",
"default": true
},
"args": {
"type": "string",
"description": "The arguments to pass to the command to open the browser. Use ${auto-detect-url} to automatically use the address the server is listening to",
"default": "${auto-detect-url}"
},
"osx": {
"type": "object",
"description": "OSX-specific web launch configuration options",
"default": {
"command": "open"
},
"properties": {
"command": {
"type": "string",
"description": "The command to execute for launching the web browser",
"default": "open"
},
"args": {
"type": "string",
"description": "The arguments to pass to the command to open the browser. Use ${auto-detect-url} to automatically use the address the server is listening to",
"default": "${auto-detect-url}"
}
}
},
"linux": {
"type": "object",
"description": "Linux-specific web launch configuration options",
"default": {
"command": "xdg-open"
},
"properties": {
"command": {
"type": "string",
"description": "The command to execute for launching the web browser",
"default": "xdg-open"
},
"args": {
"type": "string",
"description": "The arguments to pass to the command to open the browser. Use ${auto-detect-url} to automatically use the address the server is listening to",
"default": "${auto-detect-url}"
}
}
},
"windows": {
"type": "object",
"description": "Windows-specific web launch configuration options",
"default": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"properties": {
"command": {
"type": "string",
"description": "The command to execute for launching the web browser",
"default": "cmd.exe"
},
"args": {
"type": "string",
"description": "The arguments to pass to the command to open the browser. Use ${auto-detect-url} to automatically use the address the server is listening to",
"default": "/C start ${auto-detect-url}"
}
}
}
}
},
"sourceFileMap": {
"type": "object",
"description": "Optional source file mappings passed to the debug engine.",
"default": { }
},
"justMyCode": {
"type": "boolean",
"description": "Optional flag to only show user code.",
"default": true
},
"symbolPath": {
"type": "array",
"description": "Array of directories to use to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to. Example: '[ \"/Volumes/symbols\" ]",
"items": { "type": "string" },
"default": [ ]
}
}
},
"attach": {
"required": [ ],
"properties": {
"processName": {
"type": "string",
"description": "",
"default": "The process name to attach to. If this is used, 'processId' should not be used."
},
"processId": {
"type": "integer",
"description": "The process id to attach to. If this is used, 'processName' should not be used.",
"default": ""
},
"sourceFileMap": {
"type": "object",
"description": "Optional source file mappings passed to the debug engine.",
"default": { }
},
"justMyCode": {
"type": "boolean",
"description": "Optional flag to only show user code.",
"default": true
},
"symbolPath": {
"type": "array",
"description": "Array of directories to use to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to. Example: '[ \"~/symbols\" ]",
"items": { "type": "string" },
"default": [ ]
}
}
}
},

"initialConfigurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/dnxcore50/<My-Project-Name>",
"args": [ ],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"sourceFileMap": { }
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/dnxcore50/<My-Project-Name>",
"args": [ ],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"sourceFileMap": { },
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processName": "<example>",
"sourceFileMap": { }
}
]
}
]
}
}
Loading

0 comments on commit 44fab69

Please sign in to comment.