A picture is worth 1000 words (or array elements!)
ArrayPlotter is a debugger visualisation tool that allows you to dynamically plot the contents of your C++/C# arrays and IEnumerables within the Visual Studio debugger.
This is an initial release with support for Visual Studio 2022 and its 64-bit environment. There will likely be bugs / compatibility issues
Plot C++ or C# array or IEnumerable contents into a zoomable/pannable chart. Supported datatypes:
float
double
unsigned/signed 8/16/32/64 bit integers
Handles complex number of above datatypes (can plot real / imaginary / magnitude / phase)
Handle interleaved datatypes via stride / offset
Plot independent X/Y data values for non-linear X
Auto Update feature will automatically plot array upon entering break mode
A history of array pointer expressions will be kept between invocations
The current plot can be held for comparison. Up to 3 plots can be held at once
ArrayPlotter windows are standard dockable/moveable Visual Studio window
Multiple ArrayPlotter windows can be opened at once
Chart colours (Axis / Series / Background) are customisable and will persist
Chart supports auto or manual x and y-scaling
Both array pointer and length expressions are supported, ie length can be a fixed integer or a variable with a constantly changing value. Pointer and numerical arithmetic can also be applied
How to Use
Set your breakpoint at desired location
Run your application and enter the breakpoint
If required, open an ArrayPlotter window from Debug->Windows->ArrayPlotter
Dock/move/resize the window to where you want it (Visual Studio will remember the location preferences like any other window)
In the Y: (Pointer Expression) box enter the array pointer:
For C# and C++ this is simply the pointer or array variable name
For C# IEnumerable types you must include .ToArray() in the pointer expression, ie floatEnumerable.ToArray()
For both you can perform pointer arithmetic, ie &cSharpArray[0]+20 means start at the 20th element
In the Length Expression box enter the length of the array as either:
An Integer, ie 1024
An expression, ie arrayLength, DATA_LENGTH, or even dataStruct.NumSamples
Also, numerical arithmetic can be performed, ie dataStruct.NumSamples/2 will plot half of the array
For IEnumerable types you can include .Count() method, ie floatEnumerable.Count()
From the Format drop down select the data type
From the Structure drop down select the data type.
Scalar - for simple contiguous arrays
Complex - for arrays of Complex values which are defined to be pairs of the same data type laid out in memory as <real1,imag1,real2,imag2,real3,imag3,...>. In this case you can select if you want to plot the Real, Imaginary or Amplitude components
Stride - for arrays of interleaved multi-channel data. For example to look at the right channel of stereo PCM audio enter an offset of 1 and stride of 2
Click Plot
To specify an array containing X-axis values, click Show X and repeat the above steps in the X: row
To zoom in on the chart press and hold left-mouse and select the desired zoom region and release. Double click to reset zoom. Alternatively the mousewheel can be used to zoom in/out on cursor location (Mousewheel VS2012+ only)
To pan, press and drag the middle-mouse button
If Auto Update is enabled, then any time debug mode is entered then the currently entered expression will be evaluated and re-plotted
A history of plotted arrays will be kept. To access previously plotted arrays, use the Y Pointer expression drop-down and select the desired array. To clear the history select Tools->ArrayPlotter
To change the chart colours, select Tools->ArrayPlotter
To hold the currently plot for comparison, click the hold toggle button (upper right). The currently plot will remain in the selected colour. To remove the held plot, toggle the button.
Release Notes
0.13
Initial support for Visual Studio 2022 and its 64-bit environment. Requires the use of Advanced Memory Access mode
To enable Advanced Memory Access mode:
Open Tools->Array Plotter
From the Memory Access dropdown, select Advanced
0.11
Includes an alternate method of reading process memory (Advanced) for improved compatibility in some situations
Memory access method (Simple|Advanced) is selectable via Tools->ArrayPlotter menu
Defaults to Simple on first run
Memory access method can be changed at any time without restart and setting persists across Visual Studio restarts
Fix bug where Complex array types only reading half the desired contents
0.11
Allows a user to enter a pointer address such as "0x0000023db216e21" into the "Y:
pointer expression text box
0.10
Add support for VS2019
Fix an issue where array length was incorrectly calculated with stride
0.9
Multiple plots (up to 3) are supported via a pinning mechanism
Support installation on Professional / Enterprise editions of Visual Studio 2012/13/15
0.8
Add support for VS2017
Updated to version 1.0.0.9 of wow64ext for improved 64-bit support on Windows 10