tor  0.4.3.0-alpha-dev
backtrace.h
Go to the documentation of this file.
1 /* Copyright (c) 2013-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 #ifndef TOR_BACKTRACE_H
5 #define TOR_BACKTRACE_H
6 
13 #include "orconfig.h"
14 #include "lib/cc/compat_compiler.h"
15 #include "lib/cc/torint.h"
16 #include "lib/defs/logging_types.h"
17 
18 typedef void (*tor_log_fn)(int, log_domain_mask_t, const char *fmt, ...)
19  CHECK_PRINTF(3,4);
20 
21 void log_backtrace_impl(int severity, log_domain_mask_t domain,
22  const char *msg,
23  tor_log_fn logger);
24 int configure_backtrace_handler(const char *tor_version);
26 void dump_stack_symbols_to_error_fds(void);
27 const char *get_tor_backtrace_version(void);
28 
29 #define log_backtrace(sev, dom, msg) \
30  log_backtrace_impl((sev), (dom), (msg), tor_log)
31 
32 #ifdef EXPOSE_CLEAN_BACKTRACE
33 #if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \
34  defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION)
35 void clean_backtrace(void **stack, size_t depth, const ucontext_t *ctx);
36 #endif
37 #endif /* defined(EXPOSE_CLEAN_BACKTRACE) */
38 
39 #endif /* !defined(TOR_BACKTRACE_H) */
Integer definitions used throughout Tor.
int configure_backtrace_handler(const char *tor_version)
Definition: backtrace.c:330
void clean_up_backtrace_handler(void)
Definition: backtrace.c:359
const char * get_tor_backtrace_version(void)
Definition: backtrace.c:323
Utility macros to handle different features and behavior in different compilers.
Global definition for types used by logging systems.
uint64_t log_domain_mask_t
Definition: logging_types.h:21