diff options
author | Kostya Serebryany <kcc@google.com> | 2013-01-10 12:44:08 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@gcc.gnu.org> | 2013-01-10 12:44:08 +0000 |
commit | e9772e16b39885fb70f6e3651a0b98d6de8655c3 (patch) | |
tree | 23cebf7ab15836f70e055aee309f853c0c377de6 /libsanitizer/asan/asan_thread.h | |
parent | e1f674e4c21be4834cfad53666b5b7a9492cf0a5 (diff) | |
download | gcc-e9772e16b39885fb70f6e3651a0b98d6de8655c3.tar.gz |
libsanitizer mege from upstream r171973
From-SVN: r195083
Diffstat (limited to 'libsanitizer/asan/asan_thread.h')
-rw-r--r-- | libsanitizer/asan/asan_thread.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libsanitizer/asan/asan_thread.h b/libsanitizer/asan/asan_thread.h index dff8c88528a..f385ec35fcd 100644 --- a/libsanitizer/asan/asan_thread.h +++ b/libsanitizer/asan/asan_thread.h @@ -37,6 +37,7 @@ class AsanThreadSummary { internal_memcpy(&stack_, stack, sizeof(*stack)); } thread_ = 0; + name_[0] = 0; } u32 tid() { return tid_; } void set_tid(u32 tid) { tid_ = tid; } @@ -47,6 +48,10 @@ class AsanThreadSummary { AsanThread *thread() { return thread_; } void set_thread(AsanThread *thread) { thread_ = thread; } static void TSDDtor(void *tsd); + void set_name(const char *name) { + internal_strncpy(name_, name, sizeof(name_) - 1); + } + const char *name() { return name_; } private: u32 tid_; @@ -54,8 +59,12 @@ class AsanThreadSummary { bool announced_; StackTrace stack_; AsanThread *thread_; + char name_[128]; }; +// AsanThreadSummary objects are never freed, so we need many of them. +COMPILER_CHECK(sizeof(AsanThreadSummary) <= 4094); + // AsanThread are stored in TSD and destroyed when the thread dies. class AsanThread { public: |