Tutorial/Manual how to create Visualizer in autoexp.dat

百般思念 提交于 2019-12-12 07:09:34

问题


I have some C++ datatypes for which I would like to improve the debugging experience in my team. I therefore want to create a custom visualizer in the autoexp.dat file. The [AutoExpand] section doesn't seem sufficient, so I started to look at [Visualizer]. I found this website with some explanations, but is there any comprehensive reference/manual/tutorial? I don't get the difference between $c and $e, for example. I already succeeded in displaying some basic information, but I feel like there's so much more to know...

Do you know any good resource?

Thanks!


回答1:


Appears this is already commented above but someone coming to this question would not necessarily read the comments and so might miss the great tutorial available on the boost site:

https://svn.boost.org/trac/boost/wiki/DebuggerVisualizers

Also

http://mariusbancila.ro/blog/2007/04/06/tweaking-autoexpdat-for-custom-types-in-vs2005/

http://www.idigitalhouse.com/Blog/?p=83

http://www.chromium.org/developers/how-tos/how-to-set-up-visual-studio-debugger-visualizers

http://www.virtualdub.org/blog/pivot/entry.php?id=172




回答2:


Below is an example of visualizer for boost::tuple. It should be fairly easy to follow:

boost::tuples::tuple<*>{
    ; Show as (11, 22, 33, ... })
    preview (
        #(
            "("
            , $e.head
            , ", "
            , $e.tail.head
            , ", "
            , $e.tail.tail.head
            , ", "
            , $e.tail.tail.tail.head
            , ", "
            , $e.tail.tail.tail.tail.head
            , ", "
            , $e.tail.tail.tail.tail.tail.head
            , ", "
            , $e.tail.tail.tail.tail.tail.tail.head
            , ", "
            , $e.tail.tail.tail.tail.tail.tail.tail.head
            , ", "
            , $e.tail.tail.tail.tail.tail.tail.tail.tail.head
            , ", "
            , $e.tail.tail.tail.tail.tail.tail.tail.tail.tail.head
            , ")"
        )
    )   
    children (
        #(
            0: $e.head
            , 1: $e.tail.head
            , 2: $e.tail.tail.head
            , 3: $e.tail.tail.tail.head
            , 4: $e.tail.tail.tail.tail.head
            , 5: $e.tail.tail.tail.tail.tail.head
            , 6: $e.tail.tail.tail.tail.tail.tail.head
            , 7: $e.tail.tail.tail.tail.tail.tail.tail.head
            , 8: $e.tail.tail.tail.tail.tail.tail.tail.tail.head
            , 9: $e.tail.tail.tail.tail.tail.tail.tail.tail.tail.head
        )
    )
}


来源:https://stackoverflow.com/questions/4883238/tutorial-manual-how-to-create-visualizer-in-autoexp-dat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!