如何在 visual studio 的 debug watch window 中获取变量的全部内容

How to get the entire content of a variable in the debug watch window of visual studio

如果我右键单击并复制,我只会得到一半文本:

-       text    0x00000000000f20d0 L"_BinRun.IMAGE_DOS_HEADER := \"\t\tWORD   e_magic;\n\t\tWORD   e_cblp;\n\t\tWORD   e_cp;\n\t\tWORD   e_crlc;\n\t\tWORD   e_cparhdr;\n\t\tWORD   e_minalloc;\n\t\tWORD   e_maxalloc;\n\t\tWORD   e_ss;\n\t\tWORD   e_sp;\n\t\tWORD   e_c...  wchar_t *

试图将整个内容作为文字字符串获取,包括 \"\t\t\n\ 等。 我在我的项目和 vstudio2019 中使用 c++。

你不能。该字符串太长,无法在调试器监视中直接显示 window。通过单击变量右侧的放大镜使用 String Visualizer。 That's what it's for 然后从那里复制它:

(强调我的)

While you are debugging in Visual Studio, you can view strings with the built-in string visualizer. The string visualizer shows strings that are too long for a data tip or debugger window.