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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KLEE
cortex-m-rtfm-klee
Commits
a763f7ac
Commit
a763f7ac
authored
7 years ago
by
Per Lindgren
Browse files
Options
Downloads
Plain Diff
Merge branch 'klee' of gitlab.henriktjader.com:KLEE/cortex-m-rtfm-klee into klee
parents
544b3650
76c6f162
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 @
a763f7ac
...
@@ -32,6 +32,7 @@ task_name = ""
...
@@ -32,6 +32,7 @@ task_name = ""
outputdata
=
[]
outputdata
=
[]
init_done
=
0
init_done
=
0
enable_output
=
0
"""
Max number of events guard
"""
"""
Max number of events guard
"""
object_index_max
=
100
object_index_max
=
100
...
@@ -112,6 +113,7 @@ class MainBP(gdb.Breakpoint):
...
@@ -112,6 +113,7 @@ class MainBP(gdb.Breakpoint):
def
stop
(
self
):
def
stop
(
self
):
global
init_done
global
init_done
global
enable_output
print
(
"
Breakpoint location: %s
"
%
self
.
location
)
print
(
"
Breakpoint location: %s
"
%
self
.
location
)
if
self
.
location
==
"
main
"
:
if
self
.
location
==
"
main
"
:
...
@@ -123,6 +125,13 @@ class MainBP(gdb.Breakpoint):
...
@@ -123,6 +125,13 @@ class MainBP(gdb.Breakpoint):
else
:
else
:
gdb
.
post_event
(
gather_data
)
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
"""
Needed to actually stop after the breakpoint
True: Return prompt
True: Return prompt
False: Continue?
False: Continue?
...
@@ -140,6 +149,7 @@ def stop_event(evt):
...
@@ -140,6 +149,7 @@ def stop_event(evt):
global
task_name
global
task_name
global
file_index_current
global
file_index_current
global
file_list
global
file_list
global
enable_output
file_name
=
file_list
[
file_index_current
].
split
(
'
/
'
)[
-
1
]
file_name
=
file_list
[
file_index_current
].
split
(
'
/
'
)[
-
1
]
"""
"""
...
@@ -155,6 +165,7 @@ def stop_event(evt):
...
@@ -155,6 +165,7 @@ def stop_event(evt):
since every claim have ceiling
since every claim have ceiling
"""
"""
cyccnt
=
gdb_cyccnt_read
()
cyccnt
=
gdb_cyccnt_read
()
if
enable_output
:
outputdata
.
append
([
file_name
,
task_name
,
cyccnt
,
0
,
"
Finish
"
])
outputdata
.
append
([
file_name
,
task_name
,
cyccnt
,
0
,
"
Finish
"
])
gdb_cyccnt_reset
()
gdb_cyccnt_reset
()
...
@@ -185,6 +196,8 @@ def stop_event(evt):
...
@@ -185,6 +196,8 @@ def stop_event(evt):
If outputdata is empty, we start
If outputdata is empty, we start
If the same ceiling as previously: exit
If the same ceiling as previously: exit
"""
"""
# print("outputdata: %s" % outputdata)
if
enable_output
:
if
len
(
outputdata
):
if
len
(
outputdata
):
if
outputdata
[
-
1
][
3
]
>=
ceiling
:
if
outputdata
[
-
1
][
3
]
>=
ceiling
:
action
=
"
Exit
"
action
=
"
Exit
"
...
@@ -236,6 +249,7 @@ def posted_event_init():
...
@@ -236,6 +249,7 @@ def posted_event_init():
global
file_index_current
global
file_index_current
global
file_list
global
file_list
global
outputdata
global
outputdata
global
enable_output
"""
Load the variable data
"""
"""
Load the variable data
"""
ktest_setdata
(
file_index_current
)
ktest_setdata
(
file_index_current
)
...
@@ -248,6 +262,7 @@ def posted_event_init():
...
@@ -248,6 +262,7 @@ def posted_event_init():
init_done
=
0
init_done
=
0
file_index_current
+=
1
file_index_current
+=
1
gdb
.
post_event
(
posted_event_init
)
gdb
.
post_event
(
posted_event_init
)
# gdb.post_event(gather_data)
return
return
"""
"""
...
@@ -261,6 +276,7 @@ def posted_event_init():
...
@@ -261,6 +276,7 @@ def posted_event_init():
if
not
task_to_test
==
-
1
:
if
not
task_to_test
==
-
1
:
file_name
=
file_list
[
file_index_current
].
split
(
'
/
'
)[
-
1
]
file_name
=
file_list
[
file_index_current
].
split
(
'
/
'
)[
-
1
]
task_name
=
tasks
[
task_to_test
]
task_name
=
tasks
[
task_to_test
]
if
enable_output
:
outputdata
.
append
([
file_name
,
task_name
,
0
,
0
,
"
Start
"
])
outputdata
.
append
([
file_name
,
task_name
,
0
,
0
,
"
Start
"
])
gdb
.
write
(
'
Task to call: %s
\n
'
%
(
gdb
.
write
(
'
Task to call: %s
\n
'
%
(
...
@@ -568,6 +584,7 @@ gdb.execute("load %s" % (stm_out_folder + example_name))
...
@@ -568,6 +584,7 @@ gdb.execute("load %s" % (stm_out_folder + example_name))
"""
Break at main to set variable values
"""
"""
Break at main to set variable values
"""
# AddBreakpoint("main")
# AddBreakpoint("main")
MainBP
(
"
main
"
)
MainBP
(
"
main
"
)
MainBP
(
"
init
"
)
"""
Tell gdb-dashboard to hide
"""
"""
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