public class ProcDebuggerLocal extends DebuggerBase implements ProcDebugger
An implementation of the JVMDebugger interface which sits on top of proc and relies on the SA's proc import module for communication with the debugger.
NOTE that since we have the notion of fetching "Java primitive types" from the remote process (which might have different sizes than we expect) we have a bootstrapping problem. We need to know the sizes of these types before we can fetch them. The current implementation solves this problem by requiring that it be configured with these type sizes before they can be fetched. The readJ(Type) routines here will throw a RuntimeException if they are called before the debugger is configured with the Java primitive type sizes.
Modifier and Type | Field and Description |
---|---|
protected static int |
cacheSize |
heapOopSize, javaPrimitiveTypesConfigured, jbooleanSize, jbyteSize, jcharSize, jdoubleSize, jfloatSize, jintSize, jlongSize, jshortSize, klassPtrSize, machDesc, narrowKlassBase, narrowKlassShift, narrowOopBase, narrowOopShift, oopSize, utils
Constructor and Description |
---|
ProcDebuggerLocal(MachineDescription machDesc,
boolean useCache)
machDesc may be null if it couldn't be determined yet; i.e.,
if we're on SPARC, we need to ask the remote process whether
we're in 32- or 64-bit mode.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addressValueToString(long address)
From the ProcDebugger interface
|
void |
attach(int processID)
From the Debugger interface via JVMDebugger
|
void |
attach(java.lang.String executableName,
java.lang.String coreFileName)
From the Debugger interface via JVMDebugger
|
java.lang.String |
consoleExecuteCommand(java.lang.String cmd)
If the underlying debugger has a console (as dbx does), this
provides access to it.
|
java.lang.String |
demangle(java.lang.String name)
From the ProcDebugger interface
|
boolean |
detach()
From the Debugger interface via JVMDebugger
|
long |
getAddressValue(Address addr)
From the ProcDebugger interface
|
CDebugger |
getCDebugger()
If this platform supports C/C++ debugging via the CDebugger
interface, returns a CDebugger object; otherwise returns
null.
|
java.lang.String |
getConsolePrompt()
If the underlying debugger has a console, this returns the
debugger-specific prompt which should be displayed.
|
java.lang.String |
getCPU()
From the Debugger interface via JVMDebugger
|
java.util.List |
getLoadObjectList()
From the ProcDebugger interface
|
MachineDescription |
getMachineDescription()
From the ProcDebugger interface
|
java.lang.String |
getOS()
From the Debugger interface via JVMDebugger
|
protected int |
getPageSize() |
java.util.List |
getProcessList()
Provide a snapshot of the list of currently-running processes in
the form of a List of ProcessInfo objects.
|
int |
getRemoteProcessAddressSize() |
ThreadProxy |
getThreadForIdentifierAddress(Address addr)
From the ThreadAccess interface via Debugger and JVMDebugger
|
ThreadProxy |
getThreadForThreadId(long id)
Gets an abstract ThreadProxy object for the thread identified by
id or handle that is platform dependent
|
long[] |
getThreadIntegerRegisterSet(int tid)
From the ProcDebugger interface.
|
java.util.List |
getThreadList()
From the ProcDebugger interface
|
boolean |
hasConsole()
Find out whether this debugger has a console available on which
commands can be executed; see executeCommandOnConsole, below.
|
boolean |
hasProcessList()
FIXME: implement this with a Runtime.exec() of ps followed by
parsing of its output
|
boolean |
isSuspended() |
ClosestSymbol |
lookup(long address)
From the ProcDebugger interface
|
Address |
lookup(java.lang.String objectName,
java.lang.String symbol)
From the SymbolLookup interface via Debugger and JVMDebugger
|
OopHandle |
lookupOop(java.lang.String objectName,
java.lang.String symbol)
From the SymbolLookup interface via Debugger and JVMDebugger
|
Address |
newAddress(long value)
From the ProcDebugger interface
|
Address |
parseAddress(java.lang.String addressString)
From the Debugger interface via JVMDebugger
|
sun.jvm.hotspot.debugger.proc.ProcAddress |
readAddress(long address)
From the ProcDebugger interface
|
ReadResult |
readBytesFromProcess(long address,
long numBytes) |
long |
readCInteger(long address,
long numBytes,
boolean isUnsigned)
Need to override this to relax alignment checks on Solaris/x86.
|
sun.jvm.hotspot.debugger.proc.ProcAddress |
readCompKlassAddress(long address) |
sun.jvm.hotspot.debugger.proc.ProcAddress |
readCompOopAddress(long address) |
sun.jvm.hotspot.debugger.proc.ProcOopHandle |
readCompOopHandle(long address) |
long |
readJLong(long address) |
sun.jvm.hotspot.debugger.proc.ProcOopHandle |
readOopHandle(long address)
From the ProcDebugger interface
|
void |
resume() |
void |
setMachineDescription(MachineDescription machDesc)
Internal routine supporting lazy setting of MachineDescription,
since on SPARC we will need to query the remote process to ask
it what its data model is (32- or 64-bit).
|
void |
suspend() |
CFrame |
topFrameForThread(ThreadProxy thread)
From the ProcDebugger interface
|
void |
writeBytesToProcess(long address,
long numBytes,
byte[] data) |
checkConfigured, checkJavaConfigured, clearCache, configureJavaPrimitiveTypeSizes, disableCache, enableCache, getHeapOopSize, getJBooleanSize, getJByteSize, getJCharSize, getJDoubleSize, getJFloatSize, getJIntSize, getJLongSize, getJShortSize, getKlassPtrSize, getNarrowKlassBase, getNarrowKlassShift, getNarrowOopBase, getNarrowOopShift, initCache, invalidatePageCache, parseCacheNumPagesProperty, putHeapConst, readAddressValue, readBytes, readCompKlassAddressValue, readCompOopAddressValue, readJBoolean, readJByte, readJChar, readJDouble, readJFloat, readJInt, readJShort, setBigEndian, writeAddressValue, writeBytes, writeCInteger, writeJBoolean, writeJByte, writeJChar, writeJDouble, writeJFloat, writeJInt, writeJLong, writeJShort
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readJBoolean, readJByte, readJChar, readJDouble, readJFloat, readJInt, readJShort
configureJavaPrimitiveTypeSizes, putHeapConst
getHeapOopSize, getJBooleanSize, getJByteSize, getJCharSize, getJDoubleSize, getJFloatSize, getJIntSize, getJLongSize, getJShortSize, getKlassPtrSize, getNarrowKlassBase, getNarrowKlassShift, getNarrowOopBase, getNarrowOopShift
protected static final int cacheSize
public ProcDebuggerLocal(MachineDescription machDesc, boolean useCache)
machDesc may be null if it couldn't be determined yet; i.e., if we're on SPARC, we need to ask the remote process whether we're in 32- or 64-bit mode.
useCache should be set to true if debugging is being done locally, and to false if the debugger is being created for the purpose of supporting remote debugging.
public boolean hasProcessList() throws DebuggerException
hasProcessList
in interface Debugger
DebuggerException
public java.util.List getProcessList() throws DebuggerException
Debugger
getProcessList
in interface Debugger
DebuggerException
public void attach(int processID) throws DebuggerException
attach
in interface Debugger
DebuggerException
public void attach(java.lang.String executableName, java.lang.String coreFileName) throws DebuggerException
attach
in interface Debugger
DebuggerException
public boolean detach()
public void suspend() throws DebuggerException
DebuggerException
public void resume() throws DebuggerException
DebuggerException
public boolean isSuspended() throws DebuggerException
DebuggerException
public Address parseAddress(java.lang.String addressString) throws java.lang.NumberFormatException
parseAddress
in interface Debugger
java.lang.NumberFormatException
public java.lang.String getOS()
public java.lang.String getCPU()
public boolean hasConsole() throws DebuggerException
Debugger
hasConsole
in interface Debugger
DebuggerException
public java.lang.String consoleExecuteCommand(java.lang.String cmd) throws DebuggerException
Debugger
consoleExecuteCommand
in interface Debugger
DebuggerException
public java.lang.String getConsolePrompt() throws DebuggerException
Debugger
getConsolePrompt
in interface Debugger
DebuggerException
public CDebugger getCDebugger() throws DebuggerException
Debugger
getCDebugger
in interface Debugger
DebuggerException
public Address lookup(java.lang.String objectName, java.lang.String symbol)
lookup
in interface SymbolLookup
public OopHandle lookupOop(java.lang.String objectName, java.lang.String symbol)
lookupOop
in interface SymbolLookup
public MachineDescription getMachineDescription()
getMachineDescription
in interface Debugger
getMachineDescription
in interface ProcDebugger
public void setMachineDescription(MachineDescription machDesc)
public int getRemoteProcessAddressSize() throws DebuggerException
DebuggerException
public ThreadProxy getThreadForIdentifierAddress(Address addr)
getThreadForIdentifierAddress
in interface ThreadAccess
public ThreadProxy getThreadForThreadId(long id)
ThreadAccess
getThreadForThreadId
in interface ThreadAccess
public long readJLong(long address) throws UnmappedAddressException, UnalignedAddressException
readJLong
in interface ProcDebugger
readJLong
in class DebuggerBase
UnmappedAddressException
UnalignedAddressException
public java.lang.String addressValueToString(long address)
addressValueToString
in interface ProcDebugger
public long readCInteger(long address, long numBytes, boolean isUnsigned) throws UnmappedAddressException, UnalignedAddressException
readCInteger
in interface ProcDebugger
readCInteger
in class DebuggerBase
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.proc.ProcAddress readAddress(long address) throws UnmappedAddressException, UnalignedAddressException
readAddress
in interface ProcDebugger
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.proc.ProcAddress readCompOopAddress(long address) throws UnmappedAddressException, UnalignedAddressException
readCompOopAddress
in interface ProcDebugger
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.proc.ProcAddress readCompKlassAddress(long address) throws UnmappedAddressException, UnalignedAddressException
readCompKlassAddress
in interface ProcDebugger
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.proc.ProcOopHandle readOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
readOopHandle
in interface ProcDebugger
UnmappedAddressException
UnalignedAddressException
NotInHeapException
public sun.jvm.hotspot.debugger.proc.ProcOopHandle readCompOopHandle(long address)
readCompOopHandle
in interface ProcDebugger
public void writeBytesToProcess(long address, long numBytes, byte[] data) throws UnmappedAddressException, DebuggerException
writeBytesToProcess
in interface Debugger
UnmappedAddressException
DebuggerException
public ReadResult readBytesFromProcess(long address, long numBytes) throws DebuggerException
readBytesFromProcess
in interface Debugger
DebuggerException
protected int getPageSize()
public long[] getThreadIntegerRegisterSet(int tid)
getThreadIntegerRegisterSet
in interface ProcDebugger
public long getAddressValue(Address addr)
getAddressValue
in interface Debugger
getAddressValue
in interface ProcDebugger
public Address newAddress(long value)
newAddress
in interface ProcDebugger
public java.util.List getThreadList() throws DebuggerException
getThreadList
in interface ProcDebugger
DebuggerException
public java.util.List getLoadObjectList() throws DebuggerException
getLoadObjectList
in interface ProcDebugger
DebuggerException
public CFrame topFrameForThread(ThreadProxy thread) throws DebuggerException
topFrameForThread
in interface ProcDebugger
DebuggerException
public ClosestSymbol lookup(long address)
lookup
in interface ProcDebugger
public java.lang.String demangle(java.lang.String name)
demangle
in interface ProcDebugger
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.