summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_symbolizer.h
Commit message (Collapse)AuthorAge
* [Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.Alexey Samsonov2013-10-31
| | | | | | | | | | | | | | | | | | | | | Summary: TSan and MSan need to know if interceptor was called by the user code or by the symbolizer and use pre- and post-symbolization hooks for that. Make Symbolizer class responsible for calling these hooks instead. This would ensure the hooks are only called when necessary (during in-process symbolization, they are not needed for out-of-process) and save specific sanitizers from tracing all places in the code where symbolization will be performed. Reviewers: eugenis, dvyukov Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2067 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193807 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Update comment in sanitizer_symbolizer.hAlexey Samsonov2013-10-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193700 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Use SpinMutex for Symbolizer initialization (per dvyukov's ↵Alexey Samsonov2013-10-30
| | | | | | suggestion) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193697 91177308-0d34-0410-b5e6-96231b3b80d8
* Overhaul the symbolizer interface.Peter Collingbourne2013-10-25
| | | | | | | | | | | | | | | | | | | | | | This moves away from creating the symbolizer object and initializing the external symbolizer as separate steps. Those steps now always take place together. Sanitizers with a legacy requirement to specify their own symbolizer path should use InitSymbolizer to initialize the symbolizer with the desired path, and GetSymbolizer to access the symbolizer. Sanitizers with no such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for initialization. The symbolizer interface has been made thread-safe (as far as I can tell) by protecting its member functions with mutexes. Finally, the symbolizer interface no longer relies on weak externals, the introduction of which was probably a mistake on my part. Differential Revision: http://llvm-reviews.chandlerc.com/D1985 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193448 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r190520 as it wasn't the right fix.Daniel Jasper2013-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190524 91177308-0d34-0410-b5e6-96231b3b80d8
* Add empty virtual destructor...Daniel Jasper2013-09-11
| | | | | | ... as this otherwise triggers -Wnon-virtual-dtor. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190520 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Refactor symbolization interface: use class instead of several ↵Alexey Samsonov2013-09-10
| | | | | | functions. Move some code around to get rid of extra source files git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190410 91177308-0d34-0410-b5e6-96231b3b80d8
* ASan, LSan, MSan: try to find llvm-symbolizer binary in PATH if it is not ↵Alexey Samsonov2013-09-03
| | | | | | provided. Now we don't need to explicitly set the location of llvm-symbolizer in lit test configs. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189801 91177308-0d34-0410-b5e6-96231b3b80d8
* Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov2013-08-13
| | | | | | SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188261 91177308-0d34-0410-b5e6-96231b3b80d8
* Demangle names using pluggable internal symbolizer if possibleAlexey Samsonov2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185146 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] support running external llvm-symbolizer on MacAlexey Samsonov2013-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183730 91177308-0d34-0410-b5e6-96231b3b80d8
* [nolibc] Unweak SymbolizerPrepareForSandboxing and move it to ↵Peter Collingbourne2013-05-29
| | | | | | | | | | libc-independent part. Fixes the Go build. Differential Revision: http://llvm-reviews.chandlerc.com/D877 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182851 91177308-0d34-0410-b5e6-96231b3b80d8
* [nolibc] Make SymbolizerPrepareForSandboxing weak and optional.Peter Collingbourne2013-05-28
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D872 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182765 91177308-0d34-0410-b5e6-96231b3b80d8
* [nolibc] Make AddressInfo::Clear a weak function.Peter Collingbourne2013-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182743 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Introduce SymbolizerPrepareForSandboxing(), which is a no-op on every ↵Alexander Potapenko2013-05-23
| | | | | | | | | platform except Linux (because we don't support sandboxing anywhere else yet) On Linux we pre-cache the value of readlink("/proc/self/exe"), so that it can be later used when the sandbox has been turned on. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182579 91177308-0d34-0410-b5e6-96231b3b80d8
* [nolibc] Move symbolizer to RTSanitizerCommonLibc, and make it optional ↵Peter Collingbourne2013-05-21
| | | | | | using a weak symbol. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182372 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix powerpc build and one test; fix lintKostya Serebryany2013-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181881 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Filtering in GetListOfModules.Sergey Matveev2013-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181791 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: symbolizer "flush caches" functinalityDmitry Vyukov2013-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177388 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: add IsSymbolizerAvailable() function for querying for presence of ↵Dmitry Vyukov2013-01-29
| | | | | | internal/external symbolizer git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173783 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: symbolize global variablesDmitry Vyukov2013-01-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172181 91177308-0d34-0410-b5e6-96231b3b80d8
* Move C++ name demangling support from ubsan into sanitizer_common.Richard Smith2012-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170666 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: describe global vars (module+offset for now)Dmitry Vyukov2012-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169122 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] symbolizer: increase the maximal number of shared libraries to 16KAlexey Samsonov2012-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@166098 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] remove unused fieldAlexey Samsonov2012-09-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163296 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Support for reading inlined frames from llvm-symbolizerAlexey Samsonov2012-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163140 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Switch the symbolization strategy that would be used by ↵Alexey Samsonov2012-08-23
| | | | | | sanitizer tools family: as compiling in-process symbolizer into runtime involves certain difficulties, we may instead launch an external symbolizer program (fork + execl) in a subprocess and communicate with it via pipe. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162437 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Wrapper around llvm::DIContext from LLVM DebugInfo library. If a ↵Alexey Samsonov2012-07-31
| | | | | | macro SANITIZER_USES_LLVM_LIBS is defined (by default it is not), then sanitizer runtime includes llvm headers and tries to use LLVM libs for in-process symbolization. To make it functional, we have to link with these LLVM libs - either pass them to linker from Clang driver, or link them into static ASan runtime when we build it. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161045 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] When obtaining the data for loaded modules, add address ranges ↵Alexey Samsonov2012-07-19
| | | | | | of loadable segments only. Looks like address range of PT_TLS segment may intersect with loadable segments of other modules. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160498 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Add a default constructor for DWARFSection to initialize it with zeros.Alexey Samsonov2012-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159748 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Extend a symbolizer code. Implemented for Linux only. Use ↵Alexey Samsonov2012-07-03
| | | | | | dl_iterate_phdr to get virtual addresses of mapped module sections. To symbolize an address from a module, map this module to memory and obtain pointers to debug info sections. Later these pointers can be passed to constructor of DWARF context-in-memory from LLVM DebugInfo lib. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159652 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Use ProcessMaps in symbolizer to get module name and offset for ↵Alexey Samsonov2012-06-15
| | | | | | instruction address git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158522 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] rename sanitizer_defs.h to sanitizer_internal_defs.hAlexey Samsonov2012-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158001 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer_common] fix filenames in commentsAlexey Samsonov2012-06-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157919 91177308-0d34-0410-b5e6-96231b3b80d8
* Stub files for common symbolizer for AddressSanitizer and ThreadSanitizer tools.Alexey Samsonov2012-06-01
It is an analogue of addr2line utility and should allow to map instruction address to a location in source code at run-time. It should use debug information (in DWARF) in a binary, and hopefully it would be possible to re-use code from llvm/DebugInfo/DIContext.h git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157806 91177308-0d34-0410-b5e6-96231b3b80d8