Skip to content

Commit 7935b97

Browse files
authored
Update How To Debug MIEngine.md (#2935)
* Update How To Debug MIEngine.md Added information on how to debug with VS Code * Update How To Debug MIEngine.md * .dll -> .pdb Mistake on symbol list
1 parent bd6f8f0 commit 7935b97

File tree

1 file changed

+52
-15
lines changed

1 file changed

+52
-15
lines changed

Documentation/Debugger/How To Debug MIEngine.md

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ You can open the solution file **MIDebugEngine.sln** located under **src** and c
1515
* Microsoft.MIDebugEngine.dll
1616
* vscode\OpenDebugAD7.exe
1717
* vscode\Microsoft.DebugEngineHost.dll
18+
* vscode\Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.dll
1819

1920
The symbol files are as follows:
2021

2122
**On Windows**
2223
* Microsoft.MICore.pdb
23-
* Microsoft.MIDebugEngine.dll
24+
* Microsoft.MIDebugEngine.pdb
2425
* vscode\OpenDebugAD7.pdb
2526
* vscode\Microsoft.DebugEngineHost.pdb
2627

@@ -51,11 +52,13 @@ This will cause the debugger to look like it has hung once you start debugging,
5152

5253
### Debugging MIEngine running on Linux or Mac OS X
5354

55+
#### With MonoDevelop
56+
5457
On Linux and Mac OS X, we use `mono` as our framework. You can download Xamarin Studio v5.10.1.6 and remotely attach to your Mac or Linux box to debug there.
5558

56-
#### Install Prerequisites
57-
1. Install [GTK](http://www.mono-project.com/download/)
58-
2. Install [Xamarin Studio v5.10.1.6](http://download.xamarin.com/studio/Windows/XamarinStudio-5.10.1.6-0.msi)
59+
##### Install Prerequisites
60+
1. Install [GTK](http://www.mono-project.com/download/).
61+
2. Install [Xamarin Studio v5.10.1.6](http://download.xamarin.com/studio/Windows/XamarinStudio-5.10.1.6-0.msi).
5962

6063
Remote attach functionality behind a flag. You can run it like this:
6164
```PowerShell
@@ -64,26 +67,60 @@ set MONODEVELOP_SDB_TEST=1
6467
MonoDevelop.exe
6568
```
6669

67-
#### Create an empty project for attaching (one-time setup)
70+
##### Create an empty project for attaching (one-time setup)
6871

69-
1. Launch MonoDevelop
70-
2. File -> New Solution
71-
3. Misc/Generic Project
72-
4. Name project and hit "Create"
73-
5. Right-click the project node (blue square) and do "Options"
72+
1. Launch MonoDevelop.
73+
2. File -> New Solution.
74+
3. Misc/Generic Project.
75+
4. Name project and hit "Create".
76+
5. Right-click the project node (blue square) and do "Options".
7477
6. Under Run -> Custom Commands, select "Execute" in the lower dropdown and choose a command (I use `c:\windows\notepad.exe` - it doesn't matter what the command is, but MonoDevelop requires it to exist before it'll light up the Run menu).
7578

76-
#### Configure the extension to enable remote debugging
79+
##### Configure the extension to enable remote debugging
7780

7881
Open the **~/.vscode/extensions/ms-vscode.cpptools-\<version\>/debugAdapters/OpenDebugAD7** file with a text editor and locate and uncomment the line at the bottom. When you start debugging, it will now hang until the remote debugger is attached from Xamarin Studio.
7982

80-
#### Attach the remote debugger
83+
##### Attach the remote debugger
8184

82-
In MonoDevelop: Run -> Run With -> Custom Command Mono Soft Debugger
83-
Fill in the IP and port of the Linux/Mac OS X machine and hit "Connect" to start debugging
85+
In MonoDevelop: Run -> Run With -> Custom Command Mono Soft Debugger.
86+
Fill in the IP and port of the Linux/Mac OS X machine and hit "Connect" to start debugging.
8487

8588
After you've done this once, you can hit the MonoDevelop "Play" button or <kbd>F5</kbd> to bring up the connect dialog again.
8689

87-
Note: If you are debugging to CentOS, you will need to make an exception in the firewall
90+
#### With VS Code + Mono Debug
91+
92+
##### Install Prerequisites
93+
1. Install [VS Code](https://code.visualstudio.com/Download).
94+
2. Install Mono Debug extension for VS Code.
95+
96+
##### Create an empty project (one-time setup)
97+
1. Open to a new folder and create `.vscode/launch.json`.
98+
2. Create the following configuration in launch.json.
99+
```
100+
{
101+
"version": "0.2.0",
102+
"configurations": [
103+
{
104+
"name": "Attach to Mono",
105+
"request": "attach",
106+
"type": "mono",
107+
"address": "<INSERT_MACHINE_IP_ADDRESS_HERE>",
108+
"port": 1234
109+
}
110+
]
111+
}
112+
```
113+
114+
##### Configure the extension to enable remote debugging
115+
116+
Open the **~/.vscode/extensions/ms-vscode.cpptools-\<version\>/debugAdapters/OpenDebugAD7** file with a text editor and locate and uncomment the line at the bottom. When you start debugging, it will now hang until the remote debugger is attached from VS Code.
117+
118+
##### Attach the remote debugger
119+
120+
Selet the `Attach to Mono` configuration and hit F5.
121+
122+
#### Additional Notes
123+
124+
Note: If you are debugging to CentOS, you will need to make an exception in the firewall.
88125
* `sudo firewall-cmd --zone=public --add-port=1234/tcp --permanent`
89126
* `sudo firewall-cmd --reload`

0 commit comments

Comments
 (0)