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
cf4c4b09
Commit
cf4c4b09
authored
4 years ago
by
David Bühler
Committed by
Michele Alberti
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] New component displaying the values inferred by an Eva analysis.
parent
fba51f48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/renderer/Application.tsx
+2
-0
2 additions, 0 deletions
ivette/src/renderer/Application.tsx
ivette/src/renderer/Values.tsx
+102
-0
102 additions, 0 deletions
ivette/src/renderer/Values.tsx
with
104 additions
and
0 deletions
ivette/src/renderer/Application.tsx
+
2
−
0
View file @
cf4c4b09
...
@@ -21,6 +21,7 @@ import ASTinfo from './ASTinfo';
...
@@ -21,6 +21,7 @@ import ASTinfo from './ASTinfo';
import
Globals
from
'
./Globals
'
;
import
Globals
from
'
./Globals
'
;
import
Properties
from
'
./Properties
'
;
import
Properties
from
'
./Properties
'
;
import
Locations
from
'
./Locations
'
;
import
Locations
from
'
./Locations
'
;
import
Values
from
'
./Values
'
;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// --- Selection Controls
// --- Selection Controls
...
@@ -101,6 +102,7 @@ export default (() => {
...
@@ -101,6 +102,7 @@ export default (() => {
<
ASTview
/>
<
ASTview
/>
<
ASTinfo
/>
<
ASTinfo
/>
<
Locations
/>
<
Locations
/>
<
Values
/>
</
Group
>
</
Group
>
</
LabView
>
</
LabView
>
</
Splitter
>
</
Splitter
>
...
...
This diff is collapsed.
Click to expand it.
ivette/src/renderer/Values.tsx
0 → 100644
+
102
−
0
View file @
cf4c4b09
// --------------------------------------------------------------------------
// --- Eva Values
// --------------------------------------------------------------------------
import
_
from
'
lodash
'
;
import
React
from
'
react
'
;
import
*
as
States
from
'
frama-c/states
'
;
import
{
Table
,
Column
,
DefineColumn
}
from
'
dome/table/views
'
;
import
{
ArrayModel
}
from
'
dome/table/arrays
'
;
import
{
Component
}
from
'
frama-c/LabViews
'
;
import
{
Icon
}
from
'
dome/controls/icons
'
;
import
{
Label
}
from
'
dome/controls/labels
'
;
// --------------------------------------------------------------------------
// --- Columns
// --------------------------------------------------------------------------
const
CallstackColumn
=
DefineColumn
({
title
:
'
Context of the evaluation
'
,
align
:
'
left
'
,
width
:
100
,
renderValue
:
(
cs
:
any
)
=>
<
Label
label
=
{
cs
.
short
}
title
=
{
cs
.
full
}
/>,
});
const
AlarmColumn
=
DefineColumn
({
title
:
'
Did the evaluation emit an alarm?
'
,
align
:
'
center
'
,
width
:
26
,
fixed
:
'
true
'
,
icon
:
'
WARNING
'
,
renderValue
:
(
alarm
:
boolean
)
=>
{
if
(
alarm
)
return
<
Icon
id
=
"ATTENTION"
/>;
return
<>
</>;
},
});
// --------------------------------------------------------------------------
// --- Values Panel
// --------------------------------------------------------------------------
const
Values
=
()
=>
{
const
model
=
React
.
useMemo
(()
=>
new
ArrayModel
(),
[]);
const
items
=
States
.
useSyncArray
(
'
eva.values
'
);
const
[
select
]
=
States
.
useSelection
();
const
marker
=
select
&&
select
.
marker
;
const
t
=
States
.
useRequest
(
'
eva.values.compute
'
,
marker
||
''
);
const
markers
=
States
.
useSyncArray
(
'
kernel.ast.markerKind
'
);
const
name
=
React
.
useRef
(
''
);
React
.
useEffect
(()
=>
{
if
(
marker
&&
items
)
{
const
mark
=
markers
[
marker
];
if
(
mark
&&
mark
.
name
)
{
name
.
current
=
mark
.
name
;
}
model
.
setData
(
_
.
toArray
(
items
));
}
},
[
model
,
items
,
t
,
name
,
marker
,
markers
]);
// Component
return
(
<>
<
Table
model
=
{
model
}
>
<
CallstackColumn
id
=
"callstack"
label
=
"Callstack"
/>
<
Column
id
=
"value_before"
label
=
{
`
${
name
.
current
}
(before)`
}
title
=
"Values inferred by Eva just before the selected point"
disableSort
fill
/>
<
AlarmColumn
id
=
"alarm"
label
=
"Alarm"
/>
<
Column
id
=
"value_after"
label
=
{
`
${
name
.
current
}
(after)`
}
title
=
"Values inferred by Eva just after the selected point"
disableSort
fill
/>
</
Table
>
</>
);
};
// --------------------------------------------------------------------------
// --- Export Component
// --------------------------------------------------------------------------
export
default
()
=>
(
<
Component
id
=
"frama-c.values"
label
=
"Eva Values"
title
=
"Values inferred by the Eva analysis"
>
<
Values
/>
</
Component
>
);
// --------------------------------------------------------------------------
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