AvailObjectFieldHelper

class AvailObjectFieldHelper(    parentObject: A_BasicObject?,     val slot: AbstractSlotsEnum,     val subscript: Int,     val value: Any?,     val slotName: String = slot.fieldName,     val forcedName: String? = null,     val forcedChildren: Array<*>? = null)

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:

  1. 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];

  2. Preferences... Java Debug Logical Structures

    Add:

    • Qualified name: avail.descriptor.representation.AvailObject

    • Description: Present Avail objects

    • Structure type: Single value

    • Code: return describeForDebugger();

  3. 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();

  4. 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;

  5. 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

  6. 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

parentObject

The object containing the value.

slot

The slot in which the value occurs.

subscript

The optional subscript for a repeating slot. Uses -1 to indicate this is not a repeating slot.

value

The value being presented in that slot.

slotName

The optional overridden name of the slot to be presented.

forcedName

When set to non-null, forces this exact name to be presented, regardless of the value.

forcedChildren

When set to non-null, forces the given Array to be presented as the children of this node in the debugger.

Constructors

Link copied to clipboard
fun AvailObjectFieldHelper(    parentObject: A_BasicObject?,     slot: AbstractSlotsEnum,     subscript: Int,     value: Any?,     slotName: String = slot.fieldName,     forcedName: String? = null,     forcedChildren: Array<*>? = null)

Functions

Link copied to clipboard
fun describeForDebugger(): Any?
Link copied to clipboard
fun nameForDebugger(): String

Answer the string to display for this field.

Properties

Link copied to clipboard
val forcedChildren: Array<*>? = null
Link copied to clipboard
val forcedName: String? = null
Link copied to clipboard
val name: String

The name to present for this field.

Link copied to clipboard
val slot: AbstractSlotsEnum
Link copied to clipboard
val slotName: String
Link copied to clipboard
val subscript: Int
Link copied to clipboard
val value: Any?