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
bcf95193
Commit
bcf95193
authored
7 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
Also print the action taken,
If Enter, Exit from the claim
parent
f9508a76
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
-19
27 additions, 19 deletions
klee_stm_gdb.py
with
27 additions
and
19 deletions
klee_stm_gdb.py
+
27
−
19
View file @
bcf95193
...
...
@@ -189,13 +189,28 @@ def stop_event(evt):
since every claim have ceiling
"""
gdb
.
events
.
stop
.
disconnect
(
stop_event
)
outputdata
.
append
([
tmp1
,
tmp2
,
0
,
"
Finish
"
])
print
(
"
Claims:
"
)
print
(
outputdata
)
for
x
in
outputdata
:
print
(
"
%s
\n
"
%
x
)
gdb
.
execute
(
"
quit
"
)
print
(
"
CYCCNT: %s
\n
Ceiling: %s
"
%
(
tmp2
,
tmp3
))
outputdata
.
append
([
tmp1
,
tmp2
,
tmp3
])
"""
If outputdata is empty, we start
If the same ceiling as previously: exit
"""
if
len
(
outputdata
):
if
outputdata
[
-
1
][
2
]
>=
tmp3
:
action
=
"
Exit
"
else
:
action
=
"
Enter
"
else
:
action
=
"
Enter
"
outputdata
.
append
([
tmp1
,
tmp2
,
tmp3
,
action
])
"""
Prepare a prompt for do_continue()
...
...
@@ -246,30 +261,23 @@ def posted_event_init():
"""
gdb_cyccnt_enable
()
gdb_cyccnt_reset
()
# ccount = gdb_cyccnt_read()
# print(ccount)
#
print("Tasks: ", tasks)
print
(
"
Tasks:
"
,
tasks
)
# print("Name of task to test:", tasks[task_to_test])
if
not
task_to_test
==
-
1
:
gdb
.
write
(
'
Task to call: %s
\n
'
%
(
"
stub_
"
+
gdb
.
write
(
'
Task to call: %s
\n
'
%
(
tasks
[
task_to_test
]
+
"
()
"
))
task_name
=
tasks
[
task_to_test
]
# gdb.prompt_hook = prompt
gdb
.
execute
(
'
call %s
'
%
"
stub_
"
+
tasks
[
task_to_test
]
+
"
()
"
)
print
(
"
Called stub
"
)
task_to_test
=
-
1
do_continue
()
else
:
# gdb.execute("mon mdw 0xe0001004")
# print(gdb_cyccnt_read())
print
(
"
Done else
"
)
print
(
"
In init!
"
)
# do_continue()
def
gather_data
():
...
...
@@ -282,6 +290,10 @@ def gather_data():
def
posted_event_finish_execution
():
"""
FIXME: Not used currently
"""
"""
Called when the breakpoint at finish_execution() is hit
"""
global
file_list
global
file_index_current
...
...
@@ -497,8 +509,8 @@ def gdb_cyccnt_reset():
def
gdb_cyccnt_read
():
# Read cycle counter
return
int
(
gdb
.
execute
(
"
mon mdw 0xe0001004
"
,
False
,
True
).
strip
(
'
\n
'
).
strip
(
'
0xe000012004:
'
).
strip
(
'
,
'
).
strip
(),
16
)
return
int
(
gdb
.
execute
(
"
mon mdw 0xe0001004
"
,
False
,
True
).
strip
(
'
\n
'
).
strip
(
'
0xe000012004:
'
).
strip
(
'
,
'
).
strip
(),
16
)
def
gdb_cyccnt_write
(
num
):
...
...
@@ -506,10 +518,6 @@ def gdb_cyccnt_write(num):
gdb
.
execute
(
'
mon mww 0xe0001004 %r
'
%
num
)
def
gdb_basepri_read
():
return
gdb
.
execute
(
"
readbasepri()
"
,
False
,
True
)
"""
Run KLEE on the generated files
"""
# print(klee_run())
...
...
@@ -539,7 +547,7 @@ file_list = ktest_iterate()
"""
Get all the tasks to jump to
"""
tasks
=
tasklist_get
()
print
(
tasks
)
#
print(tasks)
"""
Run until the next breakpoint
"""
gdb
.
execute
(
"
c
"
)
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