com.ibm.dtfj.analyzer.helpers
Class OneImageSection

java.lang.Object
  extended by TranslatableAnalyzer
      extended by com.ibm.dtfj.analyzer.base.SimpleAnalyzerBean
          extended by com.ibm.dtfj.analyzer.helpers.OneImageSection
All Implemented Interfaces:
IAnalyzerBase, IReport, IWrapper
Direct Known Subclasses:
OneImageSection

public class OneImageSection
extends SimpleAnalyzerBean

Print basic information about one DTFJ ImageSection object.


Constructor Summary
OneImageSection()
          Null constructor for use as JavaBean
 
Method Summary
 void addToContentSummary(java.lang.String item)
          Add a new entry to the content summary for this section
 java.lang.String getAnnotation()
          Obtain a descriptive text for this section, as set during a prior call to setAnnotation(String).
 com.ibm.dtfj.image.ImagePointer getBase()
           
 int getCachingPriority()
          Return 10 to force caching of OneImageSection objects (to preserve the content summary)
 long getCRC32()
           
static OneImageSection getInstance(IAnalyzerContext context, com.ibm.dtfj.image.ImageSection parent)
          Find the OneImageSection bean instance associated with a given parent ImageSection (create it if necessary)
 long getSize()
           
 java.lang.String getSizeAsString()
           
 boolean isAddressInRange(long addr)
          Check that a given numeric address is within the range of addresses for this ImageSection
 boolean isNull()
          Check if this OneImageSection is a dummy representing a null address range.
static boolean isNull(com.ibm.dtfj.image.ImageSection s)
          Check if a given ImageSection is a dummy representing a null address range.
 boolean isOtherSectionInRange(com.ibm.dtfj.image.ImageSection otherSection)
          Check if a given ImageSection is contained within the range of addresses that define this section.
 boolean isOtherSectionInRange(OneImageSection otherSection)
          Check if a given OneImageSection is contained within the range of addresses that define this section.
 boolean isPointerInRange(com.ibm.dtfj.image.ImagePointer ptr)
          Check that a given ImagePointer is within the range of addresses for this ImageSection
 boolean isSameRange(OneImageSection o)
          Check if this OneImageSection represents the exact same address range as the current object
 void printContentSummary(IAnalysisReport out)
          Print a summary of the contents of this section, as a segment of a report.
 void printRawContents(IAnalysisReport out, long startOffset, long size)
          Print the contents of this section as raw hexadecimal values in a report.
 IAnalysisReport produceReport()
          Generate a report which will be encapsulated in the IAnalysisReport object for later use by some formatter.
 void setAnnotation(java.lang.String annotation)
          Set-up a descriptive text associated with this section.
 void setParent(java.lang.Object parent)
          Set the parent ImageSection underlying this analyzer bean.
protected  void substituteParent(com.ibm.dtfj.image.ImageSection newParent)
          Special method to allow a sub-class to substitute a new parent, to compensate for a DTFJ defect.
 
Methods inherited from class com.ibm.dtfj.analyzer.base.SimpleAnalyzerBean
allocateReport, allocateReportOptions, allocateSecondaryReport, getCategories, getContext, getIdentityString, getInstance, getLogger, getLongDescription, getName, getNextValidObject, getParent, getReportExtensionHelper, getResourceBundleName, getShortDescription, getVersion, isPrimaryAnalyzer, printEmbeddedReport, printEmbeddedReport, printEmbeddedReportWithOptions, printEmbeddedReportWithOptions, printReportInfoHeader, recordInternalExceptionStatic, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneImageSection

public OneImageSection()
Null constructor for use as JavaBean

Method Detail

getCachingPriority

public int getCachingPriority()
Return 10 to force caching of OneImageSection objects (to preserve the content summary)

Specified by:
getCachingPriority in interface IAnalyzerBase
Overrides:
getCachingPriority in class SimpleAnalyzerBean
Returns:
the caching priority, as a number between 0 and 10
See Also:
SimpleAnalyzerBean.getCachingPriority()

getInstance

public static OneImageSection getInstance(IAnalyzerContext context,
                                          com.ibm.dtfj.image.ImageSection parent)
Find the OneImageSection bean instance associated with a given parent ImageSection (create it if necessary)

Parameters:
context - the AnalyzerContext in which to locate this bean instance
parent - the parent ImageSection underlying this analyzer bean
Returns:
the desired OneImageSection analyzer bean

setParent

public void setParent(java.lang.Object parent)
Set the parent ImageSection underlying this analyzer bean.

