簡體   English   中英

如何在Java的jdb調試器中打印數組?

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

如何一次打印出字節數組的值? 我似乎記得我可以在gdb中指定一個內存范圍。 jdb中是否有類似的功能?

我有一個Java字節數組:

byte [] decompressed = new byte[OUTPUT_FILE_IO_BUFFER_SIZE];

我從一個字符串填充:

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

在jdb中,我想打印字節數組的內容。 我試過了

main[1] print decompressed

返回:

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

一個解決方案

dump decompressed

這會轉儲字節值! :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM