third_party/abseil-cpp/absl/debugging/internal/examine_stack.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 The Abseil Authors.
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 // https://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 #ifndef ABSL_DEBUGGING_INTERNAL_EXAMINE_STACK_H_
18 #define ABSL_DEBUGGING_INTERNAL_EXAMINE_STACK_H_
19 
20 #include "absl/base/config.h"
21 
22 namespace absl {
24 namespace debugging_internal {
25 
26 // Type of function used for printing in stack trace dumping, etc.
27 // We avoid closures to keep things simple.
28 typedef void OutputWriter(const char*, void*);
29 
30 // RegisterDebugStackTraceHook() allows to register a single routine
31 // `hook` that is called each time DumpStackTrace() is called.
32 // `hook` may be called from a signal handler.
33 typedef void (*SymbolizeUrlEmitter)(void* const stack[], int depth,
34  OutputWriter* writer, void* writer_arg);
35 
36 // Registration of SymbolizeUrlEmitter for use inside of a signal handler.
37 // This is inherently unsafe and must be signal safe code.
40 
41 // Returns the program counter from signal context, or nullptr if
42 // unknown. `vuc` is a ucontext_t*. We use void* to avoid the use of
43 // ucontext_t on non-POSIX systems.
44 void* GetProgramCounter(void* const vuc);
45 
46 // Uses `writer` to dump the program counter, stack trace, and stack
47 // frame sizes.
48 void DumpPCAndFrameSizesAndStackTrace(void* const pc, void* const stack[],
49  int frame_sizes[], int depth,
50  int min_dropped_frames,
51  bool symbolize_stacktrace,
52  OutputWriter* writer, void* writer_arg);
53 
54 // Dump current stack trace omitting the topmost `min_dropped_frames` stack
55 // frames.
56 void DumpStackTrace(int min_dropped_frames, int max_num_frames,
57  bool symbolize_stacktrace, OutputWriter* writer,
58  void* writer_arg);
59 
60 } // namespace debugging_internal
62 } // namespace absl
63 
64 #endif // ABSL_DEBUGGING_INTERNAL_EXAMINE_STACK_H_
absl::debugging_internal::GetDebugStackTraceHook
SymbolizeUrlEmitter GetDebugStackTraceHook()
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc:149
absl::debugging_internal::OutputWriter
void OutputWriter(const char *, void *)
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.h:28
ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_END
Definition: third_party/abseil-cpp/absl/base/config.h:171
absl::debugging_internal::GetProgramCounter
void * GetProgramCounter(void *const vuc)
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc:154
absl::debugging_internal::RegisterDebugStackTraceHook
void RegisterDebugStackTraceHook(SymbolizeUrlEmitter hook)
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc:145
ABSL_NAMESPACE_BEGIN
#define ABSL_NAMESPACE_BEGIN
Definition: third_party/abseil-cpp/absl/base/config.h:170
absl::debugging_internal::SymbolizeUrlEmitter
void(* SymbolizeUrlEmitter)(void *const stack[], int depth, OutputWriter *writer, void *writer_arg)
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.h:33
stack
NodeStack stack
Definition: cord_rep_btree.cc:356
writer
void writer(void *n)
Definition: libuv/docs/code/locks/main.c:22
absl::debugging_internal::DumpStackTrace
ABSL_ATTRIBUTE_NOINLINE void DumpStackTrace(int min_dropped_frames, int max_num_frames, bool symbolize_stacktrace, OutputWriter *writer, void *writer_arg)
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc:274
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
absl::debugging_internal::DumpPCAndFrameSizesAndStackTrace
void DumpPCAndFrameSizesAndStackTrace(void *const pc, void *const stack[], int frame_sizes[], int depth, int min_dropped_frames, bool symbolize_stacktrace, OutputWriter *writer, void *writer_arg)
Definition: third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc:236
mkowners.depth
depth
Definition: mkowners.py:114


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:20