ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
instrument_cov.c
Go to the documentation of this file.
1
17// SPDX-License-Identifier: MIT
18// SanitizerCoverage hooks for ascii-chat instrumentation runtime
19
21#include <ascii-chat/common.h>
22
23#include <stdint.h>
24
26 if (guard == NULL || *guard == 0U) {
27 return;
28 }
29
30 asciichat_instr_log_pc((uintptr_t)__builtin_return_address(0));
31}
32
34 if (start == NULL || stop == NULL || start == stop) {
35 return;
36 }
37
38 if (*start != 0U) {
39 return;
40 }
41
42 uint32_t counter = 1U;
43 for (uint32_t *it = start; it < stop; ++it) {
44 if (*it == 0U) {
45 *it = counter++;
46 }
47 }
48}
⚙️ Common definitions, error codes, macros, and types shared throughout the application
unsigned int uint32_t
Definition common.h:58
void asciichat_instr_log_pc(uintptr_t program_counter)
Log a program counter for coverage analysis.
void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop)
void __sanitizer_cov_trace_pc_guard(uint32_t *guard)
🔍 Debug instrumentation logging runtime for ascii-chat line tracing