1 //===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
11 //===----------------------------------------------------------------------===//
12 #ifndef TSAN_STACK_TRACE_H
13 #define TSAN_STACK_TRACE_H
15 #include "sanitizer_common/sanitizer_stacktrace.h"
16 #include "tsan_defs.h"
20 // StackTrace which calls malloc/free to allocate the buffer for
21 // addresses in stack traces.
22 struct VarSizeStackTrace
: public StackTrace
{
23 uptr
*trace_buffer
; // Owned.
27 void Init(const uptr
*pcs
, uptr cnt
, uptr extra_top_pc
= 0);
29 // Reverses the current stack trace order, the top frame goes to the bottom,
30 // the last frame goes to the top.
34 void ResizeBuffer(uptr new_size
);
36 VarSizeStackTrace(const VarSizeStackTrace
&);
37 void operator=(const VarSizeStackTrace
&);
42 #endif // TSAN_STACK_TRACE_H