简体   繁体   中英

How do I display a char array as an array of hex bytes or unsigned decimal numbers in the Eclipse Java debugger?

This is exactly the same question as " How do I display a byte array as an array of hex bytes or unsigned decimal numbers in the Eclipse Java debugger? ",
except it applies to char[] rather than byte[] :

So, how would I view a char array in the Eclipse Java debugger as an array of hex bytes (2 digits each) or unsigned decimal numbers?

More generally, (see Tips and Tricks for Debugging in Eclipse ), you can edit and make your own formatter for any kind of value:

详细格式

(In Eclipse preferences under Java->Debug->Detail Formatters ).

That will transform, for instance, this:

格式化前的变量

into this:

自定义格式后的结果

You could then use this technique for your char[], provided you did set first the "as the label for all variables" option

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM