Home | History | Annotate | Line # | Download | only in rtl
      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   // Reverses the current stack trace order, the top frame goes to the bottom,
     31   // the last frame goes to the top.
     32   void ReverseOrder();
     33 
     34  private:
     35   void ResizeBuffer(uptr new_size);
     36 
     37   VarSizeStackTrace(const VarSizeStackTrace &);
     38   void operator=(const VarSizeStackTrace &);
     39 };
     40 
     41 }  // namespace __tsan
     42 
     43 #endif  // TSAN_STACK_TRACE_H
     44