Module openj9.dtfj

Class DDRInteractive

java.lang.Object
com.ibm.j9ddr.tools.ddrinteractive.DDRInteractive
All Implemented Interfaces:
Runnable

public class DDRInteractive extends Object implements Runnable
  • Constructor Details

    • DDRInteractive

      public DDRInteractive(Object obj, PrintStream out) throws Exception
      Construct DDR from J9DDRImage, ICore or IProcess
      Parameters:
      obj - Core file.
      out - result output stream.
      Throws:
      Exception
    • DDRInteractive

      public DDRInteractive(IProcess proc, IVMData vmData, PrintStream out) throws Exception
      Throws:
      Exception
    • DDRInteractive

      public DDRInteractive(List<Object> dtfjcontexts, PrintStream out) throws Exception
      Construct DDR from DTFJ contexts, this prevents both the DTFJ view such as jdmpview from scanning a core file, followed by a second scan by DDR interactive. It also ensures that a tool can know which contexts point to the same VM. Uses reflection to avoid a binding to the DTFJ jars which allows DDR to be invoked independently
      Parameters:
      obj -
      out - result output stream.
      Throws:
      Exception
    • DDRInteractive

      public DDRInteractive(String path, PrintStream out) throws Exception
      Start DDR. Read command from standard input.
      Parameters:
      path - path to core file.
      out - result output stream.
      Throws:
      Exception
    • DDRInteractive

      public DDRInteractive(String path, CommandReader commandReader, PrintStream out) throws Exception
      Start DDR
      Parameters:
      path - core file location on disk.
      commandReader - user input.
      out - result output stream.
      Throws:
      Exception
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Parameters:
      args -
      Throws:
      Exception
    • getCommandNames

      public Object[] getCommandNames()
    • getCurrentContext

      public Context getCurrentContext()
      Get the current context that is being operated on. This is used by external applications such as Eclipse which are providing their own command parsers
      Returns:
      the current context
    • startDDR

      public void startDDR() throws Exception
      Throws:
      Exception
    • setInputStream

      public void setInputStream(InputStream in)
      Used by external clients to set the input stream.
      Parameters:
      in - the new stream to read commands from
    • processLine

      public void processLine(String line) throws Exception
      Have the underlying command reader process a given line
      Parameters:
      line - command line to process
      Throws:
      Exception - re-throw any exceptions
    • showContexts

      public void showContexts()
    • run

      public void run()
      Execute DDR inside a thread that was started by a debugger (!startddr).
      Specified by:
      run in interface Runnable
      See Also:
    • execute

      public void execute(CommandParser command)
    • execute

      public void execute(String command, String[] arguments)
    • getStructuresForCurrentContext

      public Collection getStructuresForCurrentContext()
    • getPath

      public static String getPath()
      This function returns the path DDR interactive was invoked against. This allows commands to obtain the file name. ( A single file could contain multiple address spaces/processes so this cannot be usefully stored on IProcess or IContext. ) External tools may create more than one instance of DDRInteractive at the same time. This is a static property so allow it to be changed by external tools. The path can set at startup or via the com.ibm.j9ddr.tools.ddrinteractive.filepath system property
      Returns:
      the path to the file DDRInteractive was launched against or null if a path wasn't specified.
    • close

      public void close() throws Exception
      Close the core file and libraries opened by the core reader, and release any resources
      Throws:
      Exception