ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
instrument_cov.c
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SanitizerCoverage hooks for ascii-chat instrumentation runtime
3
5#include "common.h"
6
7#include <stdint.h>
8
10 if (guard == NULL || *guard == 0U) {
11 return;
12 }
13
14 asciichat_instr_log_pc((uintptr_t)__builtin_return_address(0));
15}
16
18 if (start == NULL || stop == NULL || start == stop) {
19 return;
20 }
21
22 if (*start != 0U) {
23 return;
24 }
25
26 uint32_t counter = 1U;
27 for (uint32_t *it = start; it < stop; ++it) {
28 if (*it == 0U) {
29 *it = counter++;
30 }
31 }
32}
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