com.github.croesch.micro_debug.console
Class TraceManager

java.lang.Object
  extended by com.github.croesch.micro_debug.console.TraceManager

public final class TraceManager
extends Object

Console view for the com.github.croesch.micro_debug.micro_debug.mic1.Mic1.

Since:
Date: Jan 15, 2012
Author:
croesch

Constructor Summary
TraceManager(IReadableMemory mem)
          A manager that is able to trace some things of the processors current state.
 
Method Summary
 boolean isTracing(Register r)
          Returns whether the given Register is currently traced.
 boolean isTracingLocalVariable(int varNum)
          Returns whether we are tracing the value of the local variable with the given number.
 boolean isTracingMacro()
          Returns whether the macro code is currently traced.
 boolean isTracingMicro()
          Returns whether the micro code is currently traced.
 void listAllRegisters()
          Lists the values of all Registers.
 void listRegister(Register r)
          Lists the value of a single Register.
 void traceLocalVariable(int varNum)
          Start tracing the value of the local variable with the given number.
 void traceMacro()
          Performs to trace the micro code.
 void traceMicro()
          Performs to trace the micro code.
 void traceRegister()
          Performs to trace all Registers.
 void traceRegister(Register r)
          Performs to trace the given Register.
 void untraceLocalVariable(int varNum)
          Ends tracing the value of the local variable with the given number.
 void untraceMacro()
          Performs to not trace the macro code anymore.
 void untraceMicro()
          Performs to not trace the micro code anymore.
 void untraceRegister()
          Performs to not trace any Register.
 void untraceRegister(Register r)
          Performs to not trace the given Register anymore.
 void update(MicroInstruction currentInstruction, String macroCodeLine)
          Tells the view to update itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceManager

public TraceManager(IReadableMemory mem)
A manager that is able to trace some things of the processors current state.

Parameters:
mem - the main memory of the processor, mustn't be null
Since:
Date: Feb 8, 2012
Method Detail

listAllRegisters

public void listAllRegisters()
Lists the values of all Registers.

Since:
Date: Jan 15, 2012

listRegister

public void listRegister(Register r)
Lists the value of a single Register.

Parameters:
r - the Register to print with its value.
Since:
Date: Jan 15, 2012

traceRegister

public void traceRegister()
Performs to trace all Registers.

Since:
Date: Jan 15, 2012

traceRegister

public void traceRegister(Register r)
Performs to trace the given Register.

Parameters:
r - the Register to trace.
Since:
Date: Jan 15, 2012

untraceRegister

public void untraceRegister()
Performs to not trace any Register.

Since:
Date: Jan 15, 2012

untraceRegister

public void untraceRegister(Register r)
Performs to not trace the given Register anymore.

Parameters:
r - the Register not being traced anymore.
Since:
Date: Jan 15, 2012

isTracing

public boolean isTracing(Register r)
Returns whether the given Register is currently traced.

Parameters:
r - the Register to check, if it's traced
Returns:
true, if the Register is currently traced
false otherwise.
Since:
Date: Jan 15, 2012

traceMicro

public void traceMicro()
Performs to trace the micro code.

Since:
Date: Jan 21, 2012

untraceMicro

public void untraceMicro()
Performs to not trace the micro code anymore.

Since:
Date: Jan 21, 2012

traceMacro

public void traceMacro()
Performs to trace the micro code.

Since:
Date: Jan 21, 2012

untraceMacro

public void untraceMacro()
Performs to not trace the macro code anymore.

Since:
Date: Feb 3, 2012

isTracingMicro

public boolean isTracingMicro()
Returns whether the micro code is currently traced.

Returns:
true, if the micro code is currently traced
false otherwise.
Since:
Date: Jan 21, 2012

isTracingMacro

public boolean isTracingMacro()
Returns whether the macro code is currently traced.

Returns:
true, if the macro code is currently traced
false otherwise.
Since:
Date: Feb 3, 2012

update

public void update(MicroInstruction currentInstruction,
                   String macroCodeLine)
Tells the view to update itself.

Parameters:
currentInstruction - the instruction that is now executed
macroCodeLine - the formatted macro code line being executed, or null if no new macro code line has been reached
Since:
Date: Jan 15, 2012

traceLocalVariable

public void traceLocalVariable(int varNum)
Start tracing the value of the local variable with the given number. This will create a variable based on the current LV value so that we can differentiate the variable if we return from this method.

Parameters:
varNum - the local number of this variable as an offset to the LV.
Since:
Date: Feb 8, 2012

untraceLocalVariable

public void untraceLocalVariable(int varNum)
Ends tracing the value of the local variable with the given number. This will remove the variable based on the current LV value so that we don't stop tracing a variable that is traced outside the current method.

Parameters:
varNum - the local number of this variable as an offset to the LV.
Since:
Date: Feb 8, 2012

isTracingLocalVariable

public boolean isTracingLocalVariable(int varNum)
Returns whether we are tracing the value of the local variable with the given number. This will also check the value of the LV, so that we are sure we are really tracing this variable and not a variable in a different method with the same local number.

Parameters:
varNum - the local number of this variable as an offset to the LV.
Returns:
true if we are tracing the local variable with the given number in the current macro code method,
false otherwise
Since:
Date: Feb 8, 2012


Copyright © 2012. All Rights Reserved.