Package org.jakstab.rtl.statements

Examples of org.jakstab.rtl.statements.RTLStatement


   * label, it is replaced.
   *
   * @param stmt The statement to be stored. Has to contain a proper label.
   */
  public final void putStatement(RTLStatement stmt) {
    RTLStatement existing = statementMap.get(stmt.getLabel());
    if (existing != null) {
      if (existing.equals(stmt)) return;
      logger.debug("Replacing statement at " + stmt.getLabel());
    }
    statementMap.put(stmt.getLabel(), stmt);
  }
View Full Code Here


   
    //logger.debug("Inside module " + cfaEdge);
   
    TraceReplayState tState = (TraceReplayState)state;
   
    RTLStatement stmt = (RTLStatement)cfaEdge.getTransformer();
   
    if (edgeTarget.getAddress().equals(tState.getCurrentPC()) && 
        !(stmt instanceof RTLAssume && ((RTLAssume)stmt).getSource().getType() == RTLGoto.Type.REPEAT)) {
      // Next statement has same address (and is no back jump from REP), so do not move forward in trace
      return tState;
View Full Code Here

    this.program = program;
    cpaAlgo = CPAAlgorithm.createForwardAlgorithm(program, new ExpressionSubstitutionAnalysis());
  }
 
  public static void substituteCFAEdge(CFAEdge edge, SubstitutionState s) {
    RTLStatement stmt = (RTLStatement)edge.getTransformer();
    RTLStatement newStmt = substituteStatement(stmt, s);
    if (newStmt != stmt)
      edge.setTransformer(newStmt);
  }
View Full Code Here

        substCtx.addAssignment(v, el.getExpression());
      }
    }
    if (!substCtx.getAssignments().isEmpty()) {
      //logger.info("Old stmt: " + stmt);
      RTLStatement newStmt = stmt.copy().evaluate(substCtx);
      //logger.info("New stmt: " + newStmt);
      if (newStmt != null) {
        return newStmt.evaluate(new Context());
      } else {
        RTLSkip skip = new RTLSkip();
        skip.setLabel(stmt.getLabel());
        skip.setNextLabel(stmt.getNextLabel());
        return skip;
View Full Code Here

      return null;
    }
  }

  private Map<String,String> getNodeProperties(Location loc) {
    RTLStatement curStmt = program.getStatement(loc);
    Map<String,String> properties = new HashMap<String, String>();

    if (curStmt != null) {
      if (curStmt.getLabel().getAddress().getValue() >= 0xFACE0000L) {
        properties.put("color", "lightgrey");
        properties.put("fillcolor", "lightgrey");
      }

      if (program.getUnresolvedBranches().contains(curStmt.getLabel())) {
        properties.put("fillcolor", "red");
      }
     
      if (mustLeaves.contains(loc)) {
        properties.put("fillcolor", "green");
      }

      if (curStmt.getLabel().equals(program.getStart())) {
        properties.put("color", "green");
        properties.put("style", "filled,bold");
      } else if (curStmt instanceof RTLHalt) {
        properties.put("color", "orange");
        properties.put("style", "filled,bold");
View Full Code Here

       
        if (instr instanceof BranchInstruction) {
          BranchInstruction bi = (BranchInstruction)instr;
          if (bi.isConditional()) {
            // Get the original goto from the program (not the converted assume)
            RTLStatement rtlGoto = program.getStatement(e.getSource());
           
            // If this is the fall-through edge, output F, otherwise T
            label = targetAddr.equals(rtlGoto.getNextLabel().getAddress()) ? "F" : "T";
          }
        }
       
        if (label != null)
          gwriter.writeLabeledEdge(sourceAddr.toString(),
View Full Code Here

TOP

Related Classes of org.jakstab.rtl.statements.RTLStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.