com.github.croesch.micro_debug.debug
Class BreakpointManager

java.lang.Object
  extended by com.github.croesch.micro_debug.debug.BreakpointManager

public final class BreakpointManager
extends java.lang.Object

A manager for break points in the debugger.

Since:
Date: Jan 27, 2012
Author:
croesch

Constructor Summary
BreakpointManager()
           
 
Method Summary
 void addMacroBreakpoint(java.lang.Integer line)
          Adds a breakpoint for the given line number in the macro code.
 void addMicroBreakpoint(java.lang.Integer line)
          Adds a breakpoint for the given line number in the micro code.
 void addRegisterBreakpoint(Register r)
          Adds a breakpoint for the given Register on write access.
 void addRegisterBreakpoint(Register r, java.lang.Integer val)
          Adds a breakpoint for the given Register and the given value.
 boolean isBreakpoint(int microLine, int macroLine, MicroInstruction currentInstruction, MicroInstruction nextInstruction)
          Returns whether any break point condition is met.
 boolean isMacroBreakpoint(java.lang.Integer line)
          Returns whether there is a breakpoint for the given line number in the macro code.
 boolean isMicroBreakpoint(java.lang.Integer line)
          Returns whether there is a breakpoint for the given line number in the micro code.
 boolean isRegisterBreakpoint(Register r)
          Returns whether there is a breakpoint for the given Register on write access.
 boolean isRegisterBreakpoint(Register r, java.lang.Integer val)
          Returns whether there is a breakpoint for the given Register and the given value.
 void listBreakpoints()
          Lists all breakpoints.
 void removeBreakpoint(int id)
          Removes the breakpoint with the given unique id.
 void removeMacroBreakpoint(java.lang.Integer line)
          Removes a breakpoint for the given line number in the macro code.
 void removeMicroBreakpoint(java.lang.Integer line)
          Removes a breakpoint for the given line number in the micro code.
 void removeRegisterBreakpoint(Register r)
          Removes the breakpoint for the given Register on write access.
 void removeRegisterBreakpoint(Register r, java.lang.Integer val)
          Removes the breakpoint for the given Register and the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreakpointManager

public BreakpointManager()
Method Detail

isBreakpoint

public boolean isBreakpoint(int microLine,
                            int macroLine,
                            MicroInstruction currentInstruction,
                            MicroInstruction nextInstruction)
Returns whether any break point condition is met.

Parameters:
microLine - the number of the line in micro code being executed next
macroLine - the number of the line in macro code being executed next
currentInstruction - the current (last executed) MicroInstruction
nextInstruction - the next (to be executed) MicroInstruction
Returns:
true if a break point is met,
false otherwise
Since:
Date: Jan 27, 2012

addRegisterBreakpoint

public void addRegisterBreakpoint(Register r,
                                  java.lang.Integer val)
Adds a breakpoint for the given Register and the given value.

Parameters:
r - the Register to watch for the given value
val - the value the debugger should break if the given Register has it.
Since:
Date: Jan 27, 2012

addRegisterBreakpoint

public void addRegisterBreakpoint(Register r)
Adds a breakpoint for the given Register on write access.

Parameters:
r - the Register to watch for being written
Since:
Date: Apr 11, 2012

isRegisterBreakpoint

public boolean isRegisterBreakpoint(Register r)
Returns whether there is a breakpoint for the given Register on write access.

Parameters:
r - the Register to check if it's currently being watched
Returns:
true if the manager contains a breakpoint for the register on write access, false otherwise
Since:
Date: Jun 2, 2012

isRegisterBreakpoint

public boolean isRegisterBreakpoint(Register r,
                                    java.lang.Integer val)
Returns whether there is a breakpoint for the given Register and the given value.

Parameters:
r - the Register to check if it's currently being watched
val - the value to check, if the debugger would break if the given Register has it.
Returns:
true if the manager contains a breakpoint for the register and the given value, false otherwise
Since:
Date: Jul 14, 2012

removeRegisterBreakpoint

public void removeRegisterBreakpoint(Register r)
Removes the breakpoint for the given Register on write access. If the breakpoint has been set or not, after calling this method, the breakpoint is definitely not set.

Parameters:
r - the Register to not watch anymore for being written
Since:
Date: Apr 11, 2012

removeRegisterBreakpoint

public void removeRegisterBreakpoint(Register r,
                                     java.lang.Integer val)
Removes the breakpoint for the given Register and the given value. If the breakpoint has been set or not, after calling this method, the breakpoint is definitely not set.

Parameters:
r - the Register to not watch anymore for being written
val - the value the debugger should not break anymore if the given Register has it.
Since:
Date: Jul 14, 2012

addMicroBreakpoint

public void addMicroBreakpoint(java.lang.Integer line)
Adds a breakpoint for the given line number in the micro code.

Parameters:
line - the line number in micro code the debugger should break at
Since:
Date: Feb 4, 2012

isMicroBreakpoint

public boolean isMicroBreakpoint(java.lang.Integer line)
Returns whether there is a breakpoint for the given line number in the micro code.

Parameters:
line - the line number in micro code to check for a breakpoint
Returns:
true if the manager contains a breakpoint for the micro code in the given line, false otherwise
Since:
Date: Apr 18, 2012

removeMicroBreakpoint

public void removeMicroBreakpoint(java.lang.Integer line)
Removes a breakpoint for the given line number in the micro code.

Parameters:
line - the line number in micro code the debugger shouldn't break at anymore,
if there has been a breakpoint or not, the debugger won't stop at the given line after calling this
Since:
Date: Apr 18, 2012

addMacroBreakpoint

public void addMacroBreakpoint(java.lang.Integer line)
Adds a breakpoint for the given line number in the macro code.

Parameters:
line - the line number in macro code the debugger should break at
Since:
Date: Feb 4, 2012

isMacroBreakpoint

public boolean isMacroBreakpoint(java.lang.Integer line)
Returns whether there is a breakpoint for the given line number in the macro code.

Parameters:
line - the line number in macro code to check for a breakpoint
Returns:
true if the manager contains a breakpoint for the macro code in the given line, false otherwise
Since:
Date: Apr 18, 2012

removeMacroBreakpoint

public void removeMacroBreakpoint(java.lang.Integer line)
Removes a breakpoint for the given line number in the macro code.

Parameters:
line - the line number in macro code the debugger shouldn't break at anymore,
if there has been a breakpoint or not, the debugger won't stop at the given line after calling this
Since:
Date: Apr 18, 2012

removeBreakpoint

public void removeBreakpoint(int id)
Removes the breakpoint with the given unique id.

Parameters:
id - the unique id of the breakpoint to remove
Since:
Date: Jan 30, 2012

listBreakpoints

public void listBreakpoints()
Lists all breakpoints.

Since:
Date: Jan 28, 2012


Copyright © 2012. All Rights Reserved.