Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
mimicji committed Nov 9, 2020
1 parent 2fb77d6 commit 82fa5a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Peekaboo
[![deepcode](https://www.deepcode.ai/api/gh/badge?key=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwbGF0Zm9ybTEiOiJnaCIsIm93bmVyMSI6Im1lbHlueCIsInJlcG8xIjoicGVla2Fib28iLCJpbmNsdWRlTGludCI6ZmFsc2UsImF1dGhvcklkIjoyNDY3OSwiaWF0IjoxNjA0OTI1NjI0fQ.YSBSFLNaSRmg13ZSL4QDfpDUXTbf5umrrKcCyztJ2PE)](https://www.deepcode.ai/app/gh/melynx/peekaboo/_/dashboard?utm_content=gh%2Fmelynx%2Fpeekaboo)

Peekaboo is an attempt to provide an easily extensible and usable dynamic trace
format. Peekaboo provides definitions for typical properties expected for
dynamic traces like instruction addresses, memory operand info, register info,
Expand Down
3 changes: 2 additions & 1 deletion libpeekaboo/libpeekaboo.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ peekaboo_trace_t *create_trace(char *name)

trace_ptr = (peekaboo_trace_t *)malloc(sizeof(peekaboo_trace_t));
if (!trace_ptr) PEEKABOO_DIE("libpeekaboo: Unable to malloc trace instance.\n");

create_trace_file(dir_path, "insn.trace", MAX_PATH, &trace_ptr->insn_trace);
create_trace_file(dir_path, "regfile", MAX_PATH, &trace_ptr->regfile);
create_trace_file(dir_path, "memfile", MAX_PATH, &trace_ptr->memfile);
Expand Down Expand Up @@ -242,6 +242,7 @@ void load_memrefs_offsets(char *dir_path, peekaboo_trace_t *trace)
if (base_offset!=0) fprintf(stderr, "libpeekaboo: (Trace from a child thread/process?) Re-align the memory offset, starting from %ld.\n", base_offset/sizeof(memfile_t));

FILE *memrefs_offsets = fopen(path, "wb");
if (!memrefs_offsets) PEEKABOO_DIE("libpeekaboo: Fail to open memref file!\n");

memref_t buffer[1024];
size_t write_buffer[1024];
Expand Down

0 comments on commit 82fa5a1

Please sign in to comment.