Skip to content
Snippets Groups Projects
Commit a763f7ac authored by Per Lindgren's avatar Per Lindgren
Browse files

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
...@@ -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 """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment