APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot.debugger.windbg

public Class WindbgDebuggerLocal

extends DebuggerBase
implements WindbgDebugger
Class Inheritance
All Implemented Interfaces
sun.jvm.hotspot.debugger.windbg.WindbgDebugger, sun.jvm.hotspot.debugger.JVMDebugger, sun.jvm.hotspot.debugger.Debugger, sun.jvm.hotspot.debugger.ThreadAccess, sun.jvm.hotspot.debugger.SymbolLookup
Annotations
@SuppressWarnings:restricted
Imports
java.io.*, java.net.*, java.util.*, sun.jvm.hotspot.debugger.*, sun.jvm.hotspot.debugger.aarch64.*, sun.jvm.hotspot.debugger.amd64.*, sun.jvm.hotspot.debugger.windbg.aarch64.*, sun.jvm.hotspot.debugger.windbg.amd64.*, sun.jvm.hotspot.debugger.win32.coff.*, sun.jvm.hotspot.debugger.cdbg.*, sun.jvm.hotspot.debugger.cdbg.basic.BasicDebugEvent, sun.jvm.hotspot.utilities.*, sun.jvm.hotspot.utilities.memo.*, sun.jvm.hotspot.runtime.*

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.

Field Summary

Modifier and TypeField and Description
private boolean
private PageCache
private CDebugger
private static String
private boolean
private List<LoadObject>
private Map<String, DLL>
private long
private long
private long
private long
private long
private long
private long
private static String
private WindbgThreadFactory
private Map<Long, long[]>
private List<ThreadProxy>
private static boolean
Inherited from sun.jvm.hotspot.debugger.DebuggerBase:
heapOopSizejavaPrimitiveTypesConfiguredjbooleanSizejbyteSizejcharSizejdoubleSizejfloatSizejintSizejlongSizejshortSizeklassPtrSizemachDescnarrowKlassBasenarrowKlassShiftnarrowOopBasenarrowOopShiftoopSizeutils

Constructor Summary

AccessConstructor and Description
public
WindbgDebuggerLocal(MachineDescription machDesc, boolean useCache)

machDesc may not be null.

Method Summary

Modifier and TypeMethod and Description
private synchronized void
addLoadObject(String file, long size, long base)

public String
addressValueToString(long address)

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.addressValueToString.

From the WindbgDebugger interface

private synchronized void
addThread(long sysId)

public synchronized void
attach(int processID)

Implements sun.jvm.hotspot.debugger.Debugger.attach.

From the Debugger interface via JVMDebugger

public synchronized void
attach(String executableName, String coreFileName)

Implements sun.jvm.hotspot.debugger.Debugger.attach.

From the Debugger interface via JVMDebugger

private native void
attach0(String executableName, String coreFileName)

private native void
attach0(int processID)

private void
private void
public synchronized String
consoleExecuteCommand(String cmd)

Implements sun.jvm.hotspot.debugger.Debugger.consoleExecuteCommand.

If the underlying debugger has a console (as dbx does), this provides access to it.

private native String
private ClosestSymbol
createClosestSymbol(String symbol, long diff)

public synchronized boolean
detach()

Implements sun.jvm.hotspot.debugger.Debugger.detach.

From the Debugger interface via JVMDebugger

private native void
private DLL
findDLLByName(String fullPathName)

private String
public int
public long
getAddressValue(Address addr)

Implements sun.jvm.hotspot.debugger.Debugger.getAddressValue.

From the Debugger interface

public CDebugger
getCDebugger()

Implements sun.jvm.hotspot.debugger.Debugger.getCDebugger.

If this platform supports C/C++ debugging via the CDebugger interface, returns a CDebugger object; otherwise returns null.

public String
getConsolePrompt()

Implements sun.jvm.hotspot.debugger.Debugger.getConsolePrompt.

If the underlying debugger has a console, this returns the debugger-specific prompt which should be displayed.

public String
getCPU()

Implements sun.jvm.hotspot.debugger.Debugger.getCPU.

From the Debugger interface via JVMDebugger

public List<LoadObject>
public MachineDescription
public String
getOS()

Implements sun.jvm.hotspot.debugger.Debugger.getOS.

From the Debugger interface via JVMDebugger

