Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ cc_library(
hdrs = ["int_utils.h"],
)

cc_library(
name = "flag_util",
srcs = ["flag_util.cc"],
hdrs = ["flag_util.h"],
deps = [
"@abseil-cpp//absl/base:nullability",
],
)

cc_library(
name = "rolling_hash",
hdrs = ["rolling_hash.h"],
Expand Down Expand Up @@ -1024,6 +1033,8 @@ cc_library(
# e.g. feature.cc. These files are compiled by the engine and the runner
# separately, with different compiler flags.
RUNNER_SOURCES_NO_MAIN = [
"coverage_state.cc",
"coverage_state.h",
"byte_array_mutator.cc",
"byte_array_mutator.h",
"callstack.h",
Expand Down Expand Up @@ -1210,6 +1221,35 @@ cc_library(
deps = ["@abseil-cpp//absl/flags:flag"],
)

cc_library(
name = "coverage_state",
srcs = [
"coverage_state.cc",
"runner_dl_info.cc",
"runner_dl_info.h",
"runner_interceptors.cc",
"runner_sancov.cc",
"runner_sancov_object.cc",
"runner_sancov_object.h",
"runner_utils.cc",
"runner_utils.h",
],
hdrs = ["coverage_state.h"],
deps = [
":callstack",
":feature",
":foreach_nonzero",
":int_utils",
":pc_info",
":reverse_pc_table",
":runner_cmp_trace",
":runner_result",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/numeric:bits",
],
)

################################################################################
# General-purpose testing utilities
################################################################################
Expand Down
3 changes: 3 additions & 0 deletions centipede/control_flow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@
namespace fuzztest::internal {

PCTable ReadPcTableFromFile(std::string_view file_path) {
LOG(INFO) << "ReadPcTableFromFile: " << file_path << "\n";
ByteArray pc_infos_as_bytes;
ReadFromLocalFile(file_path, pc_infos_as_bytes);
CHECK_EQ(pc_infos_as_bytes.size() % sizeof(PCInfo), 0);
LOG(INFO) << "size of pc_infos_as_bytes: " << pc_infos_as_bytes.size()
<< "\n";
size_t pc_table_size = pc_infos_as_bytes.size() / sizeof(PCInfo);
const auto *pc_infos = reinterpret_cast<PCInfo *>(pc_infos_as_bytes.data());
PCTable pc_table{pc_infos, pc_infos + pc_table_size};
Expand Down
Loading