Tor 0.4.9.0-alpha-dev
backtrace.h
Go to the documentation of this file.
1/* Copyright (c) 2013-2021, The Tor Project, Inc. */
2/* See LICENSE for licensing information */
3
4#ifndef TOR_BACKTRACE_H
5#define TOR_BACKTRACE_H
6
7/**
8 * \file backtrace.h
9 *
10 * \brief Header for backtrace.c
11 **/
12
13#include "orconfig.h"
15#include "lib/cc/torint.h"
17
18typedef void (*tor_log_fn)(int, log_domain_mask_t, const char *fmt, ...)
19 CHECK_PRINTF(3,4);
20
21void log_backtrace_impl(int severity, log_domain_mask_t domain,
22 const char *msg,
23 tor_log_fn logger);
24int configure_backtrace_handler(const char *tor_version);
26void dump_stack_symbols_to_error_fds(void);
27const 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 BACKTRACE_PRIVATE
33#if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \
34 defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION)
35void clean_backtrace(void **stack, size_t depth, const ucontext_t *ctx);
36#endif
37#endif /* defined(BACKTRACE_PRIVATE) */
38
39#endif /* !defined(TOR_BACKTRACE_H) */
const char * get_tor_backtrace_version(void)
Definition: backtrace.c:323
int configure_backtrace_handler(const char *tor_version)
Definition: backtrace.c:330
void clean_up_backtrace_handler(void)
Definition: backtrace.c:359
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
Integer definitions used throughout Tor.