annotate libsanitizer/tsan/tsan_stack_trace.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 //===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===//
kono
parents:
diff changeset
2 //
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
111
kono
parents:
diff changeset
6 //
kono
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
8 //
kono
parents:
diff changeset
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
kono
parents:
diff changeset
10 //
kono
parents:
diff changeset
11 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
12 #ifndef TSAN_STACK_TRACE_H
kono
parents:
diff changeset
13 #define TSAN_STACK_TRACE_H
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 #include "sanitizer_common/sanitizer_stacktrace.h"
kono
parents:
diff changeset
16 #include "tsan_defs.h"
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 namespace __tsan {
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 // StackTrace which calls malloc/free to allocate the buffer for
kono
parents:
diff changeset
21 // addresses in stack traces.
kono
parents:
diff changeset
22 struct VarSizeStackTrace : public StackTrace {
kono
parents:
diff changeset
23 uptr *trace_buffer; // Owned.
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 VarSizeStackTrace();
kono
parents:
diff changeset
26 ~VarSizeStackTrace();
kono
parents:
diff changeset
27 void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0);
kono
parents:
diff changeset
28
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
29 // Reverses the current stack trace order, the top frame goes to the bottom,
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
30 // the last frame goes to the top.
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
31 void ReverseOrder();
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
32
111
kono
parents:
diff changeset
33 private:
kono
parents:
diff changeset
34 void ResizeBuffer(uptr new_size);
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 VarSizeStackTrace(const VarSizeStackTrace &);
kono
parents:
diff changeset
37 void operator=(const VarSizeStackTrace &);
kono
parents:
diff changeset
38 };
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 } // namespace __tsan
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 #endif // TSAN_STACK_TRACE_H