jmce - 1_02

jmce.sim
Class BreakPoint

java.lang.Object
  extended by jmce.sim.BreakPoint
Direct Known Subclasses:
BreakPointRead, BreakPointWrite

public abstract class BreakPoint
extends java.lang.Object

Base class for all type of break point.

Every break point have 2 enable the first one using the standard method setEnabled/getEnabled is used from the application to control the break point the second,using the method setEnabled1/getEnabled1. used from the CPU simulator to avoid break point detection during critical code execution.

Version:
1.00
Author:
Mario Viara

Field Summary
protected  int address
           
protected  CPU cpu
           
protected  boolean enabled
           
protected  boolean enabled1
           
protected  int fireCounter
           
protected  BreakPointListener listener
           
protected  Memory memory
           
protected  java.lang.String name
           
 
Method Summary
abstract  void destroy()
          Destroy the break point.
 void fireBreakPoint(java.lang.String msg)
          Fire the break point.
protected  java.lang.String formatMsg(int address, int value)
          Prepare a string for this break point
 int getAddress()
          Return the address where the break point is inserted.
 int getFireCount()
          Return the number of times the break point has been fired.
 Memory getMemory()
          Return the Memory where the break point is connected.
 boolean isEnabled()
          Return the status of the break point.
 void setEnabled(boolean mode)
           
 void setEnabled1(boolean mode)
          Enable/disable the break point.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

protected int address

enabled

protected boolean enabled

enabled1

protected boolean enabled1

memory

protected Memory memory

fireCounter

protected int fireCounter

listener

protected BreakPointListener listener

name

protected java.lang.String name

cpu

protected CPU cpu
Method Detail

getAddress

public final int getAddress()
Return the address where the break point is inserted.


getMemory

public final Memory getMemory()
Return the Memory where the break point is connected.


setEnabled

public final void setEnabled(boolean mode)

setEnabled1

public final void setEnabled1(boolean mode)
Enable/disable the break point. Using the second enabled this method must be called only from the CPU simulator


isEnabled

public final boolean isEnabled()
Return the status of the break point. The method check only the first enabled.

See Also:
setEnabled(boolean)

formatMsg

protected java.lang.String formatMsg(int address,
                                     int value)
Prepare a string for this break point


getFireCount

public int getFireCount()
Return the number of times the break point has been fired.


fireBreakPoint

public void fireBreakPoint(java.lang.String msg)
Fire the break point.

Parameters:
msg - - Messagge string.

destroy

public abstract void destroy()
Destroy the break point.

Must unregister all memory read / write listener and free all used resources.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

jmce - 1_02