* Add missing ChangeLog entry.
[official-gcc.git] / libsanitizer / tsan / tsan_stack_trace.h
blobce0cb8859d2a61d639fd4ec13a22bdb64cb40c4b
1 //===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is a part of ThreadSanitizer (TSan), a race detector.
9 //
10 //===----------------------------------------------------------------------===//
11 #ifndef TSAN_STACK_TRACE_H
12 #define TSAN_STACK_TRACE_H
14 //#include "sanitizer_common/sanitizer_atomic.h"
15 //#include "sanitizer_common/sanitizer_common.h"
16 //#include "sanitizer_common/sanitizer_deadlock_detector_interface.h"
17 #include "tsan_defs.h"
18 //#include "tsan_clock.h"
19 //#include "tsan_mutex.h"
20 //#include "tsan_dense_alloc.h"
22 namespace __tsan {
24 class StackTrace {
25 public:
26 StackTrace();
27 // Initialized the object in "static mode",
28 // in this mode it never calls malloc/free but uses the provided buffer.
29 StackTrace(uptr *buf, uptr cnt);
30 ~StackTrace();
31 void Reset();
33 void Init(const uptr *pcs, uptr cnt);
34 void ObtainCurrent(ThreadState *thr, uptr toppc);
35 bool IsEmpty() const;
36 uptr Size() const;
37 uptr Get(uptr i) const;
38 const uptr *Begin() const;
39 void CopyFrom(const StackTrace& other);
41 private:
42 uptr n_;
43 uptr *s_;
44 const uptr c_;
46 StackTrace(const StackTrace&);
47 void operator = (const StackTrace&);
50 } // namespace __tsan
52 #endif // TSAN_STACK_TRACE_H