开发者

How do I print an array in Java's jdb debugger?

开发者 https://www.devze.com 2022-12-13 13:09 出处:网络
How do I print out the values of the by开发者_JS百科te array all at once? I seem to recall I could specify a memory range in gdb. Is similar functionality is available in jdb?

How do I print out the values of the by开发者_JS百科te array all at once? I seem to recall I could specify a memory range in gdb. Is similar functionality is available in jdb?

I have a Java byte array:

byte [] decompressed = new byte[OUTPUT_FILE_IO_BUFFER_SIZE];

which I populate from a String:

System.arraycopy(decompressedString.getBytes(), 0, decompressed, 0, 
                         decompressedString.length());

In jdb, I want to print the contents of the byte array. I tried

main[1] print decompressed

which returns:

 decompressed = instance of byte[7] (id=342)


One solution:

dump decompressed

This dumps the byte values! :)

0

精彩评论

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