Skip to content

Commit

Permalink
[docs] Add LLDB debugging instructions for Mono running a runtime test (
Browse files Browse the repository at this point in the history
dotnet#60410)

* [docs] Add LLDB debugging instructions for Mono running a runtime test

* Also add a note about building a single test
  • Loading branch information
lambdageek authored Oct 14, 2021
1 parent cf49643 commit 10d8964
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/workflow/testing/mono/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ cd src/tests
./build.sh excludemonofailures <release|debug>
```

To build an individual test, test directory, or a whole subdirectory tree, use the `-test:`, `-dir:` or `-tree:` options (without the src/tests prefix)
For example: `./build.sh excludemonofailures release -test:JIT/opt/InstructionCombining/DivToMul.csproj`


Run individual test:
```
cd src/mono
Expand All @@ -32,6 +36,24 @@ cd src/mono
make run-tests-coreclr-all
```

To debug a single test with `lldb`:

1. Run the test at least once normally (or manually run the `mono.proj` `PatchCoreClrCoreRoot` target)
2. Edit the `.sh` file for the test and change the line
```
LAUNCHER="$_DebuggerFullPath "$CORE_ROOT/corerun" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" ${__DotEnvArg}"
```
to add `--` after the debugger full path
```
LAUNCHER="$_DebuggerFullPath -- "$CORE_ROOT/corerun" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" ${__DotEnvArg}"
```
3. Run the shell script for the test case manually:
```
bash ./artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh -coreroot=`pwd`/artifacts/tests/coreclr/OSX.x64.Release/Tests/Core_Root -debug=/usr/bin/lldb
```
4. In LLDB add the debug symbols for mono: `add-dsym <CORE_ROOT>/libcoreclr.dylib.dwarf`
5. Run/debug the test

### WebAssembly:
Build the runtime tests for WebAssembly
```
Expand Down

0 comments on commit 10d8964

Please sign in to comment.