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
9f1290d3
Commit
9f1290d3
authored
3 years ago
by
Maxime Jacquemin
Committed by
Maxime Jacquemin
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] Details in values_request
Just some minor rewritting.
parent
cdad2057
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
+10
-16
10 additions, 16 deletions
src/plugins/value/api/values_request.ml
with
10 additions
and
16 deletions
src/plugins/value/api/values_request.ml
+
10
−
16
View file @
9f1290d3
...
...
@@ -311,11 +311,9 @@ let get_bases cvalue =
(* Get pointed bases from an offsetmap. *)
let
get_pointed_bases
=
function
|
Offsetmap
offsm
->
Cvalue
.
V_Offsetmap
.
fold_on_values
(
fun
v
acc
->
let
v
=
Cvalue
.
V_Or_Uninitialized
.
get_v
v
in
Base
.
Hptset
.
union
acc
(
get_bases
v
))
offsm
Base
.
Hptset
.
empty
let
get_bases
v
=
Cvalue
.
V_Or_Uninitialized
.
get_v
v
|>
get_bases
in
let
f
v
acc
=
get_bases
v
|>
Base
.
Hptset
.
union
acc
in
Cvalue
.
V_Offsetmap
.
fold_on_values
f
offsm
Base
.
Hptset
.
empty
|
Bottom
|
Empty
|
Top
|
InvalidLoc
->
Base
.
Hptset
.
empty
(* Only keep a list of C variables from both previous functions. *)
...
...
@@ -342,9 +340,8 @@ module Proxy(A : Analysis.S) : EvaProxy = struct
type
dstate
=
A
.
Dom
.
state
or_top_or_bottom
let
get_precise_loc
=
match
A
.
Loc
.
get
Main_locations
.
PLoc
.
key
with
|
None
->
fun
_
->
Precise_locs
.
loc_top
|
Some
get
->
get
let
default
=
fun
_
->
Precise_locs
.
loc_top
in
Option
.
value
~
default
(
A
.
Loc
.
get
Main_locations
.
PLoc
.
key
)
let
get_cvalue
=
let
default
=
fun
_
->
Cvalue
.
V
.
top
in
...
...
@@ -396,16 +393,13 @@ module Proxy(A : Analysis.S) : EvaProxy = struct
(* Creates an exported [value] from an evaluation result. *)
let
make_value
typ
stmt
(
result
,
alarms
)
=
let
alarms
=
let
descr
=
Format
.
asprintf
"@[<hov 2>%a@]"
Alarms
.
pretty
in
let
f
alarm
status
acc
=
(
status
,
descr
alarm
)
::
acc
in
Alarmset
.
fold
f
[]
alarms
|>
List
.
rev
in
let
descr
=
Format
.
asprintf
"@[<hov 2>%a@]"
Alarms
.
pretty
in
let
f
alarm
status
acc
=
(
status
,
descr
alarm
)
::
acc
in
let
alarms
=
Alarmset
.
fold
f
[]
alarms
|>
List
.
rev
in
let
pretty_eval
=
Bottom
.
pretty
(
pp_result
typ
)
in
let
value
=
Pretty_utils
.
to_string
pretty_eval
result
in
let
pointed_vars
=
Bottom
.
fold
~
bottom
:
[]
(
get_pointed_markers
stmt
)
result
in
let
pointed_markers
=
get_pointed_markers
stmt
in
let
pointed_vars
=
Bottom
.
fold
~
bottom
:
[]
pointed_markers
result
in
{
value
;
alarms
;
pointed_vars
}
(* --- Evaluates an expression or lvalue into an evaluation [result]. ----- *)
...
...
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