Current version

v1.10.4 (stable)

Navigation

Main page
Archived news
Downloads
Documentation
   Capture
   Compiling
   Processing
   Crashes
Features
Filters
Plugin SDK
Knowledge base
Contact info
Forum
 
Other projects
   Altirra

Search

Archives

01 Dec - 31 Dec 2013
01 Oct - 31 Oct 2013
01 Aug - 31 Aug 2013
01 May - 31 May 2013
01 Mar - 31 Mar 2013
01 Feb - 29 Feb 2013
01 Dec - 31 Dec 2012
01 Nov - 30 Nov 2012
01 Oct - 31 Oct 2012
01 Sep - 30 Sep 2012
01 Aug - 31 Aug 2012
01 June - 30 June 2012
01 May - 31 May 2012
01 Apr - 30 Apr 2012
01 Dec - 31 Dec 2011
01 Nov - 30 Nov 2011
01 Oct - 31 Oct 2011
01 Sep - 30 Sep 2011
01 Aug - 31 Aug 2011
01 Jul - 31 Jul 2011
01 June - 30 June 2011
01 May - 31 May 2011
01 Apr - 30 Apr 2011
01 Mar - 31 Mar 2011
01 Feb - 29 Feb 2011
01 Jan - 31 Jan 2011
01 Dec - 31 Dec 2010
01 Nov - 30 Nov 2010
01 Oct - 31 Oct 2010
01 Sep - 30 Sep 2010
01 Aug - 31 Aug 2010
01 Jul - 31 Jul 2010
01 June - 30 June 2010
01 May - 31 May 2010
01 Apr - 30 Apr 2010
01 Mar - 31 Mar 2010
01 Feb - 29 Feb 2010
01 Jan - 31 Jan 2010
01 Dec - 31 Dec 2009
01 Nov - 30 Nov 2009
01 Oct - 31 Oct 2009
01 Sep - 30 Sep 2009
01 Aug - 31 Aug 2009
01 Jul - 31 Jul 2009
01 June - 30 June 2009
01 May - 31 May 2009
01 Apr - 30 Apr 2009
01 Mar - 31 Mar 2009
01 Feb - 29 Feb 2009
01 Jan - 31 Jan 2009
01 Dec - 31 Dec 2008
01 Nov - 30 Nov 2008
01 Oct - 31 Oct 2008
01 Sep - 30 Sep 2008
01 Aug - 31 Aug 2008
01 Jul - 31 Jul 2008
01 June - 30 June 2008
01 May - 31 May 2008
01 Apr - 30 Apr 2008
01 Mar - 31 Mar 2008
01 Feb - 29 Feb 2008
01 Jan - 31 Jan 2008
01 Dec - 31 Dec 2007
01 Nov - 30 Nov 2007
01 Oct - 31 Oct 2007
01 Sep - 30 Sep 2007
01 Aug - 31 Aug 2007
01 Jul - 31 Jul 2007
01 June - 30 June 2007
01 May - 31 May 2007
01 Apr - 30 Apr 2007
01 Mar - 31 Mar 2007
01 Feb - 29 Feb 2007
01 Jan - 31 Jan 2007
01 Dec - 31 Dec 2006
01 Nov - 30 Nov 2006
01 Oct - 31 Oct 2006
01 Sep - 30 Sep 2006
01 Aug - 31 Aug 2006
01 Jul - 31 Jul 2006
01 June - 30 June 2006
01 May - 31 May 2006
01 Apr - 30 Apr 2006
01 Mar - 31 Mar 2006
01 Feb - 29 Feb 2006
01 Jan - 31 Jan 2006
01 Dec - 31 Dec 2005
01 Nov - 30 Nov 2005
01 Oct - 31 Oct 2005
01 Sep - 30 Sep 2005
01 Aug - 31 Aug 2005
01 Jul - 31 Jul 2005
01 June - 30 June 2005
01 May - 31 May 2005
01 Apr - 30 Apr 2005
01 Mar - 31 Mar 2005
01 Feb - 29 Feb 2005
01 Jan - 31 Jan 2005
01 Dec - 31 Dec 2004
01 Nov - 30 Nov 2004
01 Oct - 31 Oct 2004
01 Sep - 30 Sep 2004
01 Aug - 31 Aug 2004

