[variant] Visual Studio debug visualizers

I wrote a simple debug visualizer for boost::variant and I want to share it with community. boost::variant<*,*,*,*,*,*,*,*,*,*,*> { preview ( #( #switch($c.which_) #case 0 ( *($T1 *)&($c.storage_.data_) ) #case 1 ( *($T2 *)&($c.storage_.data_) ) #case 2 ( *($T3 *)&($c.storage_.data_) ) #case 3 ( *($T4 *)&($c.storage_.data_) ) #case 4 ( *($T5 *)&($c.storage_.data_) ) #case 5 ( *($T6 *)&($c.storage_.data_) ) #case 6 ( *($T7 *)&($c.storage_.data_) ) #case 7 ( *($T8 *)&($c.storage_.data_) ) #case 8 ( *($T9 *)&($c.storage_.data_) ) #case 9 ( *($T10 *)&($c.storage_.data_) ) ) ) children ( #( value: #switch($c.which_) #case 0 ( *($T1 *)&($c.storage_.data_) ) #case 1 ( *($T2 *)&($c.storage_.data_) ) #case 2 ( *($T3 *)&($c.storage_.data_) ) #case 3 ( *($T4 *)&($c.storage_.data_) ) #case 4 ( *($T5 *)&($c.storage_.data_) ) #case 5 ( *($T6 *)&($c.storage_.data_) ) #case 6 ( *($T7 *)&($c.storage_.data_) ) #case 7 ( *($T8 *)&($c.storage_.data_) ) #case 8 ( *($T9 *)&($c.storage_.data_) ) #case 9 ( *($T10 *)&($c.storage_.data_) ) ) ) }

AMDG Dmitry Vinogradov wrote:
I wrote a simple debug visualizer for boost::variant and I want to share it with community.
boost::variant<*,*,*,*,*,*,*,*,*,*,*> { preview ( #( #switch($c.which_) #case 0 ( *($T1 *)&($c.storage_.data_) ) <snip...> ) ) children ( #( value: #switch($c.which_) #case 0 ( *($T1 *)&($c.storage_.data_) ) <snip...> ) ) }
This is a great start. There are a few more things I'd like to see. * if which_ is negative it means that the variant is storing a pointer to an object of type T ## -(which_ + 1). * make_variant_over allows a variant to be created from a type sequence. * make_recursive variant causes the type of the variant itself to be substituted any instances of the placeholder boost::recursive_variant in the template arguments. The latter two are hard and may be impossible to support, but I would definitely like to see support for the first point. In Christ, Steven Watanabe

Steven Watanabe wrote:
AMDG
Dmitry Vinogradov wrote:
I wrote a simple debug visualizer for boost::variant and I want to share it with community.
boost::variant<*,*,*,*,*,*,*,*,*,*,*> { preview ( #( #switch($c.which_) #case 0 ( *($T1 *)&($c.storage_.data_) ) <snip...> ) ) children ( #( value: #switch($c.which_) #case 0 ( *($T1 *)&($c.storage_.data_) ) <snip...> ) ) }
This is a great start. There are a few more things I'd like to see. * if which_ is negative it means that the variant is storing a pointer to an object of type T ## -(which_ + 1).
Please tell me how to reproduce it. Does it for recursive_wrapper?
* make_variant_over allows a variant to be created from a type sequence. * make_recursive variant causes the type of the variant itself to be substituted any instances of the placeholder boost::recursive_variant in the template arguments.
The latter two are hard and may be impossible to support, but I would definitely like to see support for the first point.
I'll try it.

AMDG Dmitry Vinogradov wrote:
Steven Watanabe wrote:
This is a great start. There are a few more things I'd like to see. * if which_ is negative it means that the variant is storing a pointer to an object of type T ## -(which_ + 1).
Please tell me how to reproduce it. Does it for recursive_wrapper?
You can only get it if the copy constructor of one of the contained elements throws when a variant is assigned. See http://tinyurl.com/lh7bce In Christ, Steven Watanabe

"Dmitry Vinogradov" <sraider@yandex.ru> wrote in message news:h11b2r$ci1$1@ger.gmane.org...
I wrote a simple debug visualizer for boost::variant and I want to share it with community.
I searched for "visualizer" in the help system and what I found looks different (e.g. can only be used for managed C++). For which Visual Studio verision is this intended? How do I install this? Thanks Peter

AMDG Peter Foelsche wrote:
"Dmitry Vinogradov" <sraider@yandex.ru> wrote in message news:h11b2r$ci1$1@ger.gmane.org...
I wrote a simple debug visualizer for boost::variant and I want to share it with community.
I searched for "visualizer" in the help system and what I found looks different (e.g. can only be used for managed C++).
For which Visual Studio verision is this intended? How do I install this?
See https://svn.boost.org/trac/boost/wiki/DebuggerVisualizers In Christ, Steven Watanabe

Dmitry Vinogradov wrote:
I wrote a simple debug visualizer for boost::variant and I want to share it with community. ...
Second version: boost::variant<*,*,*,*,*,*,*,*,*,*,*> { preview ( #( #switch($e.which_) #case 0 ( *($T1 *)&($e.storage_.data_) ) #case 1 ( *($T2 *)&($e.storage_.data_) ) #case 2 ( *($T3 *)&($e.storage_.data_) ) #case 3 ( *($T4 *)&($e.storage_.data_) ) #case 4 ( *($T5 *)&($e.storage_.data_) ) #case 5 ( *($T6 *)&($e.storage_.data_) ) #case 6 ( *($T7 *)&($e.storage_.data_) ) #case 7 ( *($T8 *)&($e.storage_.data_) ) #case 8 ( *($T9 *)&($e.storage_.data_) ) #case 9 ( *($T10 *)&($e.storage_.data_) ) #case -1 ( *($T1 *)&($e.storage_.data_) ) #case -2 ( *($T2 *)&($e.storage_.data_) ) #case -3 ( *($T3 *)&($e.storage_.data_) ) #case -4 ( *($T4 *)&($e.storage_.data_) ) #case -5 ( *($T5 *)&($e.storage_.data_) ) #case -6 ( *($T6 *)&($e.storage_.data_) ) #case -7 ( *($T7 *)&($e.storage_.data_) ) #case -8 ( *($T8 *)&($e.storage_.data_) ) #case -9 ( *($T9 *)&($e.storage_.data_) ) #case -10 ( *($T10 *)&($e.storage_.data_) ) ) ) children ( #( [value] : #switch($e.which_) #case 0 ( *($T1 *)&($e.storage_.data_) ) #case 1 ( *($T2 *)&($e.storage_.data_) ) #case 2 ( *($T3 *)&($e.storage_.data_) ) #case 3 ( *($T4 *)&($e.storage_.data_) ) #case 4 ( *($T5 *)&($e.storage_.data_) ) #case 5 ( *($T6 *)&($e.storage_.data_) ) #case 6 ( *($T7 *)&($e.storage_.data_) ) #case 7 ( *($T8 *)&($e.storage_.data_) ) #case 8 ( *($T9 *)&($e.storage_.data_) ) #case 9 ( *($T10 *)&($e.storage_.data_) ) #case -1 ( *($T1 *)&($e.storage_.data_) ) #case -2 ( *($T2 *)&($e.storage_.data_) ) #case -3 ( *($T3 *)&($e.storage_.data_) ) #case -4 ( *($T4 *)&($e.storage_.data_) ) #case -5 ( *($T5 *)&($e.storage_.data_) ) #case -6 ( *($T6 *)&($e.storage_.data_) ) #case -7 ( *($T7 *)&($e.storage_.data_) ) #case -8 ( *($T8 *)&($e.storage_.data_) ) #case -9 ( *($T9 *)&($e.storage_.data_) ) #case -10 ( *($T10 *)&($e.storage_.data_) ), #([actual members] : [$e,!]) ) ) } boost::recursive_wrapper<*> { preview ([$e.p_]) children ( #( #([ptr] : $e.p_), #([actual members] : [$e,!]) ) ) }

Second version:
; [fixed] boost::variant<*,*,*,*,*,*,*,*,*,*,*> { preview ( #( #switch($e.which_) #case 0 ( *($T1 *)&($e.storage_.data_) ) #case 1 ( *($T2 *)&($e.storage_.data_) ) #case 2 ( *($T3 *)&($e.storage_.data_) ) #case 3 ( *($T4 *)&($e.storage_.data_) ) #case 4 ( *($T5 *)&($e.storage_.data_) ) #case 5 ( *($T6 *)&($e.storage_.data_) ) #case 6 ( *($T7 *)&($e.storage_.data_) ) #case 7 ( *($T8 *)&($e.storage_.data_) ) #case 8 ( *($T9 *)&($e.storage_.data_) ) #case 9 ( *($T10 *)&($e.storage_.data_) ) #case -1 ( **($T1 **)&($e.storage_.data_) ) #case -2 ( **($T2 **)&($e.storage_.data_) ) #case -3 ( **($T3 **)&($e.storage_.data_) ) #case -4 ( **($T4 **)&($e.storage_.data_) ) #case -5 ( **($T5 **)&($e.storage_.data_) ) #case -6 ( **($T6 **)&($e.storage_.data_) ) #case -7 ( **($T7 **)&($e.storage_.data_) ) #case -8 ( **($T8 **)&($e.storage_.data_) ) #case -9 ( **($T9 **)&($e.storage_.data_) ) #case -10 ( **($T10 **)&($e.storage_.data_) ) ) ) children ( #( [value] : #switch($e.which_) #case 0 ( *($T1 *)&($e.storage_.data_) ) #case 1 ( *($T2 *)&($e.storage_.data_) ) #case 2 ( *($T3 *)&($e.storage_.data_) ) #case 3 ( *($T4 *)&($e.storage_.data_) ) #case 4 ( *($T5 *)&($e.storage_.data_) ) #case 5 ( *($T6 *)&($e.storage_.data_) ) #case 6 ( *($T7 *)&($e.storage_.data_) ) #case 7 ( *($T8 *)&($e.storage_.data_) ) #case 8 ( *($T9 *)&($e.storage_.data_) ) #case 9 ( *($T10 *)&($e.storage_.data_) ) #case -1 ( **($T1 **)&($e.storage_.data_) ) #case -2 ( **($T2 **)&($e.storage_.data_) ) #case -3 ( **($T3 **)&($e.storage_.data_) ) #case -4 ( **($T4 **)&($e.storage_.data_) ) #case -5 ( **($T5 **)&($e.storage_.data_) ) #case -6 ( **($T6 **)&($e.storage_.data_) ) #case -7 ( **($T7 **)&($e.storage_.data_) ) #case -8 ( **($T8 **)&($e.storage_.data_) ) #case -9 ( **($T9 **)&($e.storage_.data_) ) #case -10 ( **($T10 **)&($e.storage_.data_) ), #([actual members] : [$e,!]) ) ) } boost::recursive_wrapper<*> { preview ([$e.p_]) children ( #( #([ptr] : $e.p_), #([actual members] : [$e,!]) ) ) }
participants (3)
-
Dmitry Vinogradov
-
Peter Foelsche
-
Steven Watanabe