| 1 |
//===-- lsan_flags.inc ------------------------------------------*- C++ -*-===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
// |
| 9 |
// LSan runtime flags. |
| 10 |
// |
| 11 |
//===----------------------------------------------------------------------===// |
| 12 |
#ifndef LSAN_FLAG |
| 13 |
# error "Define LSAN_FLAG prior to including this file!" |
| 14 |
#endif |
| 15 |
|
| 16 |
// LSAN_FLAG(Type, Name, DefaultValue, Description) |
| 17 |
// See COMMON_FLAG in sanitizer_flags.inc for more details. |
| 18 |
|
| 19 |
LSAN_FLAG(bool, report_objects, false, |
| 20 |
"Print addresses of leaked objects after main leak report.") |
| 21 |
LSAN_FLAG( |
| 22 |
int, resolution, 0, |
| 23 |
"Aggregate two objects into one leak if this many stack frames match. If " |
| 24 |
"zero, the entire stack trace must match.") |
| 25 |
LSAN_FLAG(int, max_leaks, 0, "The number of leaks reported.") |
| 26 |
|
| 27 |
// Flags controlling the root set of reachable memory. |
| 28 |
LSAN_FLAG(bool, use_globals, true, |
| 29 |
"Root set: include global variables (.data and .bss)") |
| 30 |
LSAN_FLAG(bool, use_stacks, true, "Root set: include thread stacks") |
| 31 |
LSAN_FLAG(bool, use_registers, true, "Root set: include thread registers") |
| 32 |
LSAN_FLAG(bool, use_tls, true, |
| 33 |
"Root set: include TLS and thread-specific storage") |
| 34 |
LSAN_FLAG(bool, use_root_regions, true, |
| 35 |
"Root set: include regions added via __lsan_register_root_region().") |
| 36 |
LSAN_FLAG(bool, use_ld_allocations, true, |
| 37 |
"Root set: mark as reachable all allocations made from dynamic " |
| 38 |
"linker. This was the old way to handle dynamic TLS, and will " |
| 39 |
"be removed soon. Do not use this flag.") |
| 40 |
|
| 41 |
LSAN_FLAG(bool, use_unaligned, false, "Consider unaligned pointers valid.") |
| 42 |
LSAN_FLAG(bool, use_poisoned, false, |
| 43 |
"Consider pointers found in poisoned memory to be valid.") |
| 44 |
LSAN_FLAG(bool, use_detached, false, |
| 45 |
"Scan threads even if attaching to them failed.") |
| 46 |
LSAN_FLAG(bool, log_pointers, false, "Debug logging") |
| 47 |
LSAN_FLAG(bool, log_threads, false, "Debug logging") |
| 48 |
LSAN_FLAG(int, tries, 1, "Debug option to repeat leak checking multiple times") |
| 49 |
LSAN_FLAG(const char *, suppressions, "", "Suppressions file name.") |
| 50 |
LSAN_FLAG(int, thread_suspend_fail, 1, |
| 51 |
"Behaviour if thread suspendion all thread (0 - " |
| 52 |
"abandon leak checking, 1 - continue with leak checking (reported " |
| 53 |
"leaks can be false), 2 - crash (for debugging LSAN)).") |