frysk.rt
Class BreakpointManager

java.lang.Object
  extended by java.util.Observable
      extended by frysk.rt.BreakpointManager

public class BreakpointManager
extends Observable

Class for managing user breakpoints. In particular it defers inserting breakpoints whose addresses cannot be found in the executable, trying again when shared libraries are loaded.


Nested Class Summary
private  class BreakpointManager.ProcWatcher
           
 
Field Summary
private  TreeMap breakpointMap
           
private static Log fine
           
private  HashSet managedProcs
           
private  SteppingEngine steppingEngine
           
private  HashMap watchers
           
 
Constructor Summary
BreakpointManager(SteppingEngine steppingEngine)
          Initialize the BreakpointManager.
 
Method Summary
private  void addBreakpoint(SourceBreakpoint bp)
           
 FunctionBreakpoint addFunctionBreakpoint(String name, ObjectDeclaration decl)
          Create a function breakpoint not associated with any process
 LineBreakpoint addLineBreakpoint(File fileName, int line, int column)
          Create a line breakpoint that is not associated with any process.
 LineBreakpoint addLineBreakpoint(String fileName, int lineNumber, int column)
          Create a line breakpoint that is not associated with any process.
 PLTBreakpoint addPLTBreakpoint(PLTEntry entry)
          Create a PLT breakpoint not associated with any process
 SymbolBreakpoint addSymbolBreakpoint(DwflSymbol symbol)
          Create a symbol breakpoint not associated with any process
 void disableBreakpoint(SourceBreakpoint breakpoint, Task task)
          Disable a breakpoint in a task.
 SourceBreakpoint.State enableBreakpoint(SourceBreakpoint breakpoint, Task task)
          Try to enable a breakpoint in a task.
 SourceBreakpoint getBreakpoint(int bptId)
           
 Iterator getBreakpointTableIterator()
           
 void manageProcess(Proc proc)
           
 void refreshBreakpoints(Task task)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fine

private static final Log fine

breakpointMap

private TreeMap breakpointMap

steppingEngine

private SteppingEngine steppingEngine

watchers

private HashMap watchers

managedProcs

private HashSet managedProcs
Constructor Detail

BreakpointManager

public BreakpointManager(SteppingEngine steppingEngine)
Initialize the BreakpointManager.

Parameters:
steppingEngine - the stepping engine the manager will use to insert / delete breakpoints.
Method Detail

addBreakpoint

private void addBreakpoint(SourceBreakpoint bp)

addLineBreakpoint

public LineBreakpoint addLineBreakpoint(String fileName,
                                        int lineNumber,
                                        int column)
Create a line breakpoint that is not associated with any process.

Parameters:
fileName - the file
lineNumber - line in the file
column - column number in the file
Returns:
LineBreakpoint object

addLineBreakpoint

public LineBreakpoint addLineBreakpoint(File fileName,
                                        int line,
                                        int column)
Create a line breakpoint that is not associated with any process.

Parameters:
fileName - the file
lineNumber - line in the file
column - column number in the file
Returns:
LineBreakpoint object

addSymbolBreakpoint

public SymbolBreakpoint addSymbolBreakpoint(DwflSymbol symbol)
Create a symbol breakpoint not associated with any process

Parameters:
symbol - the symbol to breakpoint at
Returns:
SymbolBreakpoint object

addPLTBreakpoint

public PLTBreakpoint addPLTBreakpoint(PLTEntry entry)
Create a PLT breakpoint not associated with any process

Parameters:
entry - the PLT entry to breakpoint at
Returns:
PLTBreakpoint object

addFunctionBreakpoint

public FunctionBreakpoint addFunctionBreakpoint(String name,
                                                ObjectDeclaration decl)
Create a function breakpoint not associated with any process

Parameters:
name - the name of the function
die - a DwarfDie representing the function or inlined instance. If null, a lookup against the Elf symbol name is performed.
Returns:
FunctionBreakpoint object

enableBreakpoint

public SourceBreakpoint.State enableBreakpoint(SourceBreakpoint breakpoint,
                                               Task task)
Try to enable a breakpoint in a task. If there is an error, the state of the breakpoint will be set to DEFERRED.

Parameters:
breakpoint - the breakpoint
task - task in which breakpoint will be enabled.
Returns:
the state of the breakpoint of attempting to enable it.

disableBreakpoint

public void disableBreakpoint(SourceBreakpoint breakpoint,
                              Task task)
Disable a breakpoint in a task.

Parameters:
breakpoint - the breakpoint
task - the task

getBreakpointTableIterator

public Iterator getBreakpointTableIterator()

getBreakpoint

public SourceBreakpoint getBreakpoint(int bptId)

refreshBreakpoints

public void refreshBreakpoints(Task task)

manageProcess

public void manageProcess(Proc proc)