Automate nested variable dump in VS2015 debugger

时间:2016-08-31 12:34:21

标签: c++ debugging visual-studio-2015 automation heap-dump

Currently I'm looking into a 'minidump with heap'. I would like to write a unit test reproducing the crash, but therefore I need the data that lead to the crash.

Using the Visual Studio debugger, I can 'watch' the offending data structures, but they are quite big (>10k objects) and complex (using lists of lists of...) and I would love to dump these data into some readable format somehow.

The structure looks like this

struct Bottom {
   int x, y, z;
};
struct Mid {
    std::list<Bottom> bottoms;
};
struct Top {
    std::list<Mid> mids;
};

Is there a way I can write a macro/extension/... to extract e.g. all x, y, z data from the heap dump?

Is there another debugger that can accomplish this?

1 个答案:

答案 0 :(得分:1)

实际上你可以在VS调试器Watch窗口中查看数据结构,但它很复杂。如果是这样,一个想法就是你可以创建custom view of native objects,这样即使使用相同的调试Watch窗口你也可以轻松查看它。