Top Description Inners Fields Constructors Methods
sun.jvm.hotspot.debugger

public abstract Class DebuggerBase

extends Object
implements Debugger
Class Inheritance
All Implemented Interfaces
sun.jvm.hotspot.debugger.Debugger, sun.jvm.hotspot.debugger.ThreadAccess, sun.jvm.hotspot.debugger.SymbolLookup
Known Direct Subclasses
sun.jvm.hotspot.debugger.remote.RemoteDebuggerClient, sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal, sun.jvm.hotspot.debugger.dummy.DummyDebugger, sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal, sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal

DebuggerBase is a recommended base class for debugger implementations. It can use a PageCache to cache data from the target process. Note that this class would not be suitable if the system were used to reflect upon itself; it would never be safe to store the value in an OopHandle in anything but an OopHandle. However, it provides a fair amount of code sharing to the current dbx and win32 implementations.

NOTE that much of the code sharing is achieved by having this class implement many of the methods in the Win32Debugger and DbxDebugger interfaces.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private boolean
private PageCache
protected long
protected boolean
protected long
protected long
protected long
protected long
protected long
protected long
protected long
protected long
protected long
protected MachineDescription
protected long
protected int
protected long
protected int
protected long
private long
private boolean
protected DebuggerUtilities

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private boolean
canUsePageCacheFor64bitRead(long address)

If an address for a 64-bit value starts on the last 32-bit word of a page, then we can't use the page cache to read it because it will cause an ArrayIndexOutOfBoundsException when reading past the end of the page.

protected final void
checkConfigured()

Can be called by subclasses but can not be overridden

protected final void
checkJavaConfigured()

Can be called by subclasses but can not be overridden

protected final void
clearCache()

May be called by subclasses to clear out the cache but may not be overridden.

public void
configureJavaPrimitiveTypeSizes(long jbooleanSize, long jbyteSize, long jcharSize, long jdoubleSize, long jfloatSize, long jintSize, long jlongSize, long jshortSize)

From the JVMDebugger interface.

protected final void
disableCache()

May be called by subclasses to disable the cache (for example, when the target process has been resumed) but may not be overridden.

protected final void
enableCache()

May be called by subclasses to re-enable the cache (for example, when the target process has been suspended) but may not be overridden.

public String
findSymbol(String symbol)

Implements sun.jvm.hotspot.debugger.Debugger.findSymbol.

Find address and executable which contains symbol.
public long
public long
getJBooleanSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJBooleanSize.

the following methods are intended only for RemoteDebuggerClient
public long
public long
public long
public long
public long
public long
public long
public long
public long
public int
public long
public int
protected final void
initCache(long pageSize, long maxNumPages)

May be called by subclasses if desired to initialize the page cache but may not be overridden

protected void
invalidatePageCache(long startAddress, long numBytes)

Interim solution for allowing subclasses to write bytes to process until we make that functionality available in the basic Address interface

protected int
parseCacheNumPagesProperty(int defaultNum)

Possibly override page cache size with user-specified property

public void
putHeapConst(long heapOopSize, long klassPtrSize, long narrowOopBase, int narrowOopShift, long narrowKlassBase, int narrowKlassShift)

protected long
readAddressValue(long address)

protected final byte[]
readBytes(long address, long numBytes)

May be called by subclasses directly but may not be overridden

public long
readCInteger(long address, long numBytes, boolean isUnsigned)

protected long
protected long
public boolean
readJBoolean(long address)

public byte
readJByte(long address)

public char
readJChar(long address)

public double
readJDouble(long address)

public float
readJFloat(long address)

public int
readJInt(long address)

public long
readJLong(long address)

public short
readJShort(long address)

protected final void
setBigEndian(boolean bigEndian)

