Commit a04ef693 authored by Julien Balette-Pape's avatar Julien Balette-Pape

change lrusecurity_Displayer

parent e5e23d92
......@@ -8,6 +8,10 @@
#include <lruexact/features.h>
#include <set>
#include <iterator>
#include "Graphic/InstMatching.h"
#include "Graphic/DotModificator.h"
//#include "SecCFGOutput.h"
using namespace otawa;
......@@ -24,7 +28,9 @@ public:
_path(""),
_toFile(false),
_stream(nullptr),
_line(false)
_line(false),
// Modification pour affichage en dot
_modificator(new DotModificator("test.dot", new InstMatcher)) //TODO: changer l'accès au fichier
{
}
......@@ -36,6 +42,9 @@ public:
if(props.hasProp(lruexact::CLASSIFICATION_TO_FILE))
_toFile = lruexact::CLASSIFICATION_TO_FILE(props);
}
inline DotModificator* getModificator(void){return _modificator;};
protected:
virtual void setup(WorkSpace *ws) override
......@@ -65,10 +74,14 @@ protected:
_out << "\tLINE";
_out << io::endl;
}
virtual void processCFG(WorkSpace* ws, CFG* cfg) override
{
InstMatcher *match = getModificator() -> getMatcher();
match->setupCFG(cfg);
_out << "FUNCTION " << cfg->label() << io::endl;
BBProcessor::processCFG(ws, cfg);
}
......@@ -96,7 +109,7 @@ protected:
processAccess(ws, cfg, &bag[i], bb);
}
void processAccess(WorkSpace* ws, CFG*, const otawa::icache::Access* access, BasicBlock* bb)
void processAccess(WorkSpace* ws, CFG* cfg, const otawa::icache::Access* access, BasicBlock* bb)
{
SecurityCategory cat = SECURITY_CATEGORY(access);
if(cat == SecurityCategory::UNSAFE){
......@@ -122,6 +135,9 @@ protected:
} else {
_out << "00000000" << "\n\t\t\t\t\b";
}
DotModificator *mod = getModificator();
mod->modify(cfg, *iter, access->address());
}
// REMONTEE
......@@ -178,6 +194,8 @@ protected:
elm::io::OutStream* _stream;
bool _line;
bool _mcAnalysis;
DotModificator *_modificator;
};
p::declare SecurityDisplayer::reg = p::init("lrusecurity::SecurityDisplayer", Version(1, 0, 0))
......
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