aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor.cc
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2025-08-01 15:51:36 +0200
committerAlexander Potapenko <glider@google.com>2025-08-05 13:16:45 +0000
commit1458b364e100752374725b0cbf83b70a54b327d3 (patch)
tree4437ea4df3ad5d08a0b052ed22a1152fcbe011ea /executor/executor.cc
parenta4acbebb7c7f9bc7ff56c2e6a0e452aa6438fc11 (diff)
executor: introduce cover_close()
Right now closing a kcov fd on Linux won't disable coverage, so further attempts to open an fd and enable coverage on the same thread will not work. Add cover_close() which will disable the coverage if necessary, and close the file descriptor.
Diffstat (limited to 'executor/executor.cc')
-rw-r--r--executor/executor.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index 704a284a9..53c52efc3 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -376,6 +376,8 @@ struct cover_t {
intptr_t pc_offset;
// The coverage buffer has overflowed and we have truncated coverage.
bool overflow;
+ // True if cover_enable() was called for this object.
+ bool enabled;
};
struct thread_t {