Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lrusecurity
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Touzeau
lrusecurity
Commits
49a96f13
Commit
49a96f13
authored
Aug 01, 2019
by
Julien Balette-Pape
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Amélioration affichage
parent
42850881
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
src/Graphic/DotModificator.cpp
src/Graphic/DotModificator.cpp
+21
-12
src/lrusecurity_Displayer.cpp
src/lrusecurity_Displayer.cpp
+1
-1
No files found.
src/Graphic/DotModificator.cpp
View file @
49a96f13
...
...
@@ -7,6 +7,13 @@
namespace
lrusecurity
{
void
displayString
(
string
str
,
std
::
ofstream
*
flux
)
{
for
(
String
::
Iter
i
=
str
.
begin
();
i
!=
str
.
end
();
i
++
)
*
flux
<<
*
i
;
}
void
DotModificator
::
modify
(
otawa
::
CFG
*
cfg
,
const
otawa
::
icache
::
Access
*
access
,
otawa
::
Address
address
)
{
std
::
ofstream
flux
(
_filename
,
std
::
ios
::
app
);
...
...
@@ -18,31 +25,33 @@ void DotModificator::modify(otawa::CFG *cfg, const otawa::icache::Access *access
}
//Copie de l'addresse pour affichage
int
addr
=
address
.
offset
()
;
string
addr
=
_
<<
address
;
if
(
access
){
// On récupère le bloc correspondant à l'accès grâce à l'InstMatcher
otawa
::
BasicBlock
*
bb_match
=
_intM
->
match_access
(
access
);
// Copie de l'adresse de l'accès pour affichage
int
acc_addr
;
acc_addr
=
access
->
address
().
offset
();
string
acc_addr
=
_
<<
access
->
address
();
// Creation du node UNSAFE
flux
<<
"Unsafe_"
<<
_count
<<
" [label=
\"
{UNSAFE 0x"
<<
std
::
hex
<<
acc_addr
<<
"| lead to a hit @ 0x"
<<
addr
<<
"}
\"
, color = red];"
<<
std
::
dec
<<
io
::
endl
;
flux
<<
"Unsafe_"
<<
_count
<<
" [label=
\"
{UNSAFE "
;
displayString
(
acc_addr
,
&
flux
);
flux
<<
"|Lead to a hit @ "
;
displayString
(
addr
,
&
flux
);
flux
<<
"}
\"
, color = red];"
<<
io
::
endl
;
// On met au même niveau le node Unsafe et le BB auquel il correspond
string
name
=
cfg
->
name
();
flux
<<
"{rank = same; Unsafe_"
<<
_count
<<
"; "
;
for
(
String
::
Iter
i
=
name
.
begin
();
i
!=
name
.
end
();
i
++
){
flux
<<
*
i
;
}
displayString
(
cfg
->
name
(),
&
flux
);
flux
<<
"_"
<<
cfg
->
index
()
<<
"_"
<<
bb_match
->
index
()
<<
";}"
<<
io
::
endl
;
//TODO: à optimisé (1 par BB)
}
else
{
// Debut du de la modification du CFG
flux
<<
"Unsafe_"
<<
_count
<<
" [label=
\"
{UNSAFE at the ENTRY|Can lead to a hit @ 0x"
<<
std
::
hex
<<
addr
<<
"}
\"
, color = red];"
<<
std
::
dec
<<
io
::
endl
;
}
else
{
// UNSAFE au début
flux
<<
"Unsafe_"
<<
_count
<<
" [label=
\"
{UNSAFE at the ENTRY|Can lead to a hit @ "
;
displayString
(
addr
,
&
flux
);
flux
<<
"|In function "
;
displayString
(
cfg
->
name
(),
&
flux
);
flux
<<
"}
\"
, color = red];"
<<
io
::
endl
;
}
// On incrémente le compteur
...
...
src/lrusecurity_Displayer.cpp
View file @
49a96f13
...
...
@@ -30,7 +30,7 @@ public:
_stream
(
nullptr
),
_line
(
false
),
// Modification pour affichage en dot
_modificator
(
new
DotModificator
(
"
tes
t.dot"
,
new
InstMatcher
))
//TODO: changer l'accès au fichier
_modificator
(
new
DotModificator
(
"
resul
t.dot"
,
new
InstMatcher
))
//TODO: changer l'accès au fichier
{
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment