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.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private PageCache | |
| private CDebugger | |
| private static String | |
| private boolean | |
| private List | |
| private Map | |
| private long | |
| private long | |
| private long | |
| private long | |
| private long | |
| private long | |
| private long | |
| private static String | |
| private WindbgThreadFactory | |
| private Map | |
| private List | |
| private static boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized void | |
| public String | addressValueToString(long address)
Implements sun. From the WindbgDebugger interface |
| private synchronized void | |
| public synchronized void | attach(int processID)
Implements sun. From the Debugger interface via JVMDebugger |
| public synchronized void | attach(String executableName, String coreFileName)
Implements sun. From the Debugger interface via JVMDebugger |
| private native void | |
| private native void | |
| private void | |
| private void | |
| public synchronized String | consoleExecuteCommand(String cmd)
Implements sun. If the underlying debugger has a console (as dbx does), this provides access to it. |
| private native String | |
| private ClosestSymbol | |
| public synchronized boolean | detach()
Implements sun. From the Debugger interface via JVMDebugger |
| private native void | |
| private DLL | |
| private String | |
| public int | getAddressSize()
Implements sun. From the WindbgDebugger interface |
| public long | getAddressValue(Address addr)
Implements sun. From the Debugger interface |
| public CDebugger | getCDebugger()
Implements sun. If this platform supports C/C++ debugging via the CDebugger interface, returns a CDebugger object; otherwise returns null. |
| public String | getConsolePrompt()
Implements sun. If the underlying debugger has a console, this returns the debugger-specific prompt which should be displayed. |
| public String | getCPU()
Implements sun. From the Debugger interface via JVMDebugger |
| public List | |
| public MachineDescription | getMachineDescription()
Implements sun. From the Debugger interface |
| public String | getOS()
Implements sun. From the Debugger interface via JVMDebugger |
| public List | getProcessList()
Implements sun. From the Debugger interface via JVMDebugger |
| public synchronized WindbgDebugger. | getSenderRegs(Address sp, Address fp, Address pc)
Implements sun.
|
| private native long[] | |
| public ThreadProxy | getThreadForIdentifierAddress(Address addr)
Implements sun. From the ThreadAccess interface via Debugger and JVMDebugger |
| public ThreadProxy | getThreadForThreadId(long handle)
Implements sun. Gets an abstract ThreadProxy object for the thread identified by id or handle that is platform dependent |
| public long | getThreadIdFromSysId(long sysId)
Implements sun.
|
| private native long | |
| public synchronized long[] | getThreadIntegerRegisterSet(long threadId)
Implements sun.
|
| public synchronized List | |
| public boolean | hasConsole()
Implements sun. Find out whether this debugger has a console available on which commands can be executed; see executeCommandOnConsole, below. |
| public boolean | hasProcessList()
Implements sun. From the Debugger interface via JVMDebugger |
| private static native void | |
| public synchronized Address | lookup(String objectName, String symbol)
Implements sun. From the SymbolLookup interface via Debugger and JVMDebugger |
| public synchronized ClosestSymbol | |
| private native ClosestSymbol | |
| pack-priv synchronized long | |
| private native long | |
| public synchronized OopHandle | lookupOop(String objectName, String symbol)
Implements sun. From the SymbolLookup interface via Debugger and JVMDebugger |
| public Address | newAddress(long value)
Implements sun. From the WindbgDebugger interface |
| public Address | parseAddress(String addressString)
Implements sun. From the Debugger interface via JVMDebugger |
| public WindbgAddress | readAddress(long address)
Implements sun. From the WindbgDebugger interface |
| public synchronized ReadResult | readBytesFromProcess(long address, long numBytes)
Implements sun. This reads bytes from the remote process. |
| private native byte[] | |
| public WindbgAddress | readCompKlassAddress(long address)
Implements sun.
|
| public WindbgAddress | readCompOopAddress(long address)
Implements sun.
|
| public WindbgOopHandle | readCompOopHandle(long address)
Implements sun.
|
| public WindbgOopHandle | readOopHandle(long address)
Implements sun. From the WindbgDebugger interface |
| private void | |
| private void | |
| private synchronized void |
| attached | back to summary |
|---|---|
| private boolean attached | |
| cache | back to summary |
|---|---|
| private PageCache cache | |
| cdbg | back to summary |
|---|---|
| private CDebugger cdbg | |
| imagePath | back to summary |
|---|---|
| private static String imagePath | |
| isCore | back to summary |
|---|---|
| private boolean isCore | |
| loadObjects | back to summary |
|---|---|
| private List<LoadObject> loadObjects | |
| nameToDllMap | back to summary |
|---|---|
| private Map<String, DLL> nameToDllMap | |
| ptrIDebugAdvanced | back to summary |
|---|---|
| private long ptrIDebugAdvanced | |
| ptrIDebugClient | back to summary |
|---|---|
| private long ptrIDebugClient | |
| ptrIDebugControl | back to summary |
|---|---|
| private long ptrIDebugControl | |
| ptrIDebugDataSpaces | back to summary |
|---|---|
| private long ptrIDebugDataSpaces | |
| ptrIDebugOutputCallbacks | back to summary |
|---|---|
| private long ptrIDebugOutputCallbacks | |
| ptrIDebugSymbols | back to summary |
|---|---|
| private long ptrIDebugSymbols | |
| ptrIDebugSystemObjects | back to summary |
|---|---|
| private long ptrIDebugSystemObjects | |
| symbolPath | back to summary |
|---|---|
| private static String symbolPath | |
| threadFactory | back to summary |
|---|---|
| private WindbgThreadFactory threadFactory | |
| threadIntegerRegisterSet | back to summary |
|---|---|
| private Map<Long, long[]> threadIntegerRegisterSet | |
| threadList | back to summary |
|---|---|
| private List<ThreadProxy> threadList | |
| useNativeLookup | back to summary |
|---|---|
| private static boolean useNativeLookup | |
| WindbgDebuggerLocal | back 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. | |
| addLoadObject | back to summary |
|---|---|
| private synchronized void addLoadObject(String file, long size, long base) | |
| addressValueToString | back to summary |
|---|---|
| public String addressValueToString(long address) Implements sun. From the WindbgDebugger interface | |
| addThread | back to summary |
|---|---|
| private synchronized void addThread(long sysId) | |
| attach | back to summary |
|---|---|
| public synchronized void attach(int processID) throws DebuggerException Implements sun. From the Debugger interface via JVMDebugger | |
| attach | back to summary |
|---|---|
| public synchronized void attach(String executableName, String coreFileName) throws DebuggerException Implements sun. From the Debugger interface via JVMDebugger | |
| attach0 | back to summary |
|---|---|
| private native void attach0(String executableName, String coreFileName) | |
| attach0 | back to summary |
|---|---|
| private native void attach0(int processID) | |
| attachInit | back to summary |
|---|---|
| private void attachInit() | |
| checkAttached | back to summary |
|---|---|
| private void checkAttached() | |
| consoleExecuteCommand | back to summary |
|---|---|
| public synchronized String consoleExecuteCommand(String cmd) throws DebuggerException Implements sun. Doc from sun. 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. | |
| consoleExecuteCommand0 | back to summary |
|---|---|
| private native String consoleExecuteCommand0(String cmd) | |
| createClosestSymbol | back to summary |
|---|---|
| private ClosestSymbol createClosestSymbol(String symbol, long diff) | |
| detach | back to summary |
|---|---|
| public synchronized boolean detach() Implements sun. From the Debugger interface via JVMDebugger | |
| detach0 | back to summary |
|---|---|
| private native void detach0() | |
| findDLLByName | back to summary |
|---|---|
| private DLL findDLLByName(String fullPathName) | |
| findFullPath | back to summary |
|---|---|
| private String findFullPath(String file) | |
| getAddressSize | back to summary |
|---|---|
| public int getAddressSize() Implements sun. From the WindbgDebugger interface | |
| getAddressValue | back to summary |
|---|---|
| public long getAddressValue(Address addr) Implements sun. From the Debugger interface | |
| getCDebugger | back to summary |
|---|---|
| public CDebugger getCDebugger() throws DebuggerException Implements sun. Doc from sun. If this platform supports C/C++ debugging via the CDebugger interface, returns a CDebugger object; otherwise returns null. | |
| getConsolePrompt | back to summary |
|---|---|
| public String getConsolePrompt() throws DebuggerException Implements sun. Doc from sun. If the underlying debugger has a console, this returns the debugger-specific prompt which should be displayed. | |
| getCPU | back to summary |
|---|---|
| public String getCPU() Implements sun. From the Debugger interface via JVMDebugger | |
| getLoadObjectList | back to summary |
|---|---|
| public List Implements sun. | |
| getMachineDescription | back to summary |
|---|---|
| public MachineDescription getMachineDescription() Implements sun. From the Debugger interface | |
| getOS | back to summary |
|---|---|
| public String getOS() Implements sun. From the Debugger interface via JVMDebugger | |
| getProcessList | back to summary |
|---|---|
| public List Implements sun. From the Debugger interface via JVMDebugger | |
| getSenderRegs | back to summary |
|---|---|
| public synchronized WindbgDebugger. Implements sun. | |
| getSenderRegs0 | back to summary |
|---|---|
| private native long[] getSenderRegs0(long sp, long fp, long pc) | |
| getThreadForIdentifierAddress | back to summary |
|---|---|
| public ThreadProxy getThreadForIdentifierAddress(Address addr) Implements sun. From the ThreadAccess interface via Debugger and JVMDebugger | |
| getThreadForThreadId | back to summary |
|---|---|
| public ThreadProxy getThreadForThreadId(long handle) Implements sun. Doc from sun. Gets an abstract ThreadProxy object for the thread identified by id or handle that is platform dependent | |
| getThreadIdFromSysId | back to summary |
|---|---|
| public long getThreadIdFromSysId(long sysId) throws DebuggerException Implements sun. | |
| getThreadIdFromSysId0 | back to summary |
|---|---|
| private native long getThreadIdFromSysId0(long sysId) | |
| getThreadIntegerRegisterSet | back to summary |
|---|---|
| public synchronized long[] getThreadIntegerRegisterSet(long threadId) throws DebuggerException Implements sun. | |
| getThreadList | back to summary |
|---|---|
| public synchronized List Implements sun. | |
| hasConsole | back to summary |
|---|---|
| public boolean hasConsole() throws DebuggerException Implements sun. Doc from sun. 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. | |
| hasProcessList | back to summary |
|---|---|
| public boolean hasProcessList() throws DebuggerException Implements sun. From the Debugger interface via JVMDebugger | |
| initIDs | back to summary |
|---|---|
| private static native void initIDs() | |
| lookup | back to summary |
|---|---|
| public synchronized Address lookup(String objectName, String symbol) Implements sun. From the SymbolLookup interface via Debugger and JVMDebugger | |
| lookup | back to summary |
|---|---|
| public synchronized ClosestSymbol lookup(long address) | |
| lookupByAddress0 | back to summary |
|---|---|
| private native ClosestSymbol lookupByAddress0(long address) | |
| lookupByName | back to summary |
|---|---|
| pack-priv synchronized long lookupByName(String objectName, String symbol) | |
| lookupByName0 | back to summary |
|---|---|
| private native long lookupByName0(String objName, String symName) | |
| lookupOop | back to summary |
|---|---|
| public synchronized OopHandle lookupOop(String objectName, String symbol) Implements sun. From the SymbolLookup interface via Debugger and JVMDebugger | |
| newAddress | back to summary |
|---|---|
| public Address newAddress(long value) Implements sun. From the WindbgDebugger interface | |
| parseAddress | back to summary |
|---|---|
| public Address parseAddress(String addressString) throws NumberFormatException Implements sun. From the Debugger interface via JVMDebugger | |
| readAddress | back to summary |
|---|---|
| public WindbgAddress readAddress(long address) throws UnmappedAddressException, UnalignedAddressException Implements sun. From the WindbgDebugger interface | |
| readBytesFromProcess | back to summary |
|---|---|
| public synchronized ReadResult readBytesFromProcess(long address, long numBytes) throws UnmappedAddressException, DebuggerException Implements sun. This reads bytes from the remote process. | |
| readBytesFromProcess0 | back to summary |
|---|---|
| private native byte[] readBytesFromProcess0(long address, long numBytes) throws UnmappedAddressException, DebuggerException | |
| readCompKlassAddress | back to summary |
|---|---|
| public WindbgAddress readCompKlassAddress(long address) throws UnmappedAddressException, UnalignedAddressException Implements sun. | |
| readCompOopAddress | back to summary |
|---|---|
| public WindbgAddress readCompOopAddress(long address) throws UnmappedAddressException, UnalignedAddressException Implements sun. | |
| readCompOopHandle | back to summary |
|---|---|
| public WindbgOopHandle readCompOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException Implements sun. | |
| readOopHandle | back to summary |
|---|---|
| public WindbgOopHandle readOopHandle(long address) throws UnmappedAddressException, UnalignedAddressException, NotInHeapException Implements sun. From the WindbgDebugger interface | |
| requireAttach | back to summary |
|---|---|
| private void requireAttach() | |
| resetNativePointers | back to summary |
|---|---|
| private void resetNativePointers() | |
| setThreadIntegerRegisterSet | back to summary |
|---|---|
| private synchronized void setThreadIntegerRegisterSet(long threadId, long[] regs) | |