Avail Object Field Helper
This class assists with the presentation of AvailObjects in the IntelliJ debugger. Since AvailObjects have a uniform structure consisting of a descriptor, an array of AvailObjects, and an array of longs, it is essential to the understanding of a hierarchy of Avail objects that they be presented at the right level of abstraction, including the use of symbolic names for conceptual subobjects.
[The following steps are for Eclipse, but there's a similar mechanism for IntelliJ.]
Eclipse is still kind of fiddly about these presentations, requiring explicit manipulation through dialogs (well, maybe there's some way to hack around with the Eclipse preference files). Here are the minimum steps by which to set up symbolic Avail descriptions:
Preferences... Java Debug Logical Structures
Add:
Qualified name: avail.descriptor.representation.AvailIntegerValueHelper
Description: Hide integer value field
Structure type: Single value
Code:
return new Object[0];Preferences... Java Debug Logical Structures
Add:
Qualified name: avail.descriptor.representation.AvailObject
Description: Present Avail objects
Structure type: Single value
Code:
return describeForDebugger();Preferences... Java Debug Logical Structures
Add:
Qualified name: avail.interpreter.execution.Interpreter
Description: Present Interpreter as stack frames
Structure type: Single value
Code:
return describeForDebugger();Preferences... Java Debug Logical Structures
Add:
Qualified name: avail.descriptor.representation.AvailObjectFieldHelper
Description: Present helper's value's fields instead of the helper
Structure type: Single value
Code:
return value;Preferences... Java Debug Detail Formatters
Add:
Qualified type name: avail.descriptor.representation.AvailObjectFieldHelper
Detail formatter code snippet:
return name();Enable this detail formatter: (checked)
(after OK) Show variable details: As the label for all variables
In the Debug perspective, go to the Variables view. Select the tool bar icon whose hover help is Show Logical Structure.
Author
Mark van Gulik
Parameters
The object containing the value.
The slot in which the value occurs.
The optional subscript for a repeating slot. Uses -1 to indicate this is not a repeating slot.
The value being presented in that slot.
The optional overridden name of the slot to be presented.
When set to non-null, forces this exact name to be presented, regardless of the value.
When set to non-null, forces the given Array to be presented as the children of this node in the debugger.