java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
com.ibm.j9ddr.corereaders.tdump.zebedee.dumpreader.Dump
All Implemented Interfaces:
Closeable, DataInput, AutoCloseable, ImageInputStream

public final class Dump extends ImageInputStreamImpl
This class represents an svcdump. It is the main class in the dumpreader package and provides low-level access to the contents of an svcdump (eg the ability to read the contents of an address in a given address space).

Implementation note: currently implemented by linking to the old svcdump.jar code (so you need to include svcdump.jar when using) but this dependency will eventually be removed.

  • Field Details

    • DATABLOCKSIZE

      public static final int DATABLOCKSIZE
      Size of a block excluding header
      See Also:
  • Constructor Details

  • Method Details

    • isValid

      public static boolean isValid(String filename)
      Returns true if the given filename is a valid svcdump.
    • initialize

      public void initialize() throws FileNotFoundException, FileFormatException
      Scan the dump and build the array of AddressSpaces. Every block of the dump is read to build a mapping of block memory addresses to file offsets, for each address space in the dump Each block has a header containing the AddressSpace ID and the memory address the block maps to.
      Throws:
      FileNotFoundException
      FileFormatException
    • seek

      public void seek(long offset) throws IOException
      Seek to the given offset in the dump file. This also handles MVS datasets in an efficient way (simply using fseek is too slow because the seek appears to read the file from the beginning every time!).
      Specified by:
      seek in interface ImageInputStream
      Overrides:
      seek in class ImageInputStreamImpl
      Parameters:
      offset - the offset to seek to
      Throws:
      IOException - if any other I/O error occurs.
    • read

      public int read() throws IOException
      Reads an unsigned byte from the file
      Specified by:
      read in interface ImageInputStream
      Specified by:
      read in class ImageInputStreamImpl
      Returns:
      Throws:
      IOException
    • read

      public int read(byte[] buf, int off, int len) throws IOException
      Read from the dump file into the given buffer.
      Specified by:
      read in interface ImageInputStream
      Specified by:
      read in class ImageInputStreamImpl
      Parameters:
      buf - the buffer to read into
      off - the offset into the buffer to start at
      len - the maximum number of bytes to read
      Returns:
      the number of bytes actually read, or -1 to indicate EOF.
      Throws:
      IOException - if an I/O error occurs.
    • read

      public int read(byte[] buf) throws IOException
      Read from the dump file into the given buffer.
      Specified by:
      read in interface ImageInputStream
      Overrides:
      read in class ImageInputStreamImpl
      Parameters:
      buf - the buffer to read into
      Returns:
      the number of bytes actually read, or -1 to indicate EOF.
      Throws:
      IOException - if an I/O error occurs.
    • length

      public long length()
      Get the length of the dump file
      Specified by:
      length in interface ImageInputStream
      Overrides:
      length in class ImageInputStreamImpl
      Returns:
      -1L to indicate unknown length.
    • close

      public void close() throws IOException
      Close the file used to read the dump
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface ImageInputStream
      Overrides:
      close in class ImageInputStreamImpl
      Throws:
      IOException - if an I/O error occurs.
    • localClose

      public void localClose() throws IOException
      Close the file used to read the dump (MVS datasets only). Added this because need to let it know we have finished with the handle for MVS only. Need to clean this up.
      Throws:
      IOException
    • getAddressSpaces

      public AddressSpace[] getAddressSpaces()
      Returns an array of all the address spaces in the dump.
    • getAddressSpace

      public AddressSpace getAddressSpace(int id)
      Returns the address space with the given id or null if it can't be found.
    • is64bit

      public boolean is64bit()
      Returns true if this is a 64-bit dump. Always returns false at the moment 'cos I haven't yet got my paws on a 64-bit dump.
    • getTitle

      public String getTitle()
      Returns the title of the dump.
    • getProductName

      public String getProductName()
      Returns the z/OS product name.
    • getProductVersion

      public String getProductVersion()
      Returns the z/OS product version.
    • getProductRelease

      public String getProductRelease()
      Returns the z/OS product release.
    • getProductModification

      public String getProductModification()
      Returns the z/OS product modification.
    • mvsClockToDate

      public static Date mvsClockToDate(long clock)
      Convert an MVS style clock value to a Date object.
    • getCreationDate

      public Date getCreationDate()
      Returns the time when the dump was created.
    • getSystemTrace

      public SystemTrace getSystemTrace() throws IOException
      Returns an object representing the system trace table.
      Throws:
      IOException
    • getName

      public String getName()
      Return the pathname for this dump