diff --git a/klee_stm_gdb.py b/klee_stm_gdb.py index 57fa79e62fc1f52098c306d4896d2af17f1a2ace..e98a31690aa745ae63be5fc9981af6d03970b81c 100644 --- a/klee_stm_gdb.py +++ b/klee_stm_gdb.py @@ -310,8 +310,11 @@ def posted_event_init(): gdb.write('Task to call: %s \n' % ( tasks[task_to_test] + "()")) # gdb.prompt_hook = prompt - gdb.execute('call %s' % "stub_" + - tasks[task_to_test] + "()") + try: + gdb.execute('call %s' % "stub_" + + tasks[task_to_test] + "()") + except gdb.error: + print("GDB ERROR") task_to_test = -1 do_continue() @@ -403,8 +406,10 @@ def ktest_setdata(file_index): def ktest_iterate(): - """ Get the list of folders in current directory, sort and then grab the - last one. + """ + Get the list of folders in current directory, sort and then grab the + last one. + """ global debug global autobuild @@ -606,16 +611,6 @@ else: gdb.execute("file %s" % (stm_out_folder + example_name)) gdb.execute("load %s" % (stm_out_folder + example_name)) -# gdb.execute("step") - -""" Run KLEE on the generated files """ -# print(klee_run()) - -""" Break at main to set variable values """ -# AddBreakpoint("main") -# MainBP("main") -# MainBP("init") - """ Tell gdb-dashboard to hide """ # gdb.execute("dashboard -enabled off") @@ -626,7 +621,8 @@ MainBP("idle") """ Save all ktest files into an array """ file_list = ktest_iterate() -# print(file_list) +if debug: + print(file_list) """ Get all the tasks to jump to """ tasks = tasklist_get() @@ -641,4 +637,4 @@ and skip the stubs gdb.events.stop.connect(stop_event_ignore) """ Run until the next breakpoint """ -gdb.execute("c") +do_continue()