public class MonitorGoThread
extends java.lang.Thread
The MonitorGoThread may log instructions. Logging is done to an internal data structure called a DebugList. Instructions executed are logged there but are only written to the log file when execution of the program stops. The DebugList is a fifo queue and only keeps a certain number of instructions (set up when this object is created).
This thread may also watch a memory location and stop excution when the content of that memory location changes (long word only).
This thread may also stop at a certain condition (eg register==value).
In "gofast
" mode, no memory is watched, no breakpoints are checked etc - the program just executes as fast as it can.
Constructor and Description |
---|
MonitorGoThread(int nbrOfInstructions,
MC68000Cpu cpu,
java.util.ArrayList<java.lang.Integer> breakpoints,
Monitor monitor,
java.lang.String filename,
boolean watchBreakpoints,
boolean logInstructions,
QL50HzInterrupt ih,
boolean goFast,
TrapDispatcher trapDispatcher,
int upperLimit,
boolean checkmem,
int memWatched,
int provbreak,
boolean excludeSuper)
Creates the monitor go thread.
|
Modifier and Type | Method and Description |
---|---|
void |
done(java.lang.String message)
This is called when the emulation stops.
|
void |
run() |
void |
setckmem(boolean b)
Sets whether memory check should be switched on or off.
|
void |
setCondition(int dataReg,
int addrReg,
int condValue,
boolean isContent,
int address)
Sets the condition for a "g" command
|
void |
setmemWatched(int a)
Sets the mmemory to be watched.
|
void |
setUpperLimit(int address)
Sets the upper limit of memory when logging.
|
void |
signalDeath(boolean b)
Sets whether the death of the thread should be loggined inthe MonitorGui log wdw.
|
void |
stopThread()
Stops the thread.
|
void |
switchLogging(boolean newLogState)
Switches logging state on/off.
|
void |
switchSuper(boolean superState)
Do we log calls to the OS or only user state code?
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public MonitorGoThread(int nbrOfInstructions, MC68000Cpu cpu, java.util.ArrayList<java.lang.Integer> breakpoints, Monitor monitor, java.lang.String filename, boolean watchBreakpoints, boolean logInstructions, QL50HzInterrupt ih, boolean goFast, TrapDispatcher trapDispatcher, int upperLimit, boolean checkmem, int memWatched, int provbreak, boolean excludeSuper)
nbrOfInstructions
- how many instructions are to be executed, or 0 if continuous execution.cpu
- for which copu the instructions are to be executed.breakpoints
- an arrayList of Integers with memory addresses where breakpoints are set.monitor
- the motor launching this goThread.filename
- the name of the file where instructions are logged to when logging is switched on.watchBreakpoints
- true
if breakpoints should be observed.logInstructions
- true
if instrcutions should be logged.ih
- the interrupt handler for a 50 Hz interrupt. This is started by the go thread.goFast
- if this is true
, no breakpoints will be wtached, no memory will be watched etc...trapDispatcher
- the TrapDispatcher used to dispatch traps to drivers and callback traps to java.upperLimit
- when logging instructions, instructions beyond this limit will NOT be logged (useful to exclude OS code in high mem).checkmem
- set to true
if memory is to be watchedmemWatched
- what memory address is to be watchedprovbreak
- provisional breakpoint used with traceoverexcludeSuper
- if true
: when logging, exclude all instructions executed in supervisor modepublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void done(java.lang.String message)
message
- the message ti display.public void stopThread()
public void switchLogging(boolean newLogState)
newLogState
- if true, logging is switched on againpublic void switchSuper(boolean superState)
superState
- if true, only log calls in user mode.public void setCondition(int dataReg, int addrReg, int condValue, boolean isContent, int address)
dataReg
- the datareg this condition applies to, or -1 if condition is for address reg.addrReg
- the addrreg this condition applies to, or -1 if condition is for data reg.condValue
- the value to be met.isContent
- possible content at...address
- ...this addresspublic void signalDeath(boolean b)
b
- true
if death should be logged.public void setckmem(boolean b)
b
- true if memory check is the switched on.public void setmemWatched(int a)
a
- the mmemory to be watched : if content of memory location is changed the emulation breaks (in monitor mode).public void setUpperLimit(int address)
address
- the upper limit of memory when logging any instruction executed above this will not be logged.