Skip to content

Commit

Permalink
udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerL-Y committed Aug 31, 2024
1 parent d20f279 commit 2c67d33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Empty file.
4 changes: 2 additions & 2 deletions scripts/process_close_cov_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def collect_close_cov_info():
else:
pass
close_cov_raw_files.close()
# os.truncate(project_root + "syzkaller/close_cov_result.txt", 0)
return final_result

def formulate_program_cov_info_for_llm(close_cov_info):
Expand Down Expand Up @@ -136,8 +135,9 @@ def formulate_program_cov_info_for_llm(close_cov_info):
result = collect_close_cov_info()
close_cov_source_code = formulate_program_cov_info_for_llm(result)
close_cov_source_code_file = open(project_root + "ChatAnalyzer/close_cov_prog_source_code.txt", "w+")
# os.truncate(project_root + "ChatAnalyzer/close_cov_prog_source_code.txt", 0)
close_cov_source_code_file.write(close_cov_source_code)
os.chdir(project_root + "ChatAnalyzer/")
print("close ask")
os.system("python3 chat_interface.py close_ask")
os.truncate(project_root + "ChatAnalyzer/close_cov_prog_source_code.txt", 0)
os.truncate(project_root + "syzkaller/close_cov_result.txt", 0)
6 changes: 3 additions & 3 deletions scripts/process_cov_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
for addr_line in close_addr_file.readlines():
stripped_close_addr = addr_line.strip().replace("\n", "")
if "f" in stripped_close_addr:
print("close point collected: " + stripped_close_addr)
# print("close point collected: " + stripped_close_addr)
close_points_set.add(stripped_close_addr)


Expand Down Expand Up @@ -78,12 +78,12 @@
stripped_call_sequence = call_sequence.replace("\n", "").strip()
stripped_arg_sequence = arg_sequence.replace("\n", "").strip()
stripped_addresses_input = addresses_input.strip().replace("\n", "").strip()
if (stripped_addresses_input != "" or stripped_arg_sequence != "" or stripped_call_sequence != "") and contain_close_points:
if (stripped_arg_sequence != "" or stripped_call_sequence != "") and stripped_addresses_input != "" and contain_close_points:
final_write_result = "----- call sequence\n" + call_sequence +\
"----- arg sequence\n" + arg_sequence +\
"----- close points covered\n" + addresses_input
final_write_result += "\n=====\n"

print("write hit cov: " + addresses_input)
with open("./close_cov_result.txt", "a+") as f:
result = subprocess.run(command, input=final_write_result, text=True, stdout=f)
os.system("rm " + path)
Expand Down

0 comments on commit 2c67d33

Please sign in to comment.