public abstract class DebuggerBase extends java.lang.Object implements Debugger
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.
Modifier and Type | Field and Description |
---|---|
protected long |
heapOopSize |
protected boolean |
javaPrimitiveTypesConfigured |
protected long |
jbooleanSize |
protected long |
jbyteSize |
protected long |
jcharSize |
protected long |
jdoubleSize |
protected long |
jfloatSize |
protected long |
jintSize |
protected long |
jlongSize |
protected long |
jshortSize |
protected long |
klassPtrSize |
protected MachineDescription |
machDesc |
protected long |
narrowKlassBase |
protected int |
narrowKlassShift |
protected long |
narrowOopBase |
protected int |
narrowOopShift |
protected long |
oopSize |
protected DebuggerUtilities |
utils |
Modifier | Constructor and Description |
---|---|
protected |
DebuggerBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkConfigured()
Can be called by subclasses but can not be overridden
|
protected void |
checkJavaConfigured()
Can be called by subclasses but can not be overridden
|
protected void |
clearCache()
May be called by subclasses to clear out the cache but may not
be overridden.
|
void |
configureJavaPrimitiveTypeSizes(long jbooleanSize,
long jbyteSize,
long jcharSize,
long jdoubleSize,
long jfloatSize,
long jintSize,
long jlongSize,
long jshortSize)
From the JVMDebugger interface.
|
protected 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 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.
|
long |
getHeapOopSize() |
long |
getJBooleanSize()
the following methods are intended only for RemoteDebuggerClient
|
long |
getJByteSize() |
long |
getJCharSize() |
long |
getJDoubleSize() |
long |
getJFloatSize() |
long |
getJIntSize() |
long |
getJLongSize() |
long |
getJShortSize() |
long |
getKlassPtrSize() |
long |
getNarrowKlassBase() |
int |
getNarrowKlassShift() |
long |
getNarrowOopBase() |
int |
getNarrowOopShift() |
protected 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
|
void |
putHeapConst(long heapOopSize,
long klassPtrSize,
long narrowOopBase,
int narrowOopShift,
long narrowKlassBase,
int narrowKlassShift) |
protected long |
readAddressValue(long address) |
protected byte[] |
readBytes(long address,
long numBytes)
May be called by subclasses directly but may not be overridden
|
long |
readCInteger(long address,
long numBytes,
boolean isUnsigned) |
protected long |
readCompKlassAddressValue(long address) |
protected long |
readCompOopAddressValue(long address) |
boolean |
readJBoolean(long address) |
byte |
readJByte(long address) |
char |
readJChar(long address) |
double |
readJDouble(long address) |
float |
readJFloat(long address) |
int |
readJInt(long address) |
long |
readJLong(long address) |
short |
readJShort(long address) |
protected 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
|
protected void |
writeAddressValue(long address,
long value) |
protected void |
writeBytes(long address,
long numBytes,
byte[] data)
May be called by subclasses directly but may not be overridden
|
void |
writeCInteger(long address,
long numBytes,
long value) |
void |
writeJBoolean(long address,
boolean value) |
void |
writeJByte(long address,
byte value) |
void |
writeJChar(long address,
char value) |
void |
writeJDouble(long address,
double value) |
void |
writeJFloat(long address,
float value) |
void |
writeJInt(long address,
int value) |
void |
writeJLong(long address,
long value) |
void |
writeJShort(long address,
short value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attach, attach, consoleExecuteCommand, detach, getAddressValue, getCDebugger, getConsolePrompt, getCPU, getMachineDescription, getOS, getProcessList, hasConsole, hasProcessList, parseAddress, readBytesFromProcess, writeBytesToProcess
lookup, lookupOop
getThreadForIdentifierAddress, getThreadForThreadId
protected MachineDescription machDesc
protected DebuggerUtilities utils
protected long jbooleanSize
protected long jbyteSize
protected long jcharSize
protected long jdoubleSize
protected long jfloatSize
protected long jintSize
protected long jlongSize
protected long jshortSize
protected boolean javaPrimitiveTypesConfigured
protected long oopSize
protected long heapOopSize
protected long narrowOopBase
protected int narrowOopShift
protected long klassPtrSize
protected long narrowKlassBase
protected int narrowKlassShift
public void configureJavaPrimitiveTypeSizes(long jbooleanSize, long jbyteSize, long jcharSize, long jdoubleSize, long jfloatSize, long jintSize, long jlongSize, long jshortSize)
public void putHeapConst(long heapOopSize, long klassPtrSize, long narrowOopBase, int narrowOopShift, long narrowKlassBase, int narrowKlassShift)
protected final void initCache(long pageSize, long maxNumPages)
protected final void setBigEndian(boolean bigEndian)
protected final void clearCache()
protected final void disableCache()
protected final void enableCache()
protected final byte[] readBytes(long address, long numBytes) throws UnmappedAddressException, DebuggerException
protected final void writeBytes(long address, long numBytes, byte[] data) throws UnmappedAddressException, DebuggerException
public boolean readJBoolean(long address) throws UnmappedAddressException, UnalignedAddressException
public byte readJByte(long address) throws UnmappedAddressException, UnalignedAddressException
public char readJChar(long address) throws UnmappedAddressException, UnalignedAddressException
public double readJDouble(long address) throws UnmappedAddressException, UnalignedAddressException
public float readJFloat(long address) throws UnmappedAddressException, UnalignedAddressException
public int readJInt(long address) throws UnmappedAddressException, UnalignedAddressException
public long readJLong(long address) throws UnmappedAddressException, UnalignedAddressException
public short readJShort(long address) throws UnmappedAddressException, UnalignedAddressException
public long readCInteger(long address, long numBytes, boolean isUnsigned) throws UnmappedAddressException, UnalignedAddressException
public void writeJBoolean(long address, boolean value) throws UnmappedAddressException, UnalignedAddressException
public void writeJByte(long address, byte value) throws UnmappedAddressException, UnalignedAddressException
public void writeJChar(long address, char value) throws UnmappedAddressException, UnalignedAddressException
public void writeJDouble(long address, double value) throws UnmappedAddressException, UnalignedAddressException
public void writeJFloat(long address, float value) throws UnmappedAddressException, UnalignedAddressException
public void writeJInt(long address, int value) throws UnmappedAddressException, UnalignedAddressException
public void writeJLong(long address, long value) throws UnmappedAddressException, UnalignedAddressException
public void writeJShort(long address, short value) throws UnmappedAddressException, UnalignedAddressException
public void writeCInteger(long address, long numBytes, long value) throws UnmappedAddressException, UnalignedAddressException
protected long readAddressValue(long address) throws UnmappedAddressException, UnalignedAddressException
protected long readCompOopAddressValue(long address) throws UnmappedAddressException, UnalignedAddressException
protected long readCompKlassAddressValue(long address) throws UnmappedAddressException, UnalignedAddressException
protected void writeAddressValue(long address, long value) throws UnmappedAddressException, UnalignedAddressException
protected final void checkConfigured()
protected final void checkJavaConfigured()
protected int parseCacheNumPagesProperty(int defaultNum)
protected void invalidatePageCache(long startAddress, long numBytes)
public long getJBooleanSize()
Debugger
getJBooleanSize
in interface Debugger
public long getJByteSize()
getJByteSize
in interface Debugger
public long getJCharSize()
getJCharSize
in interface Debugger
public long getJDoubleSize()
getJDoubleSize
in interface Debugger
public long getJFloatSize()
getJFloatSize
in interface Debugger
public long getJIntSize()
getJIntSize
in interface Debugger
public long getJLongSize()
getJLongSize
in interface Debugger
public long getJShortSize()
getJShortSize
in interface Debugger
public long getHeapOopSize()
getHeapOopSize
in interface Debugger
public long getNarrowOopBase()
getNarrowOopBase
in interface Debugger
public int getNarrowOopShift()
getNarrowOopShift
in interface Debugger
public long getKlassPtrSize()
getKlassPtrSize
in interface Debugger
public long getNarrowKlassBase()
getNarrowKlassBase
in interface Debugger
public int getNarrowKlassShift()
getNarrowKlassShift
in interface Debugger
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.