tsan_stack_trace.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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
  13. #include "sanitizer_common/sanitizer_stacktrace.h"
  14. #include "tsan_defs.h"
  15. namespace __tsan {
  16. // StackTrace which calls malloc/free to allocate the buffer for
  17. // addresses in stack traces.
  18. struct VarSizeStackTrace : public StackTrace {
  19. uptr *trace_buffer; // Owned.
  20. VarSizeStackTrace();
  21. ~VarSizeStackTrace();
  22. void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0);
  23. private:
  24. void ResizeBuffer(uptr new_size);
  25. VarSizeStackTrace(const VarSizeStackTrace &);
  26. void operator=(const VarSizeStackTrace &);
  27. };
  28. } // namespace __tsan
  29. #endif // TSAN_STACK_TRACE_H