Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cortex-m-rtfm-klee
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Samuel Karlsson
cortex-m-rtfm-klee
Commits
76c6f162
Commit
76c6f162
authored
Mar 6, 2018
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
Only enable output data after idle is reached
parent
9b983eb5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
klee_stm_gdb.py
+27
-10
27 additions, 10 deletions
klee_stm_gdb.py
with
27 additions
and
10 deletions
klee_stm_gdb.py
+
27
−
10
View file @
76c6f162
...
...
@@ -32,6 +32,7 @@ task_name = ""
outputdata
=
[]
init_done
=
0
enable_output
=
0
"""
Max number of events guard
"""
object_index_max
=
100
...
...
@@ -112,6 +113,7 @@ class MainBP(gdb.Breakpoint):
def
stop
(
self
):
global
init_done
global
enable_output
print
(
"
Breakpoint location: %s
"
%
self
.
location
)
if
self
.
location
==
"
main
"
:
...
...
@@ -123,6 +125,13 @@ class MainBP(gdb.Breakpoint):
else
:
gdb
.
post_event
(
gather_data
)
elif
self
.
location
==
"
idle
"
:
print
(
"
Reached IDLE
"
)
enable_output
=
1
gdb_cyccnt_reset
()
gdb
.
prompt_hook
=
prompt
return
True
"""
Needed to actually stop after the breakpoint
True: Return prompt
False: Continue?
...
...
@@ -140,6 +149,7 @@ def stop_event(evt):
global
task_name
global
file_index_current
global
file_list
global
enable_output
file_name
=
file_list
[
file_index_current
].
split
(
'
/
'
)[
-
1
]
"""
...
...
@@ -155,6 +165,7 @@ def stop_event(evt):
since every claim have ceiling
"""
cyccnt
=
gdb_cyccnt_read
()
if
enable_output
:
outputdata
.
append
([
file_name
,
task_name
,
cyccnt
,
0
,
"
Finish
"
])
gdb_cyccnt_reset
()
...
...
@@ -185,6 +196,8 @@ def stop_event(evt):
If outputdata is empty, we start
If the same ceiling as previously: exit
"""
# print("outputdata: %s" % outputdata)
if
enable_output
:
if
len
(
outputdata
):
if
outputdata
[
-
1
][
3
]
>=
ceiling
:
action
=
"
Exit
"
...
...
@@ -236,6 +249,7 @@ def posted_event_init():
global
file_index_current
global
file_list
global
outputdata
global
enable_output
"""
Load the variable data
"""
ktest_setdata
(
file_index_current
)
...
...
@@ -248,6 +262,7 @@ def posted_event_init():
init_done
=
0
file_index_current
+=
1
gdb
.
post_event
(
posted_event_init
)
# gdb.post_event(gather_data)
return
"""
...
...
@@ -261,6 +276,7 @@ def posted_event_init():
if
not
task_to_test
==
-
1
:
file_name
=
file_list
[
file_index_current
].
split
(
'
/
'
)[
-
1
]
task_name
=
tasks
[
task_to_test
]
if
enable_output
:
outputdata
.
append
([
file_name
,
task_name
,
0
,
0
,
"
Start
"
])
gdb
.
write
(
'
Task to call: %s
\n
'
%
(
...
...
@@ -568,6 +584,7 @@ gdb.execute("load %s" % (stm_out_folder + example_name))
"""
Break at main to set variable values
"""
# AddBreakpoint("main")
MainBP
(
"
main
"
)
MainBP
(
"
init
"
)
"""
Tell gdb-dashboard to hide
"""
...
...
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