开发者

Way in Visual Studio to display integers as bit array

开发者 https://www.devze.com 2022-12-17 23:50 出处:网络
Is there a way in Visual Studio, either through it\'s native features or a plugin, to show an integer/long/char variable in the debugger window as a bit array? For example, rather than seeing 开发者_如

Is there a way in Visual Studio, either through it's native features or a plugin, to show an integer/long/char variable in the debugger window as a bit array? For example, rather than seeing 开发者_如何学C5 or 0x5 I'd like to see 101. As a bonus feature I'd like to see them left-padded with the correct amount of zeroes, so that the total width of the field is equal to the actual amount of bits the type is.

(I know I can convert with calc.exe but that's a pain when debugging bit manipulations).


Here complete list of format specifiers but no bits there. http://msdn.microsoft.com/en-us/library/75w45ekt(VS.80).aspx

By the way, it is simple to convert hex (x format) or octal (o format) in mind. Just place before eyes simple table of octal or hex symbols. After the day you'll on fly convert 5A->1011010


If you're using managed C++ you can write a simple Visualizer just like the built-in ones for char* (to see the string as html, xml or the raw string).

Too bad it's not supported for native (I guess it's for security reasons)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号