proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
StackTrace.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012-present Facebook, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include <cassert>
20
#include <cstddef>
21
#include <cstdint>
22
23
namespace
folly
{
24
namespace
exception_tracer {
25
26
constexpr
size_t
kMaxFrames
= 500;
27
28
struct
StackTrace
{
29
StackTrace
() :
frameCount
(0) {}
30
31
size_t
frameCount
;
32
uintptr_t
addresses
[
kMaxFrames
];
33
};
34
35
// note: no constructor so this can be __thread.
36
// A StackTraceStack MUST be placed in zero-initialized memory.
37
class
StackTraceStack
{
38
class
Node
;
39
40
public
:
46
bool
pushCurrent();
47
52
bool
pop();
53
58
bool
moveTopFrom(
StackTraceStack
& other);
59
64
void
clear();
65
69
bool
empty
()
const
{
70
return
!top_;
71
}
72
76
StackTrace
*
top
();
77
82
StackTrace
*
next
(
StackTrace
* p);
83
84
private
:
85
// In debug mode, we assert that we're in zero-initialized memory by
86
// checking that the two guards around top_ are zero.
87
void
checkGuard
()
const
{
88
#ifndef NDEBUG
89
assert(guard1_ == 0 && guard2_ == 0);
90
#endif
91
}
92
93
#ifndef NDEBUG
94
uintptr_t
guard1_
;
95
#endif
96
Node
*
top_
;
97
#ifndef NDEBUG
98
uintptr_t
guard2_
;
99
#endif
100
};
101
}
// namespace exception_tracer
102
}
// namespace folly
folly::exception_tracer::kMaxFrames
constexpr size_t kMaxFrames
Definition:
StackTrace.h:26
folly::exception_tracer::StackTrace::StackTrace
StackTrace()
Definition:
StackTrace.h:29
folly::exception_tracer::StackTraceStack::checkGuard
void checkGuard() const
Definition:
StackTrace.h:87
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
folly::exception_tracer::StackTrace::addresses
uintptr_t addresses[kMaxFrames]
Definition:
StackTrace.h:32
folly::exception_tracer::StackTraceStack::guard1_
uintptr_t guard1_
Definition:
StackTrace.h:94
folly::exception_tracer::StackTraceStack::empty
bool empty() const
Definition:
StackTrace.h:69
folly::exception_tracer::StackTrace::frameCount
size_t frameCount
Definition:
StackTrace.h:31
folly::pushmi::top
PUSHMI_INLINE_VAR constexpr __adl::get_top_fn top
Definition:
extension_points.h:362
folly::exception_tracer::StackTrace
Definition:
StackTrace.h:28
folly::exception_tracer::StackTraceStack::Node
Definition:
StackTrace.cpp:28
folly::exception_tracer::StackTraceStack::top_
Node * top_
Definition:
StackTrace.h:96
folly::exception_tracer::StackTraceStack::guard2_
uintptr_t guard2_
Definition:
StackTrace.h:98
folly::exception_tracer::StackTraceStack
Definition:
StackTrace.h:37
cpp.ast.next
def next(obj)
Definition:
ast.py:58
proxygen
folly
folly
experimental
exception_tracer
StackTrace.h
Generated by
1.8.11