Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323962

Summary: Cannot add detail formatter for byte[]
Product: [Eclipse Project] JDT Reporter: Juergen Weber <juergen>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: ivan.outer, Michael_Rennie
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Juergen Weber CLA 2010-08-30 08:34:01 EDT
Build Identifier: 20100617-1415

I'd like to have a byte[] formatted like the output of Linux's hexdump -C
Unfortunately it looks like it is not possible to find primitive types in the "Select Type" dialog of "Add Detail Formatter"
It should be possible for primitive types and arrays of primitive types, too.

Reproducible: Always
Comment 1 Ivan CLA 2012-08-15 09:18:54 EDT
Want it too, not fixed in 20120614-1722.
Why doesn't Eclipse resolve e.g. "[B" class name and other primitives and arrays of classes/primitives?
While debugging it is often useful to see some buffer content as a String (or something else). Especially when you work with HTTP or other text related protocols.
Comment 2 Juergen Weber CLA 2014-05-07 05:27:02 EDT
Found a workaround:

write a static method
public static String hexdump(byte[] b)

and put this into a jar in jre/lib/endorsed of the VM Eclipse runs in.

Then you can use in Expressions View an expression like Hexdump.hexdump(myarry)
Comment 3 Michael Rennie CLA 2014-05-12 13:48:26 EDT

*** This bug has been marked as a duplicate of bug 187922 ***