Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
c2fed1b9
Commit
c2fed1b9
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[eva/server] merging callstacks
parent
f1592187
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/value/api/values_request.ml
+64
-19
64 additions, 19 deletions
src/plugins/value/api/values_request.ml
with
64 additions
and
19 deletions
src/plugins/value/api/values_request.ml
+
64
−
19
View file @
c2fed1b9
...
@@ -39,13 +39,9 @@ let package =
...
@@ -39,13 +39,9 @@ let package =
()
()
type
callstack
=
Value_types
.
callstack
type
callstack
=
Value_types
.
callstack
type
truth
=
Abstract_interp
.
truth
type
truth
=
Abstract_interp
.
truth
type
step
=
[
`Here
|
`After
|
`Then
of
exp
|
`Else
of
exp
]
type
step
=
[
`Here
|
`After
|
`Then
of
exp
|
`Else
of
exp
]
type
probe
=
Pexpr
of
exp
*
stmt
|
Plval
of
lval
type
probe
=
|
Expr
of
exp
*
stmt
|
Lval
of
lval
*
stmt
type
domain
=
{
type
domain
=
{
values
:
(
step
*
string
)
list
;
values
:
(
step
*
string
)
list
;
...
@@ -65,6 +61,18 @@ let next_steps s : step list =
...
@@ -65,6 +61,18 @@ let next_steps s : step list =
->
[
`After
]
->
[
`After
]
|
Instr
(
Skip
_
)
|
Return
_
|
Break
_
|
Continue
_
|
Goto
_
|
Throw
_
->
[]
|
Instr
(
Skip
_
)
|
Return
_
|
Break
_
|
Continue
_
|
Goto
_
|
Throw
_
->
[]
module
CS
=
Value_types
.
Callstack
module
CSmap
=
CS
.
Hashtbl
module
CSlist
=
struct
type
t
=
callstack
list
let
rec
hash
=
function
[]
->
1
|
a
::
q
->
CS
.
hash
a
+
31
*
hash
q
let
rec
equal
ca
cb
=
match
ca
,
cb
with
|
[]
,
[]
->
true
|
a
::
p
,
b
::
q
->
Callstack
.
equal
a
b
&&
equal
p
q
|
_
->
false
end
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(* --- EVA Proxy --- *)
(* --- EVA Proxy --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
...
@@ -72,7 +80,7 @@ let next_steps s : step list =
...
@@ -72,7 +80,7 @@ let next_steps s : step list =
module
type
EvaProxy
=
module
type
EvaProxy
=
sig
sig
val
callstacks
:
stmt
->
callstack
list
val
callstacks
:
stmt
->
callstack
list
val
domain
:
prob
e
->
callstack
option
->
domain
val
domain
:
Printer_tag
.
localizabl
e
->
callstack
list
->
domain
end
end
module
Proxy
(
A
:
Analysis
.
S
)
:
EvaProxy
=
module
Proxy
(
A
:
Analysis
.
S
)
:
EvaProxy
=
...
@@ -81,6 +89,17 @@ struct
...
@@ -81,6 +89,17 @@ struct
open
Eval
open
Eval
type
dstate
=
A
.
Dom
.
state
or_top_or_bottom
type
dstate
=
A
.
Dom
.
state
or_top_or_bottom
module
CSSmap
=
Hashtbl
.
Make
(
struct
type
t
=
bool
*
stmt
*
callstack
list
let
hash
(
after
,
stmt
,
cs
)
=
Hashtbl
.
hash
(
after
,
Cil_datatype
.
Stmt
.
hash
stmt
,
CSlist
.
hash
cs
)
let
equal
(
a1
,
s1
,
cs1
)
(
a2
,
s2
,
cs2
)
=
a1
=
a2
&&
Cil_datatype
.
Stmt
.
equal
s1
s2
&&
CSlist
.
equal
cs1
cs2
end
)
let
stackcache
=
CSSmap
.
create
0
let
callstacks
stmt
=
let
callstacks
stmt
=
match
A
.
get_stmt_state_by_callstack
~
after
:
false
stmt
with
match
A
.
get_stmt_state_by_callstack
~
after
:
false
stmt
with
|
`Top
|
`Bottom
->
[]
|
`Top
|
`Bottom
->
[]
...
@@ -89,24 +108,47 @@ struct
...
@@ -89,24 +108,47 @@ struct
let
dstate
~
after
stmt
callstack
=
let
dstate
~
after
stmt
callstack
=
match
callstack
with
match
callstack
with
|
None
->
(
A
.
get_stmt_state
~
after
stmt
:>
dstate
)
|
[]
->
(
A
.
get_stmt_state
~
after
stmt
:>
dstate
)
|
Some
cs
->
|
c
s
s
->
begin
match
A
.
get_stmt_state_by_callstack
~
after
stmt
with
begin
match
A
.
get_stmt_state_by_callstack
~
after
stmt
with
|
`Top
->
`Top
|
`Top
->
`Top
|
`Bottom
->
`Bottom
|
`Bottom
->
`Bottom
|
`Value
cmap
->
|
`Value
cmap
->
try
`Value
(
CSmap
.
find
cmap
cs
)
match
css
with
with
Not_found
->
`Bottom
|
[
cs
]
->
begin
try
`Value
(
CSmap
.
find
cmap
cs
)
with
Not_found
->
`Bottom
end
|
css
->
begin
try
CSSmap
.
find
stackcache
(
after
,
stmt
,
css
)
with
Not_found
->
(
List
.
fold_left
(
fun
d
cs
->
try
let
s
=
CSmap
.
find
cmap
cs
in
match
d
with
|
`Bottom
->
d
|
`Value
s0
->
`Value
(
A
.
Dom
.
join
s0
s
)
with
Not_found
->
d
)
`Bottom
css
:>
dstate
)
end
end
end
let
d
bottom
=
{
let
d
none
=
{
alarms
=
[]
;
alarms
=
[]
;
values
=
[
`Here
,
"Unreachable (bottom)"
]
;
values
=
[]
;
}
}
let
dtop
=
{
let
dtop
=
{
alarms
=
[]
;
alarms
=
[]
;
values
=
[
`Here
,
"Not available (top)"
]
;
values
=
[
`Here
,
"Not available."
]
;
}
let
dbottom
=
{
alarms
=
[]
;
values
=
[
`Here
,
"Unreachable."
]
;
}
}
let
dalarms
alarms
=
let
dalarms
alarms
=
...
@@ -157,10 +199,13 @@ struct
...
@@ -157,10 +199,13 @@ struct
alarms
alarms
end
end
let
domain
probe
callstack
=
let
dexpr
e
s
css
=
deval
(
e_expr
e
)
s
css
match
probe
with
let
dlval
l
s
css
=
deval
(
e_lval
l
)
s
css
|
Expr
(
expr
,
stmt
)
->
deval
(
e_expr
expr
)
stmt
callstack
|
Lval
(
lval
,
stmt
)
->
deval
(
e_lval
lval
)
stmt
callstack
let
domain
marker
_callstacks
=
let
open
Printer_tag
in
match
marker
with
|
_
->
dnone
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment