RevDebug

Displaying search results for .

Whitelist - selective recording

Selective recording - choose which parts of code you want to record with RevDeBug

By default, RevDeBug parses and processes all available code within project. This behavior is
undesirable in some scenarios, in which user wants to analyze only small fraction of code base.
In this case we can use RevDeBug Whitelist, a small set of attributes that can alter the way RevDeBug
Compiler processes code.
In RevDeBug Whitelist mode, user must explicitly select what should be processed using RevDeBug
compiler. In other words, all available code within project, besides whitelisted elements, is skipped

Enabling whitelist mode

To enable RevDeBug Whitelist, you must add to your project a reference to RevDeBug.Config library.
This library is stored within RevDeBug Compiler and can be easily accessed via Visual Studio
RevDeBug menu (RevDeBug > Advanced > Open RevDeBug Compiler directory).

010_openRDBCCdirectory.png

Depending on your preferences either add reference to existing file within compiler directory, or
copy this file to another location and add reference to your project from it. RevDeBug.Config.dll
provides access to RevDeBug.Config.Filter namespace, in which there are two attributes defined:

  • EnableWhitelistAttribute – this is an assembly wide attribute, which enables RevDeBug Whitelist,
  • WhitelistAttribute – this attribute can be used on declared types and methods (including properties
    and methods).

To enable RevDeBug Whitelist, you must declare EnableWhitelist attribute within your project. The
best place to do this is AssemblyInfo.cs created automatically by Visual Studio. If you can’t find it,
check your project’s Properties node in Solution Explorer view.
Add this line of code, for example, at the end of the file:

[assembly: RevDeBug.Config.Filter.EnableWhitelist]

, as shown below:

010_whitelist1.png

Whitelisting elements

To whitelist an element you have to use Whitelist attribute. You can add it to any type or method
declarator you like. Whitelisting is inheritable, so if you whitelist a class, then all its methods and
nested types will be whitelisted too.

010_whitelist2.png

After completing all selected places in the source code, do not forget to compile the project using
RevDeBug then run application to receive states.

Disabling Whitelist mode

To temporarily turn off Whitelist mode just comment or remove previously added RevDeBug
attributes and recompile project.
To completely remove Whitelist mode follow three steps:

  • Remove RevDeBug.Config.dll from project References
  • Delete line associated with RevDeBug from AssemblyInfo project file
  • Comment or remove all Whitelist attributes from classes and methods

Compile project using RevDeBug to save all states or without to get regular output file.

Didn't find answer to your problem? Contact us at
support@revdebug.com