1 //===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file is a part of ThreadSanitizer (TSan), a race detector. 11 // 12 //===----------------------------------------------------------------------===// 13 #ifndef TSAN_STACK_TRACE_H 14 #define TSAN_STACK_TRACE_H 15 16 #include "sanitizer_common/sanitizer_stacktrace.h" 17 #include "tsan_defs.h" 18 19 namespace __tsan { 20 21 // StackTrace which calls malloc/free to allocate the buffer for 22 // addresses in stack traces. 23 struct VarSizeStackTrace : public StackTrace { 24 uptr *trace_buffer; // Owned. 25 26 VarSizeStackTrace(); 27 ~VarSizeStackTrace(); 28 void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0); 29 30 private: 31 void ResizeBuffer(uptr new_size); 32 33 VarSizeStackTrace(const VarSizeStackTrace &); 34 void operator=(const VarSizeStackTrace &); 35 }; 36 37 } // namespace __tsan 38 39 #endif // TSAN_STACK_TRACE_H 40