From: Kostya Serebryany Date: Fri, 25 Aug 2017 19:29:47 +0000 (+0000) Subject: [sanitizer-coverage] extend fsanitize-coverage=pc-table with flags for every PC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=271a5091063205fff225c8e0066a59ee5472f656;p=clang [sanitizer-coverage] extend fsanitize-coverage=pc-table with flags for every PC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311794 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/SanitizerCoverage.rst b/docs/SanitizerCoverage.rst index dbf4cc1509..737f92866f 100644 --- a/docs/SanitizerCoverage.rst +++ b/docs/SanitizerCoverage.rst @@ -148,19 +148,21 @@ With ``-fsanitize-coverage=pc-table`` the compiler will create a table of instrumented PCs. Requires either ``-fsanitize-coverage=inline-8bit-counters`` or ``-fsanitize-coverage=trace-pc-guard``. -Users need to implement a single function to capture the counters at startup: +Users need to implement a single function to capture the PC table at startup: .. code-block:: c++ extern "C" - void __sanitizer_cov_pcs_init(const uint8_t *pcs_beg, - const uint8_t *pcs_end) { + void __sanitizer_cov_pcs_init(const uintptr_t *pcs_beg, + const uintptr_t *pcs_end) { // [pcs_beg,pcs_end) is the array of ptr-sized integers representing - // PCs of the instrumented blocks in the current DSO. - // Capture this array in order to read the PCs. - // The number of PCs for a given DSO is the same as the number of - // 8-bit counters (-fsanitize-coverage=inline-8bit-counters) or + // pairs [PC,PCFlags] for every instrumented block in the current DSO. + // Capture this array in order to read the PCs and their Flags. + // The number of PCs and PCFlags for a given DSO is the same as the number + // of 8-bit counters (-fsanitize-coverage=inline-8bit-counters) or // trace_pc_guard callbacks (-fsanitize-coverage=trace-pc-guard) + // A PCFlags describes the basic block: + // * bit0: 1 if the block is the function entry block, 0 otherwise. }