r313179 - [docs] Update LeakSanitizer documentation to reflect OS X support

Francis Ricci via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 12:40:10 PDT 2017


Author: fjricci
Date: Wed Sep 13 12:40:10 2017
New Revision: 313179

URL: http://llvm.org/viewvc/llvm-project?rev=313179&view=rev
Log:
[docs] Update LeakSanitizer documentation to reflect OS X support

Reviewers: kcc, alekseyshl, kubamracek, glider

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37811

Modified:
    cfe/trunk/docs/AddressSanitizer.rst
    cfe/trunk/docs/LeakSanitizer.rst

Modified: cfe/trunk/docs/AddressSanitizer.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/AddressSanitizer.rst?rev=313179&r1=313178&r2=313179&view=diff
==============================================================================
--- cfe/trunk/docs/AddressSanitizer.rst (original)
+++ cfe/trunk/docs/AddressSanitizer.rst Wed Sep 13 12:40:10 2017
@@ -140,7 +140,8 @@ Memory leak detection
 ---------------------
 
 For more information on leak detector in AddressSanitizer, see
-:doc:`LeakSanitizer`. The leak detection is turned on by default on Linux;
+:doc:`LeakSanitizer`. The leak detection is turned on by default on Linux,
+and can be enabled using ``ASAN_OPTIONS=detect_leaks=1`` on OS X;
 however, it is not yet supported on other platforms.
 
 Issue Suppression

Modified: cfe/trunk/docs/LeakSanitizer.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LeakSanitizer.rst?rev=313179&r1=313178&r2=313179&view=diff
==============================================================================
--- cfe/trunk/docs/LeakSanitizer.rst (original)
+++ cfe/trunk/docs/LeakSanitizer.rst Wed Sep 13 12:40:10 2017
@@ -17,7 +17,7 @@ detection phase.
 Usage
 =====
 
-LeakSanitizer is only supported on x86\_64 Linux. In order to use it,
+LeakSanitizer is supported on x86\_64 Linux and OS X. In order to use it,
 simply build your program with :doc:`AddressSanitizer`:
 
 .. code-block:: console
@@ -30,7 +30,7 @@ simply build your program with :doc:`Add
       p = 0; // The memory is leaked here.
       return 0;
     }
-    % clang -fsanitize=address -g memory-leak.c ; ./a.out
+    % clang -fsanitize=address -g memory-leak.c ; ASAN_OPTIONS=detect_leaks=1 ./a.out
     ==23646==ERROR: LeakSanitizer: detected memory leaks
     Direct leak of 7 byte(s) in 1 object(s) allocated from:
         #0 0x4af01b in __interceptor_malloc /projects/compiler-rt/lib/asan/asan_malloc_linux.cc:52:3




More information about the cfe-commits mailing list