public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
An implementation of the JVMDebugger interface which talks to windbg and symbol table management is done in Java.
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.
heapOopSize, javaPrimitiveTypesConfigured, jbooleanSize, jbyteSize, jcharSize, jdoubleSize, jfloatSize, jintSize, jlongSize, jshortSize, klassPtrSize, machDesc, narrowKlassBase, narrowKlassShift, narrowOopBase, narrowOopShift, oopSize, utils
Constructor and Description |
---|
WindbgDebuggerLocal(MachineDescription machDesc,
boolean useCache)
machDesc may not be null.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addressValueToString(long address)
From the WindbgDebugger 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.
|
boolean |
detach()
From the Debugger interface via JVMDebugger
|
int |
getAddressSize()
From the WindbgDebugger interface
|
long |
getAddressValue(Address addr)
From the Debugger 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() |
MachineDescription |
getMachineDescription()
From the Debugger interface
|
java.lang.String |
getOS()
From the Debugger interface via JVMDebugger
|
java.util.List |
getProcessList()
From the Debugger interface via JVMDebugger
|
ThreadProxy |
getThreadForIdentifierAddress(Address addr)
From the ThreadAccess interface via Debugger and JVMDebugger
|
ThreadProxy |
getThreadForThreadId(long handle)
Gets an abstract ThreadProxy object for the thread identified by
id or handle that is platform dependent
|
long |
getThreadIdFromSysId(long sysId) |
long[] |
getThreadIntegerRegisterSet(long threadId) |
java.util.List |
getThreadList() |
boolean |
hasConsole()
Find out whether this debugger has a console available on which
commands can be executed; see executeCommandOnConsole, below.
|
boolean |
hasProcessList()
From the Debugger interface via JVMDebugger
|
ClosestSymbol |
lookup(long address) |
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 WindbgDebugger interface
|
Address |
parseAddress(java.lang.String addressString)
From the Debugger interface via JVMDebugger
|
sun.jvm.hotspot.debugger.windbg.WindbgAddress |
readAddress(long address)
From the WindbgDebugger interface
|
ReadResult |
readBytesFromProcess(long address,
long numBytes)
This reads bytes from the remote process.
|
sun.jvm.hotspot.debugger.windbg.WindbgAddress |
readCompKlassAddress(long address) |
sun.jvm.hotspot.debugger.windbg.WindbgAddress |
readCompOopAddress(long address) |
sun.jvm.hotspot.debugger.windbg.WindbgOopHandle |
readCompOopHandle(long address) |
long |
readJLong(long address) |
sun.jvm.hotspot.debugger.windbg.WindbgOopHandle |
readOopHandle(long address)
From the WindbgDebugger 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, readCInteger, 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
readCInteger, readJBoolean, readJByte, readJChar, readJDouble, readJFloat, readJInt, readJShort
configureJavaPrimitiveTypeSizes, putHeapConst
getHeapOopSize, getJBooleanSize, getJByteSize, getJCharSize, getJDoubleSize, getJFloatSize, getJIntSize, getJLongSize, getJShortSize, getKlassPtrSize, getNarrowKlassBase, getNarrowKlassShift, getNarrowOopBase, getNarrowOopShift
public WindbgDebuggerLocal(MachineDescription machDesc, boolean useCache) throws DebuggerException
machDesc may not be null.
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.
DebuggerException
public boolean hasProcessList() throws DebuggerException
hasProcessList
in interface Debugger
DebuggerException
public java.util.List getProcessList() throws DebuggerException
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 java.util.List getLoadObjectList()
getLoadObjectList
in interface WindbgDebugger
public boolean detach()
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 ClosestSymbol lookup(long address)
public MachineDescription getMachineDescription()
getMachineDescription
in interface Debugger
public ThreadProxy getThreadForIdentifierAddress(Address addr)
getThreadForIdentifierAddress
in interface ThreadAccess
public ThreadProxy getThreadForThreadId(long handle)
ThreadAccess
getThreadForThreadId
in interface ThreadAccess
public long getThreadIdFromSysId(long sysId) throws DebuggerException
getThreadIdFromSysId
in interface WindbgDebugger
DebuggerException
public long readJLong(long address) throws UnmappedAddressException, UnalignedAddressException
readJLong
in interface WindbgDebugger
readJLong
in class DebuggerBase
UnmappedAddressException
UnalignedAddressException
public java.lang.String addressValueToString(long address)
addressValueToString
in interface WindbgDebugger
public sun.jvm.hotspot.debugger.windbg.WindbgAddress readAddress(long address) throws UnmappedAddressException, UnalignedAddressException
readAddress
in interface WindbgDebugger
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.windbg.WindbgAddress readCompOopAddress(long address) throws UnmappedAddressException, UnalignedAddressException
readCompOopAddress
in interface WindbgDebugger
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.windbg.WindbgAddress readCompKlassAddress(long address) throws UnmappedAddressException, UnalignedAddressException
readCompKlassAddress
in interface WindbgDebugger
UnmappedAddressException
UnalignedAddressException
public sun.jvm.hotspot.debugger.windbg.WindbgOopHandle readOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
readOopHandle
in interface WindbgDebugger
UnmappedAddressException
UnalignedAddressException
NotInHeapException
public sun.jvm.hotspot.debugger.windbg.WindbgOopHandle readCompOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
readCompOopHandle
in interface WindbgDebugger
UnmappedAddressException
UnalignedAddressException
NotInHeapException
public int getAddressSize()
getAddressSize
in interface WindbgDebugger
public long[] getThreadIntegerRegisterSet(long threadId) throws DebuggerException
getThreadIntegerRegisterSet
in interface WindbgDebugger
DebuggerException
public java.util.List getThreadList() throws DebuggerException
getThreadList
in interface WindbgDebugger
DebuggerException
public long getAddressValue(Address addr)
getAddressValue
in interface Debugger
public Address newAddress(long value)
newAddress
in interface WindbgDebugger
public ReadResult readBytesFromProcess(long address, long numBytes) throws UnmappedAddressException, DebuggerException
readBytesFromProcess
in interface Debugger
UnmappedAddressException
DebuggerException
public void writeBytesToProcess(long address, long numBytes, byte[] data) throws UnmappedAddressException, DebuggerException
writeBytesToProcess
in interface Debugger
UnmappedAddressException
DebuggerException
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.