Top Description Fields Constructors Methods
sun.jvm.hotspot.debugger.dummy

public Class DummyDebugger

extends DebuggerBase
Class Inheritance
Imports
java.util.*, sun.jvm.hotspot.debugger.*, sun.jvm.hotspot.debugger.cdbg.CDebugger, sun.jvm.hotspot.utilities.*

For testing purposes

Field Summary

Modifier and TypeField and Description
private MachineDescription
Inherited from sun.jvm.hotspot.debugger.DebuggerBase:
heapOopSizejavaPrimitiveTypesConfiguredjbooleanSizejbyteSizejcharSizejdoubleSizejfloatSizejintSizejlongSizejshortSizeklassPtrSizenarrowKlassBasenarrowKlassShiftnarrowOopBasenarrowOopShiftoopSizeutils

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv String
public void
attach(int processID)

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

If an error occurs during attachment (i.e., "no such process"), the thrown DebuggerException will contain a description of the error in its message string.
public void
attach(String executableName, String coreFileName)

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

This attaches the debugger to the given coreFileName, which is assumed to have been generated from the specified executableName.
private int
charToNibble(char ascii)

public 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.
public boolean
detach()

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

Detach from the remote process.
public long
getAddressValue(Address addr)

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

Returns the 64-bit value of an Address.
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.

Support for remote debugging.
public MachineDescription
getMachineDescription()

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

Retrieve the machine description for the underlying hardware for the cases in which we need to do, for example, machine-dependent byte swapping
public String
getOS()

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

Support for remote debugging.
public List<ProcessInfo>
getProcessList()

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

Provide a snapshot of the list of currently-running processes in the form of a List of ProcessInfo objects.
public ThreadProxy
getThreadForIdentifierAddress(Address addr)

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

Gets an abstract ThreadProxy object for the thread identified by the contents of the memory location pointed to by addr.
public ThreadProxy
getThreadForThreadId(long id)

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 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.

Indicates whether this underlying debugger can provide a list of currently-running processes.
public Address
lookup(String objectName, String symbol)

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

Looks up the given symbol in the context of the given object.
public OopHandle
lookupOop(String objectName, String symbol)

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

Looks up the given symbol in the context of the given object, assuming that symbol refers to a Java object.
public Address
parseAddress(String addrStr)

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

Parse an address from a hex string in the format "0xFFFFFFFF".
public ReadResult
Inherited from sun.jvm.hotspot.debugger.DebuggerBase:
checkConfiguredcheckJavaConfiguredclearCacheconfigureJavaPrimitiveTypeSizesdisableCacheenableCachefindSymbolgetHeapOopSizegetJBooleanSizegetJByteSizegetJCharSizegetJDoubleSizegetJFloatSizegetJIntSizegetJLongSizegetJShortSizegetKlassPtrSizegetNarrowKlassBasegetNarrowKlassShiftgetNarrowOopBasegetNarrowOopShiftinitCacheinvalidatePageCacheparseCacheNumPagesPropertyputHeapConstreadAddressValuereadBytesreadCIntegerreadCompKlassAddressValuereadCompOopAddressValuereadJBooleanreadJBytereadJCharreadJDoublereadJFloatreadJIntreadJLongreadJShortsetBigEndian

Field Detail

machDescback to summary
private MachineDescription machDesc

Hides sun.jvm.hotspot.debugger.DebuggerBase.machDesc.

Constructor Detail

DummyDebuggerback to summary
public DummyDebugger(MachineDescription machDesc)

Method Detail

addressToStringback to summary
pack-priv String addressToString(DummyAddress addr)
attachback to summary
public void attach(int processID) throws DebuggerException

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

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

If an error occurs during attachment (i.e., "no such process"), the thrown DebuggerException will contain a description of the error in its message string.

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

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

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

This attaches the debugger to the given coreFileName, which is assumed to have been generated from the specified executableName. If an error occurs during loading of the core file (i.e., "no such file"), the thrown DebuggerException will contain a description of the error in its message string.

charToNibbleback to summary
private int charToNibble(char ascii) throws NumberFormatException
consoleExecuteCommandback to summary
public 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.

detachback to summary
public boolean detach()

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

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

Detach from the remote process. Returns false if not currently attached.

getAddressValueback to summary
public long getAddressValue(Address addr)

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

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

Returns the 64-bit value of an Address. This method should ONLY be used when implementing a debugger which needs to interface to C and which needs a unique identifier for certain objects.

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.

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

Support for remote debugging. Get the name of the CPU type on which this debugger is running (to be able to properly configure the local system). Typical return value is "x86"; see utilities/PlatformInfo.java.

getMachineDescriptionback to summary
public MachineDescription getMachineDescription() throws DebuggerException

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

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

Retrieve the machine description for the underlying hardware for the cases in which we need to do, for example, machine-dependent byte swapping

getOSback to summary
public String getOS()

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

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

Support for remote debugging. Get the name of the operating system on which this debugger is running (to be able to properly configure the local system). Typical return values are "linux", "win32"; see utilities/PlatformInfo.java.

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

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

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

Provide a snapshot of the list of currently-running processes in the form of a List of ProcessInfo objects. Must only be called if hasProcessList(), above, returns true.

getThreadForIdentifierAddressback to summary
public ThreadProxy getThreadForIdentifierAddress(Address addr)

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

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

Gets an abstract ThreadProxy object for the thread identified by the contents of the memory location pointed to by addr. The contents at location addr are inherently platform-dependent; see the documentation for this class for more information. FIXME: what exception, if any, should this throw?

getThreadForThreadIdback to summary
public ThreadProxy getThreadForThreadId(long id)

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

hasConsoleback to summary
public boolean hasConsole()

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.

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

Indicates whether this underlying debugger can provide a list of currently-running processes.

lookupback to summary
public Address lookup(String objectName, String symbol)

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

Doc from sun.jvm.hotspot.debugger.SymbolLookup.lookup.

Looks up the given symbol in the context of the given object.

FIXME: we may want to hide the objectName so the user does not have to specify it, but it isn't clear whether this will work transparently with dbx.

FIXME: what happens if the address is not found? Throw exception? Currently returns null.

lookupOopback to summary
public OopHandle lookupOop(String objectName, String symbol)

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

Doc from sun.jvm.hotspot.debugger.SymbolLookup.lookupOop.

Looks up the given symbol in the context of the given object, assuming that symbol refers to a Java object. FIXME: still not sure whether this will be necessary. Seems that lookup of static fields with type "oop" already works, since the lookup routine returns the address of the oop (i.e., an oopDesc**).

FIXME: we may want to hide the objectName so the user does not have to specify it, but it isn't clear whether this will work transparently with dbx.

FIXME: what happens if the address is not found? Throw exception? Currently returns null.

parseAddressback to summary
public Address parseAddress(String addrStr)

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

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

Parse an address from a hex string in the format "0xFFFFFFFF". The length of the address (i.e., 32 or 64 bits) is platform dependent. This method should ONLY be used by routines which need to interact with the user and parse a string entered by hand; for example, a graphical user interface. This routine should NOT be used to subvert the current safety mechanisms in the system which prevent arbitrary conversion from Address to long and back.

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

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