public List<ProcessInfo>
getProcessList()

Implements sun.jvm.hotspot.debugger.Debugger.getProcessList.

From the Debugger interface via JVMDebugger

public synchronized WindbgDebugger.SenderRegs
private native long[]
getSenderRegs0(long sp, long fp, long pc)

public ThreadProxy
getThreadForIdentifierAddress(Address addr)

Implements sun.jvm.hotspot.debugger.ThreadAccess.getThreadForIdentifierAddress.

From the ThreadAccess interface via Debugger and JVMDebugger

public ThreadProxy
getThreadForThreadId(long handle)

Implements sun.jvm.hotspot.debugger.ThreadAccess.getThreadForThreadId.

Gets an abstract ThreadProxy object for the thread identified by id or handle that is platform dependent

public long
private native long
public synchronized long[]
public synchronized List<ThreadProxy>
public boolean
hasConsole()

Implements sun.jvm.hotspot.debugger.Debugger.hasConsole.

Find out whether this debugger has a console available on which commands can be executed; see executeCommandOnConsole, below.

public boolean
hasProcessList()

Implements sun.jvm.hotspot.debugger.Debugger.hasProcessList.

From the Debugger interface via JVMDebugger

private static native void
public synchronized Address
lookup(String objectName, String symbol)

Implements sun.jvm.hotspot.debugger.SymbolLookup.lookup.

From the SymbolLookup interface via Debugger and JVMDebugger

public synchronized ClosestSymbol
lookup(long address)

private native ClosestSymbol
lookupByAddress0(long address)

pack-priv synchronized long
lookupByName(String objectName, String symbol)

private native long
lookupByName0(String objName, String symName)

public synchronized OopHandle
lookupOop(String objectName, String symbol)

Implements sun.jvm.hotspot.debugger.SymbolLookup.lookupOop.

From the SymbolLookup interface via Debugger and JVMDebugger

public Address
newAddress(long value)

Implements sun.jvm.hotspot.debugger.JVMDebugger.newAddress.

From the WindbgDebugger interface

public Address
parseAddress(String addressString)

Implements sun.jvm.hotspot.debugger.Debugger.parseAddress.

From the Debugger interface via JVMDebugger

public WindbgAddress
readAddress(long address)

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readAddress.

From the WindbgDebugger interface

public synchronized ReadResult
readBytesFromProcess(long address, long numBytes)

Implements sun.jvm.hotspot.debugger.Debugger.readBytesFromProcess.

This reads bytes from the remote process.

private native byte[]
readBytesFromProcess0(long address, long numBytes)

public WindbgAddress
public WindbgAddress
public WindbgOopHandle
public WindbgOopHandle
readOopHandle(long address)

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readOopHandle.

From the WindbgDebugger interface

private void
private void
private synchronized void
setThreadIntegerRegisterSet(long threadId, long[] regs)

Inherited from sun.jvm.hotspot.debugger.DebuggerBase:
checkConfiguredcheckJavaConfiguredclearCacheconfigureJavaPrimitiveTypeSizesdisableCacheenableCachefindSymbolgetHeapOopSizegetJBooleanSizegetJByteSizegetJCharSizegetJDoubleSizegetJFloatSizegetJIntSizegetJLongSizegetJShortSizegetKlassPtrSizegetNarrowKlassBasegetNarrowKlassShiftgetNarrowOopBasegetNarrowOopShiftinitCacheinvalidatePageCacheparseCacheNumPagesPropertyputHeapConstreadAddressValuereadBytesreadCIntegerreadCompKlassAddressValuereadCompOopAddressValuereadJBooleanreadJBytereadJCharreadJDoublereadJFloatreadJIntreadJLongreadJShortsetBigEndian

Field Detail

attachedback to summary
private boolean attached
cacheback to summary
private PageCache cache

Hides sun.jvm.hotspot.debugger.DebuggerBase.cache.

cdbgback to summary
private CDebugger cdbg
imagePathback to summary
private static String imagePath
isCoreback to summary
private boolean isCore
loadObjectsback to summary
private List<LoadObject> loadObjects
nameToDllMapback to summary
private Map<String, DLL> nameToDllMap
ptrIDebugAdvancedback to summary
private long ptrIDebugAdvanced
ptrIDebugClientback to summary
private long ptrIDebugClient
ptrIDebugControlback to summary
private long ptrIDebugControl
ptrIDebugDataSpacesback to summary
private long ptrIDebugDataSpaces
ptrIDebugOutputCallbacksback to summary
private long ptrIDebugOutputCallbacks
ptrIDebugSymbolsback to summary
private long ptrIDebugSymbols
ptrIDebugSystemObjectsback to summary
private long ptrIDebugSystemObjects
symbolPathback to summary
private static String symbolPath
threadFactoryback to summary
private WindbgThreadFactory threadFactory
threadIntegerRegisterSetback to summary
private Map<Long, long[]> threadIntegerRegisterSet
threadListback to summary
private List<ThreadProxy> threadList
useNativeLookupback to summary
private static boolean useNativeLookup

Constructor Detail

WindbgDebuggerLocalback to summary
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.

Method Detail

addLoadObjectback to summary
private synchronized void addLoadObject(String file, long size, long base)
addressValueToStringback to summary
public String addressValueToString(long address)

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.addressValueToString.

From the WindbgDebugger interface

addThreadback to summary
private synchronized void addThread(long sysId)
attachback to summary
public synchronized void attach(int processID) throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.attach.

From the Debugger interface via JVMDebugger

attachback to summary
public synchronized void attach(String executableName, String coreFileName) throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.attach.

From the Debugger interface via JVMDebugger

attach0back to summary
private native void attach0(String executableName, String coreFileName)
attach0back to summary
private native void attach0(int processID)
attachInitback to summary
private void attachInit()
checkAttachedback to summary
private void checkAttached()
consoleExecuteCommandback to summary
public synchronized String consoleExecuteCommand(String cmd) throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.consoleExecuteCommand.

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

If the underlying debugger has a console (as dbx does), this provides access to it. Takes in a platform-dependent String, executes it on the debugger's console, and returns any output as a String.

consoleExecuteCommand0back to summary
private native String consoleExecuteCommand0(String cmd)
createClosestSymbolback to summary
private ClosestSymbol createClosestSymbol(String symbol, long diff)
detachback to summary
public synchronized boolean detach()

Implements sun.jvm.hotspot.debugger.Debugger.detach.

From the Debugger interface via JVMDebugger

detach0back to summary
private native void detach0()
findDLLByNameback to summary
private DLL findDLLByName(String fullPathName)
findFullPathback to summary
private String findFullPath(String file)
getAddressSizeback to summary
public int getAddressSize()

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.getAddressSize.

From the WindbgDebugger interface

getAddressValueback to summary
public long getAddressValue(Address addr)

Implements sun.jvm.hotspot.debugger.Debugger.getAddressValue.

From the Debugger interface

getCDebuggerback to summary
public CDebugger getCDebugger() throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.getCDebugger.

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

If this platform supports C/C++ debugging via the CDebugger interface, returns a CDebugger object; otherwise returns null.

getConsolePromptback to summary
public String getConsolePrompt() throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.getConsolePrompt.

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

If the underlying debugger has a console, this returns the debugger-specific prompt which should be displayed.

getCPUback to summary
public String getCPU()

Implements sun.jvm.hotspot.debugger.Debugger.getCPU.

From the Debugger interface via JVMDebugger

getLoadObjectListback to summary
public List<LoadObject> getLoadObjectList()

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.getLoadObjectList.

getMachineDescriptionback to summary
public MachineDescription getMachineDescription()

Implements sun.jvm.hotspot.debugger.Debugger.getMachineDescription.

From the Debugger interface

getOSback to summary
public String getOS()

Implements sun.jvm.hotspot.debugger.Debugger.getOS.

From the Debugger interface via JVMDebugger

getProcessListback to summary
public List<ProcessInfo> getProcessList() throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.getProcessList.

From the Debugger interface via JVMDebugger

getSenderRegsback to summary
public synchronized WindbgDebugger.SenderRegs getSenderRegs(Address sp, Address fp, Address pc)

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.getSenderRegs.

getSenderRegs0back to summary
private native long[] getSenderRegs0(long sp, long fp, long pc)
getThreadForIdentifierAddressback to summary
public ThreadProxy getThreadForIdentifierAddress(Address addr)

Implements sun.jvm.hotspot.debugger.ThreadAccess.getThreadForIdentifierAddress.

From the ThreadAccess interface via Debugger and JVMDebugger

getThreadForThreadIdback to summary
public ThreadProxy getThreadForThreadId(long handle)

Implements sun.jvm.hotspot.debugger.ThreadAccess.getThreadForThreadId.

Doc from sun.jvm.hotspot.debugger.ThreadAccess.getThreadForThreadId.

Gets an abstract ThreadProxy object for the thread identified by id or handle that is platform dependent

getThreadIdFromSysIdback to summary
public long getThreadIdFromSysId(long sysId) throws DebuggerException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.getThreadIdFromSysId.

getThreadIdFromSysId0back to summary
private native long getThreadIdFromSysId0(long sysId)
getThreadIntegerRegisterSetback to summary
public synchronized long[] getThreadIntegerRegisterSet(long threadId) throws DebuggerException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.getThreadIntegerRegisterSet.

getThreadListback to summary
public synchronized List<ThreadProxy> getThreadList() throws DebuggerException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.getThreadList.

hasConsoleback to summary
public boolean hasConsole() throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.hasConsole.

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

Find out whether this debugger has a console available on which commands can be executed; see executeCommandOnConsole, below. This is an interim routine designed to allow access to the underlying dbx process on Solaris until we have disassembly, etc. in the SA.

hasProcessListback to summary
public boolean hasProcessList() throws DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.hasProcessList.

From the Debugger interface via JVMDebugger

initIDsback to summary
private static native void initIDs()
lookupback to summary
public synchronized Address lookup(String objectName, String symbol)

Implements sun.jvm.hotspot.debugger.SymbolLookup.lookup.

From the SymbolLookup interface via Debugger and JVMDebugger

lookupback to summary
public synchronized ClosestSymbol lookup(long address)
lookupByAddress0back to summary
private native ClosestSymbol lookupByAddress0(long address)
lookupByNameback to summary
pack-priv synchronized long lookupByName(String objectName, String symbol)
lookupByName0back to summary
private native long lookupByName0(String objName, String symName)
lookupOopback to summary
public synchronized OopHandle lookupOop(String objectName, String symbol)

Implements sun.jvm.hotspot.debugger.SymbolLookup.lookupOop.

From the SymbolLookup interface via Debugger and JVMDebugger

newAddressback to summary
public Address newAddress(long value)

Implements sun.jvm.hotspot.debugger.JVMDebugger.newAddress.

From the WindbgDebugger interface

parseAddressback to summary
public Address parseAddress(String addressString) throws NumberFormatException

Implements sun.jvm.hotspot.debugger.Debugger.parseAddress.

From the Debugger interface via JVMDebugger

readAddressback to summary
public WindbgAddress readAddress(long address) throws UnmappedAddressException, UnalignedAddressException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readAddress.

From the WindbgDebugger interface

readBytesFromProcessback to summary
public synchronized ReadResult readBytesFromProcess(long address, long numBytes) throws UnmappedAddressException, DebuggerException

Implements sun.jvm.hotspot.debugger.Debugger.readBytesFromProcess.

This reads bytes from the remote process.

readBytesFromProcess0back to summary
private native byte[] readBytesFromProcess0(long address, long numBytes) throws UnmappedAddressException, DebuggerException
readCompKlassAddressback to summary
public WindbgAddress readCompKlassAddress(long address) throws UnmappedAddressException, UnalignedAddressException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readCompKlassAddress.

readCompOopAddressback to summary
public WindbgAddress readCompOopAddress(long address) throws UnmappedAddressException, UnalignedAddressException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readCompOopAddress.

readCompOopHandleback to summary
public WindbgOopHandle readCompOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readCompOopHandle.

readOopHandleback to summary
public WindbgOopHandle readOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException

Implements sun.jvm.hotspot.debugger.windbg.WindbgDebugger.readOopHandle.

From the WindbgDebugger interface

requireAttachback to summary
private void requireAttach()
resetNativePointersback to summary
private void resetNativePointers()
setThreadIntegerRegisterSetback to summary
private synchronized void setThreadIntegerRegisterSet(long threadId, long[] regs)