Jump to content
  • Advertisement
Sign in to follow this  
Trandafira

[Debugging] Viewing variables in binary

This topic is 3717 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, so I've been doing alot of binary math lately in code and it gets annoying having to look at HEX and DEC numbers. I was wondering if anybody knows a way to display variables when debugging in visual studio ('05/'08) in binary. I can't seem to find anything in VS except the command debug.SetRadix(..) which only takes 10 or 16 as valid input. Maybe an add-in adds this functionality? If you've found something that does, please let me know :) Thanks Jonathan

Share this post


Link to post
Share on other sites
Advertisement
I suppose you could create a dummy integer wrapper structure, include it in your autoexp.dat and write a debug presentation DLL which prints it in binary. Then add a watchpoint which casts the integer you want to display to this type.

Okay, not remotely practical but that's honestly the only way I can think of. It's a nice trick for fixed point classes and the like though. Personally I keep a binary-capable calculator handy instead, plus interpreting hex numbers doesn't take as much mental effort as it once used to.

Oh and don't forget that you can add a ",x" suffix to watchpoints to display individual variables in hexadecimal.

Share this post


Link to post
Share on other sites
Personally when I was doing a lot with binary, hexadecimal became basically the same thing, it was maybe a .13 second delay between seeing the hexadecimal and knowing the binary. Actually it was much easier when working with large numbers to use hexadecimal representations

Share this post


Link to post
Share on other sites
Cheers for the responses guys.

@Portmanteau: You make a valid point and I too am getting used to Hex.

@implicit: Hmm.. I might get the binary calc out as well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!