llvm-project/compiler-rt/lib/msan
Dan Liew 4c39f34199 [SanitizerCommon] Print the current value of options when printing out help.
Summary:
Previously it wasn't obvious what the default value of various sanitizer
options were. A very close approximation of the "default values" for the
options are the current value of the options at the time of printing the
help output.

In the case that no other options are provided then the current values
are the default values (apart from `help`).

```
ASAN_OPTIONS=help=1 ./program
```

This patch causes the current option values to be printed when the
`help` output is enabled. The original intention for this patch was to append
`(Default: <value>)` to an option's help text. However because this
is technically wrong (and misleading) I've opted to append
`(Current Value: <value>)` instead.

When trying to implement a way of displaying the default value of the
options I tried another solution where the default value used in `*.inc` files
were used to create compile time strings that where used when printing
the help output. This solution was not satisfactory for several reasons:

* Stringifying the default values with the preprocessor did not work very
well in several cases.  Some options contain boolean operators which no
amount of macro expansion can get rid of.
* It was much more invasive than this patch. Every sanitizer had to be changed.
* The settings of `__<sanitizer>_default_options()` are ignored.

For those reasons I opted for the solution in this patch.

rdar://problem/42567204

Reviewers: kubamracek, yln, kcc, dvyukov, vitalybuka, cryptoad, eugenis, samsonov

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69546
2019-11-14 14:04:34 -08:00
..
tests [msan] Blacklist __gxx_personality_v0. 2019-10-31 10:22:52 -07:00
.clang-format [sanitizer] Remove unneeded blank lines 2018-05-09 00:44:26 +00:00
CMakeLists.txt [msan] Blacklist __gxx_personality_v0. 2019-10-31 10:22:52 -07:00
msan.cpp [SanitizerCommon] Print the current value of options when printing out help. 2019-11-14 14:04:34 -08:00
msan.h [compiler-rt] Remove some cpplint filters 2019-09-12 02:20:36 +00:00
msan.syms.extra
msan_allocator.cpp [sanitizer_common] Create max_allocation_size_mb flag. 2019-10-30 11:26:05 -07:00
msan_allocator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_blacklist.txt [msan] Blacklist __gxx_personality_v0. 2019-10-31 10:22:52 -07:00
msan_chained_origin_depot.cpp compiler-rt: Rename .cc file in lib/msan to .cpp 2019-08-01 14:08:18 +00:00
msan_chained_origin_depot.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_flags.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_interceptors.cpp [compiler-rt] [msan] Correct the __libc_thr_keycreate prototype 2019-11-04 01:10:59 +01:00
msan_interface_internal.h [MSan] Introduce __msan_unpoison_param(). 2019-05-09 21:50:57 +00:00
msan_linux.cpp Update compiler-rt cpplint.py 2019-09-11 21:33:06 +00:00
msan_new_delete.cpp Remove NOLINTs from compiler-rt 2019-09-11 23:19:48 +00:00
msan_origin.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_poisoning.cpp compiler-rt: Rename .cc file in lib/msan to .cpp 2019-08-01 14:08:18 +00:00
msan_poisoning.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_report.cpp compiler-rt: Rename .cc file in lib/msan to .cpp 2019-08-01 14:08:18 +00:00
msan_report.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_thread.cpp compiler-rt: Rename .cc file in lib/msan to .cpp 2019-08-01 14:08:18 +00:00
msan_thread.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00