Built-in debugger in Visual Studio has very nice extension capabilities. One particularly useful feature – developer can create custom visualizers for his own complex data types. Usually interactive debugger just shows data members of user-defined (and unknown to him) classes and structures, e.g.:
Obviously this is not very handy. In example above mpreal
is arbitrary precision floating-point numeric type. It is only natural to show variables of the type as numbers, not as collection of low-level data pointers and properties.
Alexei Zubanov came up with neat idea on how to marry debugger with mpreal
numbers in simplest way possible. As a result of our joint efforts MPFR C++ and Visual Studio Debugger play together well now:
To enable this feature user needs latest version of MPFR C++.
Plus she should add following statement: mpfr::mpreal=<DebugView>
to the file autoexp.dat
, which is located in [Visual Studio Installation Folder]\Common7\Packages\Debugger\
.
6 Comments
bug report: the “DebugView” doesn’t update after these operations: ++, –, -=, +=, *=, /=, etc.
Indeed this is a bug. Thank you Michael, I’ll fix it asap.
Fixed along with many other improvements
how do I convert double to mpreal?
I want to use,for fun only,mpreal for a polygon clipper.
The input is in double format.(i.E. %lf format)
mpreal
has constructor and conversion operator for doubles. Such conversion should be transparent. Do you have any particular problem?Example:
double x = 10.0;
mpreal y = x;
mpreal z(x) ;
I have threatened MPFR++ and it works with my vs2012 program.It was so sweet.I just substituted mpreal for double and had the program sing.Only it is lazy and x50 to X100 slower. I am exploring that now.The visualiser will be very handl. My input numbers ,were only double.
I understand that to input long precision numbers I may have to read them as strings first.! and then get a mpreal
Thank for the C++ interface…very good…
I had to remove grandom as it was NOT present in the mpfr binaries i had got and I am in NO mood to compile new binaries.