[runtime] Coverage profiler fixes (#5698)
[mono.git] / tools / checker / README.md
1 This directory contains supporting code and tools for Mono AST checker analysis.
2
3 This tool uses [CppSharp](https://github.com/mono/CppSharp) to read the source code of Mono
4 into an AST. It is a work-in-progress and in development.
5
6 Right now the tool is OSX-specific but should easily work on other OS's provided you
7 compile the dependencies for your platform. Contact @tritao if you need assistance.
8
9 It relies on the presence of a compile_commands.json file which is a JSON compilation
10 database. I have provided a sample database generated by using [Bear](https://github.com/rizsotto/Bear)
11 on my machine.
12
13 ## Building
14
15 First you'll need to build the tool by running `make`.
16
17 It will first clone the needed CppSharp binaries from the [CppSharpBinaries](https://github.com/tritao/CppSharpBinaries)
18 repository and then build the tool which should look like this:
19
20 ```
21 mac:mono joao$ make
22 mcs MonoChecker.cs -r:CppSharp/CppSharp.dll -r:CppSharp/CppSharp.AST.dll -r:CppSharp/CppSharp.Parser.CSharp.dll -r:CppSharp/CppSharp.Generator.dll -r:Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.dll
23 ```
24
25 ## Debugging
26
27 For easier debugging we can generate a Xamarin Studio project by running `make gen-proj`.
28
29 If everything works correctly, you should get an output like:
30
31 ```
32 mac:aot joao$ make gen-proj
33 CppSharp/premake5 vs2012
34 Building configurations...
35 Running action 'vs2012'...
36 Generating MonoChecker.sln...
37 Generating MonoChecker.csproj...
38 Generating MonoChecker.csproj.user...
39 Done.
40 ```
41
42 Then just load the solution in Xamarin Studio and you should be able to put breakpoints
43 and debug the code.