[Date_Time] Visual Studio 8 debugger visualizer
Hi, This is my second post in a mailing list and my first on boost-users so I apologize for the naive style and for my English (I am not a native English speaker). I would like to give a solution to a problem that kept annoying me for a long time when debugging code using Boost.Date_Time in Visual Studio 8. The library is based on an int representation of datetime and this int is displayed by the debugger, which gets hard to understand if it's the correct datetime or not. The solution, as already explained in http://www.virtualdub.org/blog/pivot/entry.php?id=120, is to customize Visual Studio debugger. I have found a solution in boost documentation section, provided by filip dot konvicka at logis dot cz, but you have to click refresh to get the info displayed. I thus suggest a partial brute force solution for boost::gregorian::date, boost::posix_time::time_duration and boost::posix_time::ptime (the only objects I use, but extension to local time zone should be easy). This solution simply recodes the conversion functions available in Boost.Date_Time, adding some formatting. I included it as an attachement because of the length of some lines is very long. As an example boost::posix_time::ptime a_time(boost::gregorian::date(2010, Apr, 7), boost::posix_time::hours(22)) would display instantaneously in the preview area in the debugger as a_time 2010-4-7 22h0m0s (0us) Note: us is microseconds. If you work with nanosecond resolution, you have to change the visualizer definition. In order to get it work, backup the file autoexp.dat (it's in the installation directory of Visual Studio), and add the content of the attachement in the [Visualizer] section. It should work without even restarting Visual Studio. I have only tested under Visual Studio 8 2005, but it should work as well with Visual Studio 9 2008. Hope that will help! Bruno Durin.
Hi,
I thus suggest a partial brute force solution for boost::gregorian::date, boost::posix_time::time_duration and boost::posix_time::ptime (the only objects I use, but extension to local time zone should be easy). This solution simply recodes the conversion functions available in Boost.Date_Time, adding some formatting. I included it as an attachement because of the length of some lines is very long.
Now that's cool. If you agree, I will add the usual headers to your file (so I need you to agree to make this available under the Boost license) and put it on the visualizers wiki page for everyone to download. Cheers, Filip
Filip Konvička
...
Now that's cool. If you agree, I will add the usual headers to your file (so I need you to agree to make this available under the Boost license) and put it on the visualizers wiki page for everyone to download.
Cheers, Filip
What is the url of visualizers wiki page? Thanks
On Apr 10, 2010, at 7:12 AM, Archie14 wrote:
What is the url of visualizers wiki page?
https://svn.boost.org/trac/boost/wiki/DebuggerVisualizers Ciao, Andreas
participants (4)
-
Archie14
-
boost
-
Bruno Durin
-
Filip Konvička