Specified by:
setParent in interface IWrapper
Overrides:
setParent in class SimpleAnalyzerBean
Parameters:
parent - The parent object to set. Must be of type ImageSection. compatible with the type of analyzer bean that receives it
See Also:
IWrapper.setParent(java.lang.Object)

substituteParent

protected void substituteParent(com.ibm.dtfj.image.ImageSection newParent)
Special method to allow a sub-class to substitute a new parent, to compensate for a DTFJ defect.

Parameters:
newParent - a new parent object

isPointerInRange

public boolean isPointerInRange(com.ibm.dtfj.image.ImagePointer ptr)
Check that a given ImagePointer is within the range of addresses for this ImageSection

Parameters:
ptr - the ImagePointer to check
Returns:
true if ptr is within this section, false otherwise

isAddressInRange

public boolean isAddressInRange(long addr)
Check that a given numeric address is within the range of addresses for this ImageSection

Parameters:
addr - the address to check
Returns:
true if address is within this section, false otherwise

isOtherSectionInRange

public boolean isOtherSectionInRange(com.ibm.dtfj.image.ImageSection otherSection)
                              throws com.ibm.dtfj.image.DTFJException
Check if a given ImageSection is contained within the range of addresses that define this section.

Parameters:
otherSection - the target ImageSection to check
Returns:
true if otherSection is contained within the current section, false otherwise
Throws:
com.ibm.dtfj.image.DTFJException

isOtherSectionInRange

public boolean isOtherSectionInRange(OneImageSection otherSection)
                              throws com.ibm.dtfj.image.DTFJException
Check if a given OneImageSection is contained within the range of addresses that define this section.

Parameters:
otherSection - the target OneImageSection to check
Returns:
true if otherSection is contained within the current section, false otherwise
Throws:
com.ibm.dtfj.image.DTFJException

setAnnotation

public void setAnnotation(java.lang.String annotation)
Set-up a descriptive text associated with this section.

Parameters:
annotation - the annotation to associate with this section

getAnnotation

public java.lang.String getAnnotation()
Obtain a descriptive text for this section, as set during a prior call to setAnnotation(String).

Returns:
the annotation associated with this section, or a default name if no explicit annotation was set.

addToContentSummary

public void addToContentSummary(java.lang.String item)
Add a new entry to the content summary for this section

Parameters:
item - a string describing the new entry

printContentSummary

public void printContentSummary(IAnalysisReport out)
Print a summary of the contents of this section, as a segment of a report. The content summary consists of a list of entries that have been specified in calls to addToContentSummary(String). It normally represents information about objects or other references that are known to reside within the memory range represented by this section.

Parameters:
out - a AnalysisReport object to which to write the output

getSizeAsString

public java.lang.String getSizeAsString()
Returns:
the size of this section is a user-friendly string

produceReport

public IAnalysisReport produceReport()
Description copied from interface: IReport
Generate a report which will be encapsulated in the IAnalysisReport object for later use by some formatter.

Specified by:
produceReport in interface IReport
Overrides:
produceReport in class SimpleAnalyzerBean
Returns:
- the generic report object which will be given to some formatter
See Also:
IReport.produceReport()

isNull

public static boolean isNull(com.ibm.dtfj.image.ImageSection s)
Check if a given ImageSection is a dummy representing a null address range. Static method to allow quick checks without instantiating a whole OneImageSection object

Parameters:
s - the ImageSection to check
Returns:
true if this ImageSection is a dummy null section

isNull

public boolean isNull()
Check if this OneImageSection is a dummy representing a null address range.

Returns:
true if this ImageSection is a dummy null section

isSameRange

public boolean isSameRange(OneImageSection o)
Check if this OneImageSection represents the exact same address range as the current object

Parameters:
o - the other OneImageSection to compare to the current object
Returns:
true if the two sections represent the same address range, false otherwise

getCRC32

public long getCRC32()
              throws com.ibm.dtfj.image.DTFJException
Returns:
a CRC32 checksum of the contents of this ImageSection
Throws:
com.ibm.dtfj.image.DTFJException

getBase

public com.ibm.dtfj.image.ImagePointer getBase()
Returns:
the ImagePointer at the base of this section

getSize

public long getSize()
Returns:
the size of this section in bytes

printRawContents

public void printRawContents(IAnalysisReport out,
                             long startOffset,
                             long size)
Print the contents of this section as raw hexadecimal values in a report.

Parameters:
out - the report to receive this output
startOffset - the start offset in the section from which to start printing (in bytes)
size - the number of bytes to print (will be rounded-up to 16 bytes)


© Copyright IBM Corp. 2007, 2008 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.