MPFR C++ Debugger Visualizer in Visual Studio

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\.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00)
Loading...

6 Comments

  1. MichaelChou
    Posted December 28, 2011 at 4:47 pm | #

    bug report: the “DebugView” doesn’t update after these operations: ++, –, -=, +=, *=, /=, etc.

  2. Posted September 26, 2013 at 6:35 pm | #

    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)

    • Posted October 8, 2013 at 3:44 pm | #

      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) ;

      • Posted October 8, 2013 at 7:24 pm | #

        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.

Post a Reply to Pavel Holoborodko

Your email is never published nor shared.

Use native LaTeX syntax to include formulas: $ ... $, \[ ... \], etc. Do not forget to preview comment before posting.

Also you may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Subscribe without commenting