Module openj9.dtfj

Interface IStructureFormatter

All Known Implementing Classes:
BaseStructureCommand.DefaultStructureFormatter, BaseStructureFormatter, J9ClassStructureFormatter, J9MethodStructureFormatter, J9ModuleStructureFormatter, J9ObjectStructureFormatter, J9PackageStructureFormatter, J9ROMMethodStructureFormatter

public interface IStructureFormatter
Interface for objects that format entire structures e.g. turning !mm_gcextensions 0x00119748 into MM_GCExtensions at 0x119748 { 0x8: struct J9JavaVM* javaVM = !j9javavm 0x000A9A88 0xc: class MM_Forge forge = !class mm_forge 0x00119754 0x74: class GC_ObjectModel objectModel = !class gc_objectmodel 0x001197BC The IStructureFormatters form a chain of responsibility. The structure ICommand calls each IStructureFormatters in turn three times. The first pass calls preFormat() The second pass calls format() - where the default formatting behaviour is run. The third pass calls postFormat() Each method can return KEEP_WALKING to tell the walker to delegate to the next IStructureFormatter in the chain, or STOP_WALKING to stop the walk.
  • Method Details

    • preFormat

      FormatWalkResult preFormat(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs)
      Method called by the Structure command before the format() method walk.
      Parameters:
      address - Address to be formatted
      out - PrintStream to write result to. Do not write a new line at the end of your output.
      context - Current DDRInteractive context
      fieldFormatters - List of field formatters. This list will be used for other IStructureFormatters, so any changes you make will affect downstream formatters (but only for this formatting operation).
      extraArgs - Extra arguments passed by the user after the structure address
      Returns:
      KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
    • format

      FormatWalkResult format(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs)
      Method called by the Structure command after the preFormat() and before the postFormat() walks.
      Parameters:
      address - Address to be formatted
      out - PrintStream to write result to. Do not write a new line at the end of your output.
      context - Current DDRInteractive context
      fieldFormatters - List of field formatters. This list will be used for other IStructureFormatters, so any changes you make will affect downstream formatters (but only for this formatting operation).
      extraArgs - Extra arguments passed by the user after the structure address
      Returns:
      KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
    • postFormat

      FormatWalkResult postFormat(String type, long address, PrintStream out, Context context, List<IFieldFormatter> fieldFormatters, String[] extraArgs)
      Method called by the Structure command after the format() walk.
      Parameters:
      address - Address to be formatted
      out - PrintStream to write result to. Do not write a new line at the end of your output.
      context - Current DDRInteractive context
      fieldFormatters - List of field formatters. This list will be used for other IStructureFormatters, so any changes you make will affect downstream formatters (but only for this formatting operation).
      extraArgs - Extra arguments passed by the user after the structure address
      Returns:
      KEEP_WALKING if the format walk should keep going (delegating to other formatters), STOP_WALKING if the format walk should stop
    • formatField

      void formatField(String name, String type, String declaredType, long address, PrintStream out, Context context) throws CorruptDataException
      Parameters:
      name - Name of field
      type - Type of field e.g. struct J9JavaVM
      declaredType - The type as declared in native code
      address - Address of field slot
      out - PrintStream to format to
      context - DDRInteractive context
      Throws:
      CorruptDataException - If there's a problem accessing the field