Stuff

Powered by Pivot  
XML: RSS feed 
XML: Atom feed 

§ How to fix debugger visualizers for VS2005 SP1 and VS2008

If you've written a bunch of custom visualizers for the Visual Studio debugger, you may have run into the problem lately of the preview() section of your visualizer causing the debugger to hang or crash, or simply displaying ... when used in nested visualizers. I tracked this down to a change that was snuck into VS2005 SP1 and which is also in VS2008 beta 2. It used to be the case that $c (container) and $e (element) were equivalent in the preview() block. This is no longer the case -- $c instead refers to the top level container. This means that you can run into problems if you have a nested setup like this:

A {
    preview($c.m)
}
B {
    preview($c.m)
}

Formerly, this would work fine with an object of type B which derives from A. In VS2005 SP1 / VS2008b2, this causes the debugger to crash, because instead of evaluating B::m and then A::m, it evaluates B::m over and over and then blows up. In visualizers where the fields of the nested type don't alias with the type that started the evaluation, you'll see ... instead as that's the debugger's way of signifying evaluation error.

In the cases that I've seen, replacing $c with $e within preview() fixes the problem.

I also have some additional tips that I've learned since writing the original blog entry:

Comments

Comments posted:


All I want is for it to not collapse every custom watch entry every time I step in the debugger. It makes any nontrivial visualization a hassle.

Glenn Maynard - 27 09 07 - 13:18


All I want is for Orcas to not crash all the time while I try to use the XAML editor. It's been 2 or 3 years since we first got a prototype of XAML editing in Visual Studio... and it still has update bugs and crashes all the time.

Trimbo (link) - 27 09 07 - 22:04


The Visualizer's code seems rather buggy. To spare anyone else the time I had to spend, note that:

The visualizer tends to fail if a class has a member named 'size' and simultaneously a member function 'int Size()'. Then calling '$c.size' in the visualizer gives corrupted values. Note that the member function even has a different case.
Arg!

Douglas Cameron - 29 03 08 - 12:18


Matrix 4x4 class:

template class Matrix44
{
public:
T x[4][4];

// omitted methods, no other data members are declared
}

Visualizer:

RTSG::Matrix44 {
stringview(
#(
"'",
[$e.x[0][0]], ['\t'], [$e.x[0][1]], ['\t'], [$e.x[0][2]], ['\t'], [$e.x[0][3]], ['\n'],
[$e.x[1][0]], ['\t'], [$e.x[1][1]], ['\t'], [$e.x[1][2]], ['\t'], [$e.x[1][3]], ['\n'],
[$e.x[2][0]], ['\t'], [$e.x[2][1]], ['\t'], [$e.x[2][2]], ['\t'], [$e.x[2][3]], ['\n'],
[$e.x[3][0]], ['\t'], [$e.x[3][1]], ['\t'], [$e.x[3][2]], ['\t'], [$e.x[3][3]], ['\n']
)
)
}

Use with text visualizer. Produces lot's of single quotes, but still readable. Much nicer than having 16 values in column.

Sergiy - 09 03 12 - 02:39

Comment form


Please keep comments on-topic for this entry. If you have unrelated comments about VirtualDub, the forum is a better place to post them.
Name:  
Remember personal info?

Email (Optional):
Your email address is only revealed to the blog owner and is not shown to the public.
URL (Optional):
Comment: /

An authentication dialog may appear when you click Post Comment. Simply type in "post" as the user and "now" as the password. I have had to do this to stop automated comment spam.



Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.