Visual C ++调试器可视化? [英] Visual C++ debugger visualizer?

查看:218
本文介绍了Visual C ++调试器可视化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio如何在C ++中显示向量的元素或字符串的字符?

How does Visual Studio show the elements of a vector, or the characters of a string, in C++? Is there a way for me to make it show my own classes in a custom way?

推荐答案

http://msdn.microsoft.com/en-us/library/zf0e8s14(v = VS.100).aspx


对于本机代码,您可以将自定义数据类型扩展添加到文件
autoexp.dat,它位于Program Files \ Microsoft Visual
Studio 10.0 \Common7 \Packages\Debugger目录中。

For native code, you can add custom data type expansions to the file autoexp.dat, which is located in the Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger directory. Instructions on how to write autoexp rules are located in the file itself.

对于这个类:

template<class T>
struct  auto_array {
     T* data;
     int Len;
};

autoexp.data可能如下所示:

the autoexp.data might look like:

auto_array<*> {
    children
    (
        #array
        (
            expr :      $e.Data[$i],
            size :      $e.Len
        )
    )
    preview
    (
        #(
            "[", $e.Len , "](",
            #array
            (
                expr :  $e.Data[$i],
                size :  $e.Len
            ),
            ")"
        )
    )
}

KindDragon 报告Visual Studio 2012使用了一种新的文件格式: natvis

KindDragon reports that Visual Studio 2012 uses a new file format: natvis

这篇关于Visual C ++调试器可视化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