-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Reference
Hugo edited this page Feb 26, 2026
·
1 revision
./cc [coretrace-options] [clang-options] <inputs...>CoreTrace-specific flags are parsed first, and non-CoreTrace arguments are forwarded to Clang/Driver behavior.
| Flag | Effect |
|---|---|
-h, --help
|
Show help and exit |
--instrument |
Enable instrumentation pipeline and runtime linking |
--in-mem, --in-memory
|
Use OutputMode::ToMemory (LLVM IR string/stdout) |
-- |
Stop CoreTrace parsing; forward remaining args as-is |
| Flag | Effect |
|---|---|
--ct-modules=<list> |
Set enabled modules among trace,alloc,bounds,vtable,all
|
Notes:
-
--ct-modulesresets module booleans (trace/alloc/bounds/vtable) before applying the list. - Default module booleans:
trace=true,alloc=true,bounds=true,vtable=false.
| Flag | Default | Effect |
|---|---|---|
--ct-alloc / --ct-no-alloc
|
enabled | Toggle allocation instrumentation |
--ct-alloc-trace / --ct-no-alloc-trace
|
enabled | Toggle runtime alloc/free logs |
--ct-autofree / --ct-no-autofree
|
disabled | Toggle compile-time auto-free feature bit |
| Flag | Default | Effect |
|---|---|---|
--ct-bounds / --ct-no-bounds
|
enabled | Toggle bounds instrumentation |
--ct-bounds-no-abort |
disabled | Log violations without abort |
| Flag | Default | Effect |
|---|---|---|
--ct-trace / --ct-no-trace
|
enabled | Toggle function entry/exit tracing |
| Flag | Default | Effect |
|---|---|---|
--ct-vcall-trace / --ct-no-vcall-trace
|
disabled | Toggle virtual call tracing hooks |
--ct-vtable-diag / --ct-no-vtable-diag
|
disabled | Toggle diagnostic verbosity in runtime |
| Flag | Default | Effect |
|---|---|---|
--ct-shadow |
disabled | Enable shadow metadata |
--ct-shadow-aggressive / --ct-shadow=aggressive
|
disabled | Enable aggressive shadow mode |
| Flag | Default | Effect |
|---|---|---|
--ct-optnone |
disabled | Inject optnone + noinline on user-defined functions |
--ct-no-optnone |
disabled | Explicitly disable this behavior |
-
-o=<file>and-x=<lang>are normalized internally to-o <file>and-x <lang>. - Most
--ct-*flags only affect compilation when--instrumentis enabled. - Exception:
--ct-optnonecan still affect frontend execution without--instrument. - In
--in-memmode:- no linking is performed,
- only a single compilation job is supported.
# C and C++
./build/cc main.c -o app_c
./build/cc main.cpp -o app_cpp
# Force C++ mode for .c source
./build/cc -x c++ legacy.c -o legacy_cpp
# Instrumented build
./build/cc --instrument --ct-modules=trace,alloc,bounds main.c -o app_inst
# VTable diagnostics
./build/cc --instrument --ct-modules=vtable --ct-vcall-trace --ct-vtable-diag main.cpp -o app_vtable
# ToMemory LLVM IR
./build/cc --in-mem -emit-llvm main.cStart
Architecture
Instrumentation
Developer