Visual Studio 调试器 - 以十六进制显示整数值
我正在使用 Visual Studio 2008,我刚刚注意到当我将鼠标悬停在变量上以及立即窗口中时,调试器将整数值显示为十六进制。我想我一定是不小心按下了快捷键或者什么的。
有人以前有过这个吗?如何将其设置回以十进制显示?
I'm using Visual Studio 2008 and I have just noticed that the debugger is displaying integer values as Hex when I hover over variables and also in the immediate window. I guess I must have hit a shortcut key accidently or something.
Anyone had this before? How do I set it back to display in decimal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
右键单击您的监视窗口或立即窗口并取消选中“十六进制显示”选项。
Right-click your Watch Window or Immediate Window and uncheck Hexadecimal Display option.
您还可以通过向变量附加调试器格式说明符,在 Visual Studio 监视窗口中为每个变量选择十六进制或十进制显示姓名。在监视窗口中,输入:
其他非常有用的格式说明符是用于“始终计算”的
ac
(参见脚注)和用于显示“无引号”的nq
。它们可以一起使用:nq
在DebuggerDisplay
属性中很有用,它可以出现在类上:...或类内的一个或多个字段上:
http://msdn.microsoft.com/en- us/library/e514eeby(v=VS.100).aspx
You can also choose hexadecimal or decimal display on a per-variable basis in the Visual Studio watch window by appending a debugger format specifier to the variable name. In the watch window, enter:
The other very useful format specifiers are
ac
(see footnote) for 'always calculate', andnq
for displaying with 'no quotes.' They can be used together:nq
is useful insideDebuggerDisplay
attributes, which can appear on a class:...or on one or more field(s) inside a class:
http://msdn.microsoft.com/en-us/library/e514eeby(v=VS.100).aspx
当 Visual Studio 在调试模式下运行时,会显示一个十六进制按钮以启用/禁用十六进制显示
There is a Hex button shown when Visual Studio is run in Debug mode to enable/disable the Hex display
右键单击几乎每个调试窗口的客户端空间(立即窗口除外) - watch/locals/autos/threads/call stack - 并取消选中“十六进制显示”选项。
调试时,调试工具栏中还有一个“Hex”按钮(默认情况下位于“Step Over”右侧)。
Right-click on client space of almost every debug window (except Immediate Window) - watch/locals/autos/threads/call stack - and uncheck "Hexadecimal Display" option.
There's also a "Hex" button in debug toolbar (right to "Step Over" by default) when debugging.
在 Visual Studio 2010 中,我还在“调试”工具栏中看到它,它以黄色“十六进制”突出显示,我只需单击它,它就会返回(正常)十进制值
In Visual Studio 2010 I also saw it in the Debug toolbar, it was highlighted in yellow 'Hex', I just clicked it and it returned to (normal) decimal values
视觉工作室 2017
十进制与十六进制显示只能通过“监视”对话框进行控制。
现在将以十进制显示。
Visual Studio 2017
Decimal vs. hexadecimal display is controlled only from the Watch dialog.
The display will now be in decimal.
在立即窗口中,您可以取消选中“十六进制显示”选项。
In the immediate window you can uncheck the Hexadecimal Display option.
Visual Studio 2022 17.8.3
更改十六进制显示模式的唯一可用选择是在“监视”窗口中。
必须执行断点,然后添加监视变量。然后可以关闭十六进制模式。
对于输出窗口没有通用的选择。
Visual Studio 2022 17.8.3
The only available selection for changing HEX display mode is in the Watch window.
Have to perform a breakpoint and then add a watch variable. Then the hexadecimal mode can be turned off.
There is no general selection for the output window for this.