RoseBin_ControlFlowAnalysis.h

Go to the documentation of this file.
00001 /****************************************************
00002  * RoseBin :: Binary Analysis for ROSE
00003  * Author : tps
00004  * Date : Jul27 07
00005  * Decription : Control flow Analysis
00006  ****************************************************/
00007 
00008 #ifndef __RoseBin_ControlFlowAnalysis__
00009 #define __RoseBin_ControlFlowAnalysis__
00010 
00011 #include "RoseBin_FlowAnalysis.h"
00012 #include "RoseBin_abstract.h"
00013 //class RoseBin;
00014 //class RoseFile;
00015 
00016 class RoseBin_ControlFlowAnalysis : public RoseBin_FlowAnalysis {
00017   void getCFGNodesForFunction(std::set<SgGraphNode*>& visited_f,
00018                               std::set<std::string>& visited_names,
00019                               SgGraphNode* next_n, std::string nodeName);
00020 
00021  public:
00022 
00023   RoseBin_ControlFlowAnalysis(SgAsmNode* global, bool forward, RoseBin_abstract* ,
00024                               bool printedges,GraphAlgorithms* algo):
00025   RoseBin_FlowAnalysis(global,algo) {
00026     typeNode="CFG";
00027     typeEdge="CFG-E";
00028     analysisName="cfa";
00029     printEdges = printedges;
00030     forward_analysis=forward;
00031   }
00032   /*
00033   RoseBin_ControlFlowAnalysis(SgAsmNode* global, bool forward, RoseFile* ,
00034                               bool printedges, GraphAlgorithms* algo):
00035       RoseBin_FlowAnalysis(global, algo) {
00036     typeNode="CFG";
00037     typeEdge="CFG-E";
00038     analysisName="cfa";
00039     printEdges = printedges;
00040     forward_analysis=forward;
00041   }
00042   */
00043 
00044   ~RoseBin_ControlFlowAnalysis() {
00045     delete globalBin;
00046     //delete roseBin;
00047     delete vizzGraph;
00048 
00049     std::map <std::string, SgAsmFunction* >::iterator it;
00050     for (it = bin_funcs.begin();
00051          it!= bin_funcs.end(); it++) {
00052       delete it->second;
00053     }
00054   }
00055 
00056   //void checkControlFlow(SgAsmInstruction* binInst, int functionSize, int countDown,
00057   //                    std::string& nameOfFunction, int func_nr);
00058 
00059   // visit the binary AST
00060   //void visit(SgNode* node) ;
00061 
00062   // run this analysis
00063   void run(RoseBin_Graph* vg, std::string fileN, bool multiedge) ;
00064   void printGraph(std::string fileName, std::set<std::string>& filter);
00065 
00066 };
00067 
00068 #endif
00069 

Generated on Wed May 16 06:18:11 2012 for ROSE by  doxygen 1.4.7