From 1458b364e100752374725b0cbf83b70a54b327d3 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Fri, 1 Aug 2025 15:51:36 +0200 Subject: 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. --- executor/executor.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'executor/executor.cc') 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 { -- cgit mrf-deployment