mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
Introduce a legacy copy of GetDebugStackTraceHook API.
PiperOrigin-RevId: 852842182 Change-Id: Iadec9bb2fec60b9962a557f82ac998f3cf8d56fe
This commit is contained in:
committed by
Copybara-Service
parent
6bd8e2b51a
commit
bbb342c6de
@@ -149,6 +149,10 @@ void RegisterDebugStackTraceHook(SymbolizeUrlEmitter hook) {
|
||||
debug_stack_trace_hook = hook;
|
||||
}
|
||||
|
||||
SymbolizeUrlEmitterLegacy GetDebugStackTraceHookLegacy() {
|
||||
return debug_stack_trace_hook;
|
||||
}
|
||||
|
||||
SymbolizeUrlEmitter GetDebugStackTraceHook() { return debug_stack_trace_hook; }
|
||||
|
||||
// Returns the program counter from signal context, nullptr if
|
||||
|
||||
@@ -32,12 +32,19 @@ typedef void OutputWriter(const char*, void*);
|
||||
// `hook` may be called from a signal handler.
|
||||
typedef void (*SymbolizeUrlEmitter)(void* const stack[], int depth,
|
||||
OutputWriter* writer, void* writer_arg);
|
||||
typedef void (*SymbolizeUrlEmitterLegacy)(void* const stack[], int depth,
|
||||
OutputWriter* writer,
|
||||
void* writer_arg);
|
||||
|
||||
// Registration of SymbolizeUrlEmitter for use inside of a signal handler.
|
||||
// This is inherently unsafe and must be signal safe code.
|
||||
void RegisterDebugStackTraceHook(SymbolizeUrlEmitter hook);
|
||||
SymbolizeUrlEmitter GetDebugStackTraceHook();
|
||||
|
||||
// Currently exact copy of above. Needed for the 3-CL dance due to
|
||||
// TCMallocDebugStackTraceHook dependency on this API.
|
||||
SymbolizeUrlEmitterLegacy GetDebugStackTraceHookLegacy();
|
||||
|
||||
// Returns the program counter from signal context, or nullptr if
|
||||
// unknown. `vuc` is a ucontext_t*. We use void* to avoid the use of
|
||||
// ucontext_t on non-POSIX systems.
|
||||
|
||||
Reference in New Issue
Block a user