원클릭으로
code-coverage-with-gcov
Add gcov code coverage instrumentation to C/C++ projects
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add gcov code coverage instrumentation to C/C++ projects
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Provides adversarial code comprehension for security research, mapping architecture, tracing data flows, and hunting vulnerability variants to build ground-truth understanding before or alongside static analysis.
Multi-stage pipeline for validating that vulnerability findings are real, reachable, and exploitable, preventing wasted effort on hallucinated findings, dead code paths, or findings with unrealistic preconditions.
Dynamic instrumentation via Frida - attach to or spawn a process, load a JS hook script, capture send() events into a lifecycle-managed run directory. Supports local, USB-attached, and remote frida-server targets.
Generate, export, load, and verify forensic evidence from GitHub sources. Use when creating verifiable evidence objects from GitHub API, GH Archive, Wayback Machine, local git repositories, or security vendor reports. Handles evidence storage, querying, and re-verification against original sources.
Deterministic debugging with rr record-replay. Use when debugging crashes, ASAN faults, or when reverse execution is needed. Provides reverse-next, reverse-step, reverse-continue commands and crash trace extraction.
Instrument C/C++ with -finstrument-functions for execution tracing and Perfetto visualisation
| name | Code Coverage with gcov |
| description | Add gcov code coverage instrumentation to C/C++ projects |
| user-invocable | false |
| version | 1 |
| author | Claude |
| tags | ["coverage","gcov","testing"] |
Instrument C/C++ programs with gcov to measure test coverage.
gcc --coverage -o program source.c
./program
# Creates .gcda files with execution data
Text report:
gcov source.c
# Creates source.c.gcov with line-by-line coverage
HTML report:
gcovr --html-details -o coverage.html
--coverage (shorthand for -fprofile-arcs -ftest-coverage -lgcov)CFLAGS and LDFLAGSENABLE_COVERAGE ?= 0
ifeq ($(ENABLE_COVERAGE),1)
CFLAGS += --coverage
LDFLAGS += --coverage
endif
option(ENABLE_COVERAGE "Enable coverage" OFF)
if(ENABLE_COVERAGE)
add_compile_options(--coverage)
add_link_options(--coverage)
endif()
--coverage to CFLAGS and LDFLAGSmake clean or rm -f *.gcda *.gcnomake ENABLE_COVERAGE=1 or cmake -DENABLE_COVERAGE=ONmake test or ./test_suitegcovr --html-details coverage.html --print-summaryText (.gcov files):
-: 0:Source:main.c
5: 42: int x = 10;
#####: 43: unused_code();
5: = executed 5 times#####: = not executed-: = non-executableHTML: Interactive report with color-coded coverage
Target: 80%+ line coverage, 70%+ branch coverage