May be called by subclasses if needed (if the machine description is not available at the time of cache initialization, as on Solaris) but may not be overridden

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bigEndianback to summary
private boolean bigEndian
cacheback to summary
private PageCache cache
heapOopSizeback to summary
protected long heapOopSize
javaPrimitiveTypesConfiguredback to summary
protected boolean javaPrimitiveTypesConfigured
jbooleanSizeback to summary
protected long jbooleanSize
jbyteSizeback to summary
protected long jbyteSize
jcharSizeback to summary
protected long jcharSize
jdoubleSizeback to summary
protected long jdoubleSize
jfloatSizeback to summary
protected long jfloatSize
jintSizeback to summary
protected long jintSize
jlongSizeback to summary
protected long jlongSize
jshortSizeback to summary
protected long jshortSize
klassPtrSizeback to summary
protected long klassPtrSize
machDescback to summary
protected MachineDescription machDesc
narrowKlassBaseback to summary
protected long narrowKlassBase
narrowKlassShiftback to summary
protected int narrowKlassShift
narrowOopBaseback to summary
protected long narrowOopBase
narrowOopShiftback to summary
protected int narrowOopShift
oopSizeback to summary
protected long oopSize
pageSizeback to summary
private long pageSize
useFastAccessorsback to summary
private boolean useFastAccessors
utilsback to summary
protected DebuggerUtilities utils

Constructor Detail

DebuggerBaseback to summary
protected DebuggerBase()

Method Detail

canUsePageCacheFor64bitReadback to summary
private boolean canUsePageCacheFor64bitRead(long address)

If an address for a 64-bit value starts on the last 32-bit word of a page, then we can't use the page cache to read it because it will cause an ArrayIndexOutOfBoundsException when reading past the end of the page.

checkConfiguredback to summary
protected final void checkConfigured()

Can be called by subclasses but can not be overridden

checkJavaConfiguredback to summary
protected final void checkJavaConfigured()

Can be called by subclasses but can not be overridden

clearCacheback to summary
protected final void clearCache()

May be called by subclasses to clear out the cache but may not be overridden. For convenience, this can be called even if the cache has not been initialized.

configureJavaPrimitiveTypeSizesback to summary
public void configureJavaPrimitiveTypeSizes(long jbooleanSize, long jbyteSize, long jcharSize, long jdoubleSize, long jfloatSize, long jintSize, long jlongSize, long jshortSize)

From the JVMDebugger interface. This is the only public method of this class.

disableCacheback to summary
protected final void disableCache()

May be called by subclasses to disable the cache (for example, when the target process has been resumed) but may not be overridden. For convenience, this can be called even if the cache has not been initialized.

enableCacheback to summary
protected final void enableCache()

May be called by subclasses to re-enable the cache (for example, when the target process has been suspended) but may not be overridden. For convenience, this can be called even if the cache has not been initialized.

findSymbolback to summary
public String findSymbol(String symbol)

Implements sun.jvm.hotspot.debugger.Debugger.findSymbol.

Doc from sun.jvm.hotspot.debugger.Debugger.findSymbol.

Find address and executable which contains symbol.

Annotations
@Override
getHeapOopSizeback to summary
public long getHeapOopSize()

Implements sun.jvm.hotspot.debugger.Debugger.getHeapOopSize.

getJBooleanSizeback to summary
public long getJBooleanSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJBooleanSize.

Doc from sun.jvm.hotspot.debugger.Debugger.getJBooleanSize.

the following methods are intended only for RemoteDebuggerClient

getJByteSizeback to summary
public long getJByteSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJByteSize.

getJCharSizeback to summary
public long getJCharSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJCharSize.

getJDoubleSizeback to summary
public long getJDoubleSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJDoubleSize.

getJFloatSizeback to summary
public long getJFloatSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJFloatSize.

getJIntSizeback to summary
public long getJIntSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJIntSize.

getJLongSizeback to summary
public long getJLongSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJLongSize.

getJShortSizeback to summary
public long getJShortSize()

Implements sun.jvm.hotspot.debugger.Debugger.getJShortSize.

getKlassPtrSizeback to summary
public long getKlassPtrSize()

Implements sun.jvm.hotspot.debugger.Debugger.getKlassPtrSize.

getNarrowKlassBaseback to summary
public long getNarrowKlassBase()

Implements sun.jvm.hotspot.debugger.Debugger.getNarrowKlassBase.

getNarrowKlassShiftback to summary
public int getNarrowKlassShift()

Implements sun.jvm.hotspot.debugger.Debugger.getNarrowKlassShift.

getNarrowOopBaseback to summary
public long getNarrowOopBase()

Implements sun.jvm.hotspot.debugger.Debugger.getNarrowOopBase.

getNarrowOopShiftback to summary
public int getNarrowOopShift()

Implements sun.jvm.hotspot.debugger.Debugger.getNarrowOopShift.

initCacheback to summary
protected final void initCache(long pageSize, long maxNumPages)

May be called by subclasses if desired to initialize the page cache but may not be overridden

invalidatePageCacheback to summary
protected void invalidatePageCache(long startAddress, long numBytes)

Interim solution for allowing subclasses to write bytes to process until we make that functionality available in the basic Address interface

parseCacheNumPagesPropertyback to summary
protected int parseCacheNumPagesProperty(int defaultNum)

Possibly override page cache size with user-specified property

putHeapConstback to summary
public void putHeapConst(long heapOopSize, long klassPtrSize, long narrowOopBase, int narrowOopShift, long narrowKlassBase, int narrowKlassShift)
readAddressValueback to summary
protected long readAddressValue(long address) throws UnmappedAddressException, UnalignedAddressException
readBytesback to summary
protected final byte[] readBytes(long address, long numBytes) throws UnmappedAddressException, DebuggerException

May be called by subclasses directly but may not be overridden

readCIntegerback to summary
public long readCInteger(long address, long numBytes, boolean isUnsigned) throws UnmappedAddressException, UnalignedAddressException
readCompKlassAddressValueback to summary
protected long readCompKlassAddressValue(long address) throws UnmappedAddressException, UnalignedAddressException
readCompOopAddressValueback to summary
protected long readCompOopAddressValue(long address) throws UnmappedAddressException, UnalignedAddressException
readJBooleanback to summary
public boolean readJBoolean(long address) throws UnmappedAddressException, UnalignedAddressException
readJByteback to summary
public byte readJByte(long address) throws UnmappedAddressException, UnalignedAddressException
readJCharback to summary
public char readJChar(long address) throws UnmappedAddressException, UnalignedAddressException
readJDoubleback to summary
public double readJDouble(long address) throws UnmappedAddressException, UnalignedAddressException
readJFloatback to summary
public float readJFloat(long address) throws UnmappedAddressException, UnalignedAddressException
readJIntback to summary
public int readJInt(long address) throws UnmappedAddressException, UnalignedAddressException
readJLongback to summary
public long readJLong(long address) throws UnmappedAddressException, UnalignedAddressException
readJShortback to summary
public short readJShort(long address) throws UnmappedAddressException, UnalignedAddressException
setBigEndianback to summary
protected final void setBigEndian(boolean bigEndian)

May be called by subclasses if needed (if the machine description is not available at the time of cache initialization, as on Solaris) but may not be overridden

sun.jvm.hotspot.debugger back to summary

pack-priv Class DebuggerBase.Fetcher

extends Object
implements PageFetcher
Class Inheritance
All Implemented Interfaces
sun.jvm.hotspot.debugger.PageFetcher

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Page
fetchPage(long pageBaseAddress, long numBytes)

Implements sun.jvm.hotspot.debugger.PageFetcher.fetchPage.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Fetcherback to summary
pack-priv Fetcher()

Method Detail

fetchPageback to summary
public Page fetchPage(long pageBaseAddress, long numBytes)

Implements sun.jvm.hotspot.debugger.PageFetcher.fetchPage.