Object Properties

Learn how to record complex user-defined object's properties

Estimated reading time: 2 mins

Last edited: 12 Feb 2020

RevDeBug by default records deltas of changes to complex objects (non-deterministic data). Data processed while object’s creation (ie inside constructor) is preserved as a usual sequential recording of executed source code. In case there is a need to record a custom or serialized content of object’s at points where it is referenced in source code or content for objects originated from external sources to RevDeBug instrumentation, you would need to define a RDBDisplay configuration.

Example - recording complex objects

The idea behind complex objects’ recording is very simple: you just need to call RevDeBug.Api.CrashRecorder.Api.ComplexObject on that object and all its properties will be automatically inspected and stored in the recording.

Here is an example made on our Demo application. In the MainWindow() of this application we will create a brush, and try to get it’s property value with the use of RevDeBug API.


public MainWindow()
  var converter = new BrushConverter();
  RdbRedBrush = (Brush)converter.ConvertFromString("#b01f1c");

To check, if this code worked, you can open it in Visual Studio with RevDeBug IDE Extension installed. If you run it, and open the recording, you should get a similar result: Value prompts - values overlayed on code

It is possible to control how a complex object would be serialized while being recorded by RevDeBug. It may be accomplished by attaching information about RevDeBug Display methods within the application. Each RevDeBug Display method should be parameterless, and it should return a string representation of complex object. There are no limitations for the contents of the returned string, although user should consider both space that might be required and real-time slot needed for processing and serialization. RevDebug Display method is executed each time an object is stored.

To attach RevDeBug Display method, user must create a new file with .rdbdisplay extension, that should be located in a .NET project. The easiest way to do this is by creating a new text file in a project, and then changing its name and extension. This file’s Build action must be set to AdditionalFiles. RdbDisplay file Each line within this file will should contain information about a single RevDeBug Display method. User must include type name with a full namespace path and name of a RevDeBug Display method that is separated with dash from type name: Starter.MainWindow-RdbString

RdbDisplay content

where MainWindow is a name of the type, Starter. is full namespace path that leads to the type and RdbString is the name of an parameterless method that returns a string.


namespace Starter
    public partial class MainWindow
        public Brush RdbRedBrush;
        public Brush RdbGrayBrush;

        public string RdbString()
            return $"{RdbRedBrush.ToString()} - {RdbGrayBrush.ToString()}";