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
KLEE
cortex-m-rtfm-klee
Commits
ae375568
Commit
ae375568
authored
Mar 11, 2018
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
Fixed debug printounts
parent
c3b8fe4f
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
gdb.py
+19
-19
19 additions, 19 deletions
gdb.py
with
19 additions
and
19 deletions
gdb.py
+
19
−
19
View file @
ae375568
...
@@ -133,12 +133,11 @@ def stop_event(evt):
...
@@ -133,12 +133,11 @@ def stop_event(evt):
global
priority
global
priority
global
file_name
global
file_name
imm
=
gdb_bkpt_read
()
if
debug
:
if
debug
:
print
(
"
Debug: stop event in file {}
"
.
format
(
file_name
))
print
(
"
Debug: stop event in file {}
"
.
format
(
file_name
))
print
(
"
Debug: evt %r
"
%
evt
)
print
(
"
Debug: evt %r
"
%
evt
)
print
(
"
Debug: imm = {}
"
.
format
(
imm
))
imm
=
gdb_bkpt_read
()
print
(
"
imm = {}
"
.
format
(
imm
))
if
imm
==
0
:
if
imm
==
0
:
print
(
"
Ordinary breakpoint, exiting!
"
)
print
(
"
Ordinary breakpoint, exiting!
"
)
...
@@ -262,8 +261,8 @@ def posted_event_init():
...
@@ -262,8 +261,8 @@ def posted_event_init():
print
(
"
%s Total time: %s
"
%
(
obj
,
tot_time
))
print
(
"
%s Total time: %s
"
%
(
obj
,
tot_time
))
else
:
else
:
print
(
"
%s
"
%
(
obj
))
print
(
"
%s
"
%
(
obj
))
# comment out to prevent gdb from finishing, useful to debugging
#
gdb.execute("quit")
gdb
.
execute
(
"
quit
"
)
def
trimZeros
(
str
):
def
trimZeros
(
str
):
...
@@ -281,12 +280,14 @@ def ktest_setdata(file_index):
...
@@ -281,12 +280,14 @@ def ktest_setdata(file_index):
global
file_list
global
file_list
global
debug
global
debug
print
(
"
[[[[[[[[[[[[[[[[ ktest_setdata {}
"
.
format
(
file_index
))
if
debug
:
print
(
"
Debug: ktest_setdata on index{}
"
.
format
(
file_index
))
b
=
KTest
.
fromfile
(
file_list
[
file_index
])
b
=
KTest
.
fromfile
(
file_list
[
file_index
])
print
(
"
[[[[[[[[[[[[[[[[[[here
"
)
if
debug
:
if
debug
:
# print('ktest filename : %r' % filename)
# print('ktest filename : %r' % filename)
gdb
.
write
(
'
ktest file: %r
\n
'
%
file_list
[
file_index
])
print
(
'
Debug:
ktest file: %r
\n
'
%
file_list
[
file_index
])
# print('args : %r' % b.args)
# print('args : %r' % b.args)
# print('num objects: %r' % len(b.objects))
# print('num objects: %r' % len(b.objects))
for
i
,
(
name
,
data
)
in
enumerate
(
b
.
objects
):
for
i
,
(
name
,
data
)
in
enumerate
(
b
.
objects
):
...
@@ -295,8 +296,8 @@ def ktest_setdata(file_index):
...
@@ -295,8 +296,8 @@ def ktest_setdata(file_index):
"""
If Name is
"
task
"
, skip it
"""
"""
If Name is
"
task
"
, skip it
"""
if
name
.
decode
(
'
UTF-8
'
)
==
"
task
"
:
if
name
.
decode
(
'
UTF-8
'
)
==
"
task
"
:
if
debug
:
if
debug
:
print
(
'
object %4d: name: %r
'
%
(
i
,
name
))
print
(
'
Debug:
object %4d: name: %r
'
%
(
i
,
name
))
print
(
'
object %4d: size: %r
'
%
(
i
,
len
(
data
)))
print
(
'
Debug:
object %4d: size: %r
'
%
(
i
,
len
(
data
)))
# print(struct.unpack('i', str).repr())
# print(struct.unpack('i', str).repr())
# task_to_test = struct.unpack('i', str)[0]
# task_to_test = struct.unpack('i', str)[0]
# print("str: ", str)
# print("str: ", str)
...
@@ -304,16 +305,16 @@ def ktest_setdata(file_index):
...
@@ -304,16 +305,16 @@ def ktest_setdata(file_index):
task_to_test
=
struct
.
unpack
(
'
i
'
,
str
)[
0
]
task_to_test
=
struct
.
unpack
(
'
i
'
,
str
)[
0
]
# task_to_test = int(str[0])
# task_to_test = int(str[0])
if
debug
:
if
debug
:
print
(
"
Task to test:
"
,
task_to_test
)
print
(
"
Debug:
Task to test:
"
,
task_to_test
)
else
:
else
:
if
debug
:
if
debug
:
print
(
'
object %4d: name: %r
'
%
(
i
,
name
))
print
(
'
Debug:
object %4d: name: %r
'
%
(
i
,
name
))
print
(
'
object %4d: size: %r
'
%
(
i
,
len
(
data
)))
print
(
'
Degug:
object %4d: size: %r
'
%
(
i
,
len
(
data
)))
print
(
str
)
print
(
str
)
# if opts.writeInts and len(data) == 4:
# if opts.writeInts and len(data) == 4:
obj_data
=
struct
.
unpack
(
'
i
'
,
str
)[
0
]
obj_data
=
struct
.
unpack
(
'
i
'
,
str
)[
0
]
if
debug
:
if
debug
:
print
(
'
object %4d: data: %r
'
%
print
(
'
Dubug:
object %4d: data: %r
'
%
(
i
,
obj_data
))
(
i
,
obj_data
))
# gdb.execute('whatis %r' % name.decode('UTF-8'))
# gdb.execute('whatis %r' % name.decode('UTF-8'))
# gdb.execute('whatis %r' % obj_data)
# gdb.execute('whatis %r' % obj_data)
...
@@ -323,10 +324,9 @@ def ktest_setdata(file_index):
...
@@ -323,10 +324,9 @@ def ktest_setdata(file_index):
# gdb.execute('print %s' % name.decode('UTF-8'))
# gdb.execute('print %s' % name.decode('UTF-8'))
# else:
# else:
# print('object %4d: data: %r' % (i, str))
# print('object %4d: data: %r' % (i, str))
print
(
"
---------------------------------------- ktest_set_end
"
)
if
debug
:
if
debug
:
print
(
"
Done with setdata
"
)
print
(
"
Dubug:
Done with setdata
"
)
return
task_to_test
return
task_to_test
...
@@ -339,7 +339,7 @@ def ktest_iterate():
...
@@ -339,7 +339,7 @@ def ktest_iterate():
curdir
=
os
.
getcwd
()
curdir
=
os
.
getcwd
()
if
debug
:
if
debug
:
print
(
"
Current directory {}
"
.
format
(
curdir
))
print
(
"
Debug:
Current directory {}
"
.
format
(
curdir
))
rustoutputfolder
=
curdir
+
"
/
"
+
klee_out_folder
rustoutputfolder
=
curdir
+
"
/
"
+
klee_out_folder
try
:
try
:
...
@@ -420,7 +420,7 @@ def tasklist_get():
...
@@ -420,7 +420,7 @@ def tasklist_get():
def
xargo_run
(
mode
):
def
xargo_run
(
mode
):
if
"
klee
"
in
mode
:
if
"
klee
"
in
mode
:
xargo_cmd
=
(
"
xargo build --example
"
+
example_name
+
"
--features
"
+
xargo_cmd
=
(
"
xargo build
--release
--example
"
+
example_name
+
"
--features
"
+
"
klee_mode --target x86_64-unknown-linux-gnu
"
)
"
klee_mode --target x86_64-unknown-linux-gnu
"
)
elif
"
stm
"
in
mode
:
elif
"
stm
"
in
mode
:
xargo_cmd
=
(
"
xargo build --release --example
"
+
example_name
+
xargo_cmd
=
(
"
xargo build --release --example
"
+
example_name
+
...
...
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