Commit c8d6a6b0 authored by michael.kirsten's avatar michael.kirsten
Browse files

Removed annoying sysout messages.

parent bf35f666
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
//Calculate the factorial of k recursively.
//other functions must be declared before the main
int fac(int k) {
if (k <= 1)
if (k <= 1)
return 1;
int res;
res = fac(k-1);
......@@ -9,7 +8,6 @@ int fac(int k) {
return res;
}
//every program needs a main method
int main(int k) {
int res;
res = fac(k);
......
......@@ -20,7 +20,7 @@ import dibugger.debuglogic.interpreter.WatchExpression;
* Heart of the Debug-Logic. The logic for start / stop / continue and all steps
* is in this class. Additionally the creation of breakpoints and watch
* expressions is handled here.
*
*
* @author Pascal
*
*/
......@@ -61,7 +61,7 @@ public class DebugControl {
list_traceIterator = new ArrayList<ListIterator<TraceState>>();
list_currentTraceStates = new ArrayList<TraceState>();
list_lastTraceStates = new ArrayList<TraceState>();
list_programInput = new ArrayList<ProgramInput>();
list_stepSize = new ArrayList<Integer>();
......@@ -72,7 +72,7 @@ public class DebugControl {
/**
* Launches the Debug Mode with a given List of programs.
*
*
* @param programs
* the programs to run
* @throws DIbuggerLogicException
......@@ -89,7 +89,7 @@ public class DebugControl {
ListIterator<TraceState> generatedTrace;
try {
generatedTrace = generationController.generateTrace(pi.getText(), pi.getInputValues(), pi.getProgramID());
}catch(DIbuggerLogicException e) {
}catch(DIbuggerLogicException e) {
throw new DIbuggerLogicException(e,"Program "+pi.getProgramID()+": "+ e.getMessage());
}
list_traceIterator.add(generatedTrace);
......@@ -108,7 +108,7 @@ public class DebugControl {
/**
* Synchronizes the ProgramInput with a given Programinput List
*
*
* @param programs
* the list containing all new programs
*/
......@@ -119,7 +119,7 @@ public class DebugControl {
/**
* Executes a step defined by a given step type.
*
*
* @param type
* the type of the step
* (STEP_NORMAL,STEP_OVER,STEP_OUT,STEP_BACK)
......@@ -192,7 +192,7 @@ public class DebugControl {
/**
* Executes a normal step in a given program with size 1
*
*
* @param programID
* the program to do a step
*/
......@@ -228,7 +228,7 @@ public class DebugControl {
/**
* Executes a single step without evaluating breakpoints
*
*
* @param programID
*/
private boolean singleStepNoEvaluation(int programID, int direction) {
......@@ -280,7 +280,7 @@ public class DebugControl {
/**
* Creates a new watch expression
*
*
* @param id
* the id of the watch expression
* @param expr
......@@ -288,7 +288,7 @@ public class DebugControl {
* @throws DIbuggerLogicException
*/
public void createWatchExpression(int id, String expr) throws DIbuggerLogicException {
System.out.println("Add watch expression: "+id+" "+expr);
// System.out.println("Add watch expression: "+id+" "+expr);
while (list_watchExpressions.size() - 1 < id) {
list_watchExpressions.add(null);
}
......@@ -297,7 +297,7 @@ public class DebugControl {
/**
* changes the watch expression with a given id
*
*
* @param id
* the id of the watch expression to change
* @param expr
......@@ -307,7 +307,7 @@ public class DebugControl {
* @throws DIbuggerLogicException
*/
public void changeWatchExpression(int id, String expr, List<ScopeTuple> scopes) throws DIbuggerLogicException {
//System.out.println("Change watch expression: "+id+" to "+expr);
// System.out.println("Change watch expression: "+id+" to "+expr);
if (id < list_watchExpressions.size()) {
WatchExpression e = list_watchExpressions.get(id);
if (e != null) {
......@@ -322,12 +322,12 @@ public class DebugControl {
/**
* Deletes the watch expression with a given id
*
*
* @param id
* the id of the watch expression
*/
public void deleteWatchExpression(int id) {
System.out.println("Remove watch expression: "+id);
// System.out.println("Remove watch expression: "+id);
if (id == list_watchExpressions.size() - 1) {
list_watchExpressions.remove(id);
} else {
......@@ -344,7 +344,7 @@ public class DebugControl {
/**
* creates a new conditional breakpoint
*
*
* @param id
* the id of the breakpoint
* @param cond
......@@ -360,7 +360,7 @@ public class DebugControl {
/**
* changes the conditional breakpoint with a given id
*
*
* @param id
* the id of the breakpoint to change
* @param cond
......@@ -384,7 +384,7 @@ public class DebugControl {
/**
* deletes the breakpoint with a given id
*
*
* @param id
* the id of the breakpoint
*/
......@@ -405,7 +405,7 @@ public class DebugControl {
/**
* creates a new breakpoint in a given program and line
*
*
* @param program
* the programID to create the breakpoint in
* @param line
......@@ -420,7 +420,7 @@ public class DebugControl {
/**
* deletes a breakpoint in a given proogram and line
*
*
* @param program
* the program to search in
* @param line
......@@ -454,11 +454,11 @@ public class DebugControl {
list_watchExpressions.clear();
list_condBreakpoints.clear();
list_currentTraceStates.clear();
maxIterations = DEF_IT;
maxFunctionCalls = DEF_MAX_FUNC_CALLS;
}
public void endRun(){
if(list_currentTraceStates.size()>0){
list_lastTraceStates.clear();
......@@ -469,7 +469,7 @@ public class DebugControl {
/**
* Sets the stepsize of a program
*
*
* @param programID
* the program to change the stepsize
* @param stepSize
......@@ -485,7 +485,7 @@ public class DebugControl {
/**
* Getter for the current programCounter of all programs
*
*
* @return a list of integers representing all programCounters
*/
public List<Integer> getProgramCounter() {
......@@ -498,7 +498,7 @@ public class DebugControl {
/**
* Getter for the current line of all programs
*
*
* @return a list countaining the current execution line of all programs
*/
public Map<String, Integer> getCurrentExecutionLines() {
......@@ -512,7 +512,7 @@ public class DebugControl {
/**
* Sets the maximum iteration count for loops (example: while loop)
*
*
* @param count
* the new maximum value
*/
......@@ -521,16 +521,16 @@ public class DebugControl {
}
/**
*
*
* @return max interations the debugcontrol
*/
public int getMaxIterations(){
return maxIterations;
}
/**
* Sets the maximum iteration count for recursive function calls
*
*
* @param count
* the new maximum value
*/
......@@ -539,16 +539,16 @@ public class DebugControl {
}
/**
*
*
* @return max function calls of the debugcontrol
*/
public int getMaxFunctionCalls(){
return maxFunctionCalls;
}
// Getter
/**
*
*
* @return the amount of conditional breakpoints
*/
public int getWatchExpressionSize() {
......@@ -556,7 +556,7 @@ public class DebugControl {
}
/**
*
*
* @return a list containing all expression of the watch expressions
*/
public List<String> getWatchExpressions() {
......@@ -572,10 +572,10 @@ public class DebugControl {
}
return l;
}
/**
* Getter for the Scope Begin of a given Watch Expression
*
*
* @param expressionID
* the id of the expression
* @return a List containing all Scope begins for the given watch
......@@ -583,13 +583,13 @@ public class DebugControl {
*/
public List<Integer> getWEScopeBegin(int expressionID) {
List<Integer> l = new ArrayList<Integer>();
System.out.println("Get Expression: "+expressionID);
System.out.println("From: "+list_watchExpressions);
// System.out.println("Get Expression: "+expressionID);
// System.out.println("From: "+list_watchExpressions);
if(list_watchExpressions.get(expressionID)!=null) {
for (ScopeTuple it : list_watchExpressions.get(expressionID).getScopes()) {
l.add(it.getStartLine());
}
}
}
if (l.size() == 0) {
for (int i = 0; i < numPrograms; ++i) {
l.add(1);
......@@ -600,7 +600,7 @@ public class DebugControl {
/**
* Getter for the Scope End of a given Watch Expression
*
*
* @param expressionID
* the id of the expression
* @return a List containing all Scope ends for the given watch expression.
......@@ -611,7 +611,7 @@ public class DebugControl {
for (ScopeTuple it : list_watchExpressions.get(expressionID).getScopes()) {
l.add(it.getEndLine());
}
}
}
if (l.size() == 0) {
for (int i = 0; i < numPrograms; ++i) {
l.add(list_programInput.get(i).getText().split("\n").length);
......@@ -622,7 +622,7 @@ public class DebugControl {
/**
* Getter for the value of a watch expression
*
*
* @param expressionID
* the id of the expression
* @return the current Value of the expression
......@@ -637,7 +637,7 @@ public class DebugControl {
}
/**
*
*
* @return the amount of conditional breakpoints
*/
public int getConditionalBreakpointSize() {
......@@ -645,7 +645,7 @@ public class DebugControl {
}
/**
*
*
* @return a list containing all conditions of the conditional breakpoints
*/
public List<String> getConditionalBreakpoints() {
......@@ -664,7 +664,7 @@ public class DebugControl {
/**
* Getter for the Scope Begin of a given Conditional Breakpoint
*
*
* @param expressionID
* the id of the expression
* @return a List containing all Scope begins for the given conditional
......@@ -676,7 +676,7 @@ public class DebugControl {
for (ScopeTuple it : list_condBreakpoints.get(expressionID).getScopes()) {
l.add(it.getStartLine());
}
}
}
if (l.size() == 0) {
for (int i = 0; i < numPrograms; ++i) {
l.add(1);
......@@ -687,7 +687,7 @@ public class DebugControl {
/**
* Getter for the Scope end of a given Conditional Breakpoint
*
*
* @param expressionID
* the id of the expression
* @return a List containing all Scope ends for the given conditional
......@@ -699,7 +699,7 @@ public class DebugControl {
for (ScopeTuple it : list_condBreakpoints.get(expressionID).getScopes()) {
l.add(it.getEndLine());
}
}
}
if (l.size() == 0) {
for (int i = 0; i < numPrograms; ++i) {
l.add(list_programInput.get(i).getText().split("\n").length);
......@@ -710,7 +710,7 @@ public class DebugControl {
/**
* Getter for the value of a conditional breakpoint
*
*
* @param breakpointID
* the id of the conditional breakpoint
* @return the current Value of the condition
......@@ -727,7 +727,7 @@ public class DebugControl {
/**
* Getter for all breakpoints of a given program
*
*
* @param programID
* the program id
* @return a list containing all programs of program programID
......@@ -745,7 +745,7 @@ public class DebugControl {
/**
* Getter for the amount of programs
*
*
* @return the amount of programs
*/
public int getNumPrograms() {
......@@ -754,7 +754,7 @@ public class DebugControl {
/**
* Getter for the stepSize of a given program
*
*
* @param programID
* the program ID
* @return the step size of program programID
......@@ -770,7 +770,7 @@ public class DebugControl {
/**
* Returns the value of a specified variable.
*
*
* @param variable
* the variable to get the value from
* @return the value of the given variable
......@@ -787,7 +787,7 @@ public class DebugControl {
/**
* Returns all current variables.
*
*
* @return list containing all variables
*/
public List<String> getAllVariables(String programNameID) {
......@@ -812,7 +812,7 @@ public class DebugControl {
/**
* Getter for the return value of a given program, if the current TraceState
* is the last in the Trace iteration.
*
*
* @param programNameID
* the nameID of the program
* @return the value of the return of the given program
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment