Skip to content

Commit

Permalink
Update steps in debugging instruction of CLR (#43557)
Browse files Browse the repository at this point in the history
* Update CLR debugging instruction steps.

* Use suggested BCL path

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>

* Mention the usage cases of CORE_LIBRARIES.

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
  • Loading branch information
huoyaoyuan and janvorli authored Oct 21, 2020
1 parent c9d3d3e commit 5143a05
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/workflow/debugging/coreclr/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ Debugging CoreCLR on Windows
7. Set Command Arguments=`<managed app you wish to run>` (e.g. HelloWorld.dll)
8. Set Working Directory=`$(SolutionDir)\..\..\..\bin\coreclr\Windows_NT.$(Platform).$(Configuration)`
1. This points to the folder containing CoreCLR binaries.
9. Press F11 to start debugging at wmain in corerun (or set a breakpoint in source and press F5 to run to it)
9. Set Environment=`CORE_LIBRARIES=$(SolutionDir)\..\..\..\bin\runtime\<current tfm>-Windows_NT-$(Configuration)-$(Platform)`,
where '\<current tfm\>' is the target framework of current branch, for example `netcoreapp3.1` `net5.0`.
1. This points to the folder containing core libraries except `System.Private.CoreLib`.
2. This step can be skipped if you are debugging CLR tests that references only `System.Private.CoreLib`.
Otherwise, it's required to debug a realworld application that references anything else, including `System.Runtime`.
10. Right-click the INSTALL project and choose 'Build'
1. This will load necessary information from cmake to Visual Studio.
11. Press F11 to start debugging at wmain in corerun (or set a breakpoint in source and press F5 to run to it)
1. As an example, set a breakpoint for the EEStartup function in ceemain.cpp to break into CoreCLR startup.

Steps 1-8 only need to be done once, and then (9) can be repeated whenever you want to start debugging. The above can be done with Visual Studio 2013.
Steps 1-10 only need to be done once, and then (11) can be repeated whenever you want to start debugging. The above can be done with Visual Studio 2019 as writing.
Keeping with latest version of Visual Studio is recommended.

### Using SOS with windbg or cdb on Windows ###

Expand Down

0 comments on commit 5143a05

Please sign in to comment.