[compiler-rt] [sanitizers] improve debug output for failed suppression parse (PR #72066)

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 12 12:16:46 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (schenker)

<details>
<summary>Changes</summary>

If a sanitizer suppression file can not be parsed, add the supported suppression types to the error message.

See https://github.com/llvm/llvm-project/issues/72060.

---
Full diff: https://github.com/llvm/llvm-project/pull/72066.diff


1 Files Affected:

- (modified) compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp (+4) 


``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
index f3818526baab1b7..a94178828bd80db 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
@@ -139,6 +139,10 @@ void SuppressionContext::Parse(const char *str) {
       }
       if (type == suppression_types_num_) {
         Printf("%s: failed to parse suppressions\n", SanitizerToolName);
+        Printf("Supported suppression types are:\n");
+        for (type = 0; type < suppression_types_num_; type++) {
+          Printf("- %s\n", suppression_types_[type]);
+        }
         Die();
       }
       Suppression s;

``````````

</details>


https://github.com/llvm/llvm-project/pull/72066


More information about the llvm-commits mailing list