Java 中按位运算调试工具
我继承了一个使用和滥用按位运算的库。到目前为止,我已经开发了一种方法来打印此类按位运算中使用的变量的位表示形式。此外,所开发的方法还可用于显示一组变量中特定位运算的结果。
然而,由于库代码相当广泛,并且这些操作用于处理库的逻辑,因此如果有一个调试工具可以在运行时显示变量的二进制值或特定操作的结果,那就太好了。这将避免我在整个代码中添加许多对我的方法的调用,以便分析代码中发生的情况。
有谁知道这样一个工具可以帮助我调试Java中的按位运算吗?
PS 目前,我正在使用 Eclipse 来调试应用程序,但在调试器中,值以十进制表示形式显示。
I have inherited a library that uses and abuses of bitwise operations. Up to now, I have developed a method that prints the bit representation of the variables that are used in such bitwise operations. Furthermore, the developed method can also be used to show the result of a particular bitwise operation in a set of variables.
However as the library code is quite extensive and these operations are used to handle the logic of the library, it would be great to have a debugging tool that could show the binary value of a variable or the result of a particular operation at runtime. This would avoid me to add many invocations of my method throughout the code in order to analyze what is happening in the code.
Does any one know such a tool that can help me debugging bitwise operations in Java?
P.S. Currently, I'm using Eclipse to debug the application but in the debugger the values are shown in a decimal representation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Eclipse 中 Java 的调试首选项允许选择“显示十六进制值”。这有帮助吗?
The Debug preferences for Java in Eclipse allow to select 'Display Hex Values'. Does that help?
您可以始终:
即
我有一个代码
我在第2行放置断点,其中'i'var已经初始化
在调试时我插入新行 2
我选择整个第2行(带有我的即时代码)并按ctrl+shift+i查看结果。一旦我有了它,我就可以恢复我的修改并继续调试。
You may always :
i.e.
I have a code
I'm putting breakpoint in line 2 where 'i' var is already initialized
and while debugging I insert new line 2
now I select whole line 2 (with my on the fly code) and press ctrl+shift+i to see the result. Once I have it I may revert my modifications and proceed with debugging.