RevDebug

Displaying search results for .

Whitelist - selective recording

Choose which parts of code you want to record with RevDeBug

By default, RevDeBug parses and processes all available code within project. Whitelist allows you to choose praticular parts of your code. This means - if you enable whitelisting, anything that is not whitelisted, will not be recorded.

Enabling whitelist mode

To enable RevDeBug Whitelist, you must add to your project a reference to RevDeBug.Config library. You can find it by opening RevDeBug Compiler directory. It is easly accessed through RevDeBug Menu (RevDeBug > Advanced > Open RevDeBug Compiler directory).


009_menu_compiler_folder.png

RevDeBug.Config.dll provides access to RevDeBug.Config.Filter namespace, in which there are two attributes defined:

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

To enable RevDeBug Whitelist, you must first declare EnableWhitelist attribute within your project. The best place to do this is AssemblyInfo.cs created automatically by Visual Studio. You can find it in your project’s Properties node in Solution Explorer view.

009_assembly_info.png

Add this line of code, at the end of the file:

[assembly: RevDeBug.Config.Filter.EnableWhitelist]

010_whitelist1.png

Now you can add Whitelist attribute to any type or method declarator you want. Just write this line above something you want to whitelist:

[RevDeBug.Config.Filter.Whitelist]

Whitelisting elements

Whitelisting is inheritable, so if you whitelist a class, then all its methods and nested types will be whitelisted too.

010_whitelist2.png

Do not forget to compile the project using RevDeBug and run it to receive desirable states.

Disabling Whitelist mode

To temporarily disable Whitelist mode, just comment or remove previously added RevDeBug attributes and recompile your project.

To completely remove Whitelist mode, follow these four 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 record all states, or without to get regular output file

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