diff options
Diffstat (limited to 'compiler-rt/lib/lsan')
-rw-r--r-- | compiler-rt/lib/lsan/lsan_common.cpp | 20 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_common.h | 8 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_interceptors.cpp | 4 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_posix.cpp | 4 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_posix.h | 2 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_thread.cpp | 8 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_thread.h | 2 |
7 files changed, 24 insertions, 24 deletions
diff --git a/compiler-rt/lib/lsan/lsan_common.cpp b/compiler-rt/lib/lsan/lsan_common.cpp index b17a17e..d9afa45 100644 --- a/compiler-rt/lib/lsan/lsan_common.cpp +++ b/compiler-rt/lib/lsan/lsan_common.cpp @@ -412,7 +412,7 @@ void ScanExtraStackRanges(const InternalMmapVector<Range> &ranges, # if SANITIZER_FUCHSIA // Fuchsia handles all threads together with its own callback. -static void ProcessThreads(SuspendedThreadsList const &, Frontier *, tid_t, +static void ProcessThreads(SuspendedThreadsList const &, Frontier *, ThreadID, uptr) {} # else @@ -445,7 +445,7 @@ static void ProcessThreadRegistry(Frontier *frontier) { // Scans thread data (stacks and TLS) for heap pointers. template <class Accessor> -static void ProcessThread(tid_t os_id, uptr sp, +static void ProcessThread(ThreadID os_id, uptr sp, const InternalMmapVector<uptr> ®isters, InternalMmapVector<Range> &extra_ranges, Frontier *frontier, Accessor &accessor) { @@ -556,16 +556,16 @@ static void ProcessThread(tid_t os_id, uptr sp, } static void ProcessThreads(SuspendedThreadsList const &suspended_threads, - Frontier *frontier, tid_t caller_tid, + Frontier *frontier, ThreadID caller_tid, uptr caller_sp) { - InternalMmapVector<tid_t> done_threads; + InternalMmapVector<ThreadID> done_threads; InternalMmapVector<uptr> registers; InternalMmapVector<Range> extra_ranges; for (uptr i = 0; i < suspended_threads.ThreadCount(); i++) { registers.clear(); extra_ranges.clear(); - const tid_t os_id = suspended_threads.GetThreadID(i); + const ThreadID os_id = suspended_threads.GetThreadID(i); uptr sp = 0; PtraceRegistersStatus have_registers = suspended_threads.GetRegistersAndSP(i, ®isters, &sp); @@ -589,10 +589,10 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads, if (flags()->use_detached) { CopyMemoryAccessor accessor; - InternalMmapVector<tid_t> known_threads; + InternalMmapVector<ThreadID> known_threads; GetRunningThreadsLocked(&known_threads); Sort(done_threads.data(), done_threads.size()); - for (tid_t os_id : known_threads) { + for (ThreadID os_id : known_threads) { registers.clear(); extra_ranges.clear(); @@ -712,7 +712,7 @@ static void CollectIgnoredCb(uptr chunk, void *arg) { // Sets the appropriate tag on each chunk. static void ClassifyAllChunks(SuspendedThreadsList const &suspended_threads, - Frontier *frontier, tid_t caller_tid, + Frontier *frontier, ThreadID caller_tid, uptr caller_sp) { const InternalMmapVector<u32> &suppressed_stacks = GetSuppressionContext()->GetSortedSuppressedStacks(); @@ -790,13 +790,13 @@ static bool ReportUnsuspendedThreads(const SuspendedThreadsList &) { static bool ReportUnsuspendedThreads( const SuspendedThreadsList &suspended_threads) { - InternalMmapVector<tid_t> threads(suspended_threads.ThreadCount()); + InternalMmapVector<ThreadID> threads(suspended_threads.ThreadCount()); for (uptr i = 0; i < suspended_threads.ThreadCount(); ++i) threads[i] = suspended_threads.GetThreadID(i); Sort(threads.data(), threads.size()); - InternalMmapVector<tid_t> known_threads; + InternalMmapVector<ThreadID> known_threads; GetRunningThreadsLocked(&known_threads); bool succeded = true; diff --git a/compiler-rt/lib/lsan/lsan_common.h b/compiler-rt/lib/lsan/lsan_common.h index f990c78..39530c2 100644 --- a/compiler-rt/lib/lsan/lsan_common.h +++ b/compiler-rt/lib/lsan/lsan_common.h @@ -102,15 +102,15 @@ void UnlockThreads() SANITIZER_NO_THREAD_SAFETY_ANALYSIS; // where leak checking is initiated from a non-main thread). void EnsureMainThreadIDIsCorrect(); -bool GetThreadRangesLocked(tid_t os_id, uptr *stack_begin, uptr *stack_end, +bool GetThreadRangesLocked(ThreadID os_id, uptr *stack_begin, uptr *stack_end, uptr *tls_begin, uptr *tls_end, uptr *cache_begin, uptr *cache_end, DTLS **dtls); void GetAllThreadAllocatorCachesLocked(InternalMmapVector<uptr> *caches); void GetThreadExtraStackRangesLocked(InternalMmapVector<Range> *ranges); -void GetThreadExtraStackRangesLocked(tid_t os_id, +void GetThreadExtraStackRangesLocked(ThreadID os_id, InternalMmapVector<Range> *ranges); void GetAdditionalThreadContextPtrsLocked(InternalMmapVector<uptr> *ptrs); -void GetRunningThreadsLocked(InternalMmapVector<tid_t> *threads); +void GetRunningThreadsLocked(InternalMmapVector<ThreadID> *threads); void PrintThreads(); //// -------------------------------------------------------------------------- @@ -247,7 +247,7 @@ void ProcessPlatformSpecificAllocations(Frontier *frontier); struct CheckForLeaksParam { Frontier frontier; LeakedChunks leaks; - tid_t caller_tid; + ThreadID caller_tid; uptr caller_sp; bool success = false; }; diff --git a/compiler-rt/lib/lsan/lsan_interceptors.cpp b/compiler-rt/lib/lsan/lsan_interceptors.cpp index f9f83f6..5340c6f 100644 --- a/compiler-rt/lib/lsan/lsan_interceptors.cpp +++ b/compiler-rt/lib/lsan/lsan_interceptors.cpp @@ -385,12 +385,12 @@ INTERCEPTOR(void, _lwp_exit) { #endif #if SANITIZER_INTERCEPT_THR_EXIT -INTERCEPTOR(void, thr_exit, tid_t *state) { +INTERCEPTOR(void, thr_exit, ThreadID *state) { ENSURE_LSAN_INITED; ThreadFinish(); REAL(thr_exit)(state); } -#define LSAN_MAYBE_INTERCEPT_THR_EXIT INTERCEPT_FUNCTION(thr_exit) +# define LSAN_MAYBE_INTERCEPT_THR_EXIT INTERCEPT_FUNCTION(thr_exit) #else #define LSAN_MAYBE_INTERCEPT_THR_EXIT #endif diff --git a/compiler-rt/lib/lsan/lsan_posix.cpp b/compiler-rt/lib/lsan/lsan_posix.cpp index 593000b..ae1590b 100644 --- a/compiler-rt/lib/lsan/lsan_posix.cpp +++ b/compiler-rt/lib/lsan/lsan_posix.cpp @@ -48,7 +48,7 @@ void ThreadContext::OnStarted(void *arg) { dtls_ = args->dtls; } -void ThreadStart(u32 tid, tid_t os_id, ThreadType thread_type) { +void ThreadStart(u32 tid, ThreadID os_id, ThreadType thread_type) { OnStartedArgs args; GetThreadStackAndTls(tid == kMainTid, &args.stack_begin, &args.stack_end, &args.tls_begin, &args.tls_end); @@ -57,7 +57,7 @@ void ThreadStart(u32 tid, tid_t os_id, ThreadType thread_type) { ThreadContextLsanBase::ThreadStart(tid, os_id, thread_type, &args); } -bool GetThreadRangesLocked(tid_t os_id, uptr *stack_begin, uptr *stack_end, +bool GetThreadRangesLocked(ThreadID os_id, uptr *stack_begin, uptr *stack_end, uptr *tls_begin, uptr *tls_end, uptr *cache_begin, uptr *cache_end, DTLS **dtls) { ThreadContext *context = static_cast<ThreadContext *>( diff --git a/compiler-rt/lib/lsan/lsan_posix.h b/compiler-rt/lib/lsan/lsan_posix.h index b1265f2..7587a07c 100644 --- a/compiler-rt/lib/lsan/lsan_posix.h +++ b/compiler-rt/lib/lsan/lsan_posix.h @@ -41,7 +41,7 @@ class ThreadContext final : public ThreadContextLsanBase { DTLS *dtls_ = nullptr; }; -void ThreadStart(u32 tid, tid_t os_id, +void ThreadStart(u32 tid, ThreadID os_id, ThreadType thread_type = ThreadType::Regular); } // namespace __lsan diff --git a/compiler-rt/lib/lsan/lsan_thread.cpp b/compiler-rt/lib/lsan/lsan_thread.cpp index b66ea61..22eb9ee 100644 --- a/compiler-rt/lib/lsan/lsan_thread.cpp +++ b/compiler-rt/lib/lsan/lsan_thread.cpp @@ -66,7 +66,7 @@ u32 ThreadCreate(u32 parent_tid, bool detached, void *arg) { return thread_registry->CreateThread(0, detached, parent_tid, arg); } -void ThreadContextLsanBase::ThreadStart(u32 tid, tid_t os_id, +void ThreadContextLsanBase::ThreadStart(u32 tid, ThreadID os_id, ThreadType thread_type, void *arg) { thread_registry->StartThread(tid, os_id, thread_type, arg); } @@ -80,7 +80,7 @@ void EnsureMainThreadIDIsCorrect() { ///// Interface to the common LSan module. ///// -void GetThreadExtraStackRangesLocked(tid_t os_id, +void GetThreadExtraStackRangesLocked(ThreadID os_id, InternalMmapVector<Range> *ranges) {} void GetThreadExtraStackRangesLocked(InternalMmapVector<Range> *ranges) {} @@ -99,11 +99,11 @@ ThreadRegistry *GetLsanThreadRegistryLocked() { return thread_registry; } -void GetRunningThreadsLocked(InternalMmapVector<tid_t> *threads) { +void GetRunningThreadsLocked(InternalMmapVector<ThreadID> *threads) { GetLsanThreadRegistryLocked()->RunCallbackForEachThreadLocked( [](ThreadContextBase *tctx, void *threads) { if (tctx->status == ThreadStatusRunning) { - reinterpret_cast<InternalMmapVector<tid_t> *>(threads)->push_back( + reinterpret_cast<InternalMmapVector<ThreadID> *>(threads)->push_back( tctx->os_id); } }, diff --git a/compiler-rt/lib/lsan/lsan_thread.h b/compiler-rt/lib/lsan/lsan_thread.h index 222066e..b7262a9e 100644 --- a/compiler-rt/lib/lsan/lsan_thread.h +++ b/compiler-rt/lib/lsan/lsan_thread.h @@ -30,7 +30,7 @@ class ThreadContextLsanBase : public ThreadContextBase { uptr cache_end() { return cache_end_; } // The argument is passed on to the subclass's OnStarted member function. - static void ThreadStart(u32 tid, tid_t os_id, ThreadType thread_type, + static void ThreadStart(u32 tid, ThreadID os_id, ThreadType thread_type, void *onstarted_arg); protected: |