2014-09-23 19:59:53 +02:00
|
|
|
//===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of ThreadSanitizer (TSan), a race detector.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef TSAN_STACK_TRACE_H
|
|
|
|
#define TSAN_STACK_TRACE_H
|
|
|
|
|
2014-11-13 21:41:38 +01:00
|
|
|
#include "sanitizer_common/sanitizer_stacktrace.h"
|
2014-09-23 19:59:53 +02:00
|
|
|
#include "tsan_defs.h"
|
|
|
|
|
|
|
|
namespace __tsan {
|
|
|
|
|
2014-11-13 21:41:38 +01:00
|
|
|
// StackTrace which calls malloc/free to allocate the buffer for
|
|
|
|
// addresses in stack traces.
|
|
|
|
struct VarSizeStackTrace : public StackTrace {
|
|
|
|
uptr *trace_buffer; // Owned.
|
|
|
|
|
|
|
|
VarSizeStackTrace();
|
|
|
|
~VarSizeStackTrace();
|
|
|
|
void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0);
|
2014-09-23 19:59:53 +02:00
|
|
|
|
|
|
|
private:
|
2014-11-13 21:41:38 +01:00
|
|
|
void ResizeBuffer(uptr new_size);
|
2014-09-23 19:59:53 +02:00
|
|
|
|
2014-11-13 21:41:38 +01:00
|
|
|
VarSizeStackTrace(const VarSizeStackTrace &);
|
|
|
|
void operator=(const VarSizeStackTrace &);
|
2014-09-23 19:59:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace __tsan
|
|
|
|
|
|
|
|
#endif // TSAN_STACK_TRACE_H
|