-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlibbacktrace_wrapper.h
50 lines (40 loc) · 1.25 KB
/
libbacktrace_wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) 2019-2024 Status Research & Development GmbH
* Licensed under either of
* * Apache License, version 2.0,
* * MIT license
* at your option.
* This file may not be copied, modified, or distributed except according to
* those terms.
*/
#ifndef LIBBACKTRACE_WRAPPER_H
#define LIBBACKTRACE_WRAPPER_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// The returned string needs to be freed by the caller.
char *get_backtrace_max_length_c(int max_length, int skip) __attribute__((noinline));
// The returned string needs to be freed by the caller.
char *get_backtrace_c(void) __attribute__((noinline));
/*
* The returned array needs to be freed by the caller.
*/
uintptr_t *get_program_counters_c(
int max_program_counters, int *num_program_counters, int skip) __attribute__((noinline));
struct debugging_info {
char *filename;
int lineno;
char *function;
};
/*
* The returned array needs to be freed by the caller.
* Char pointers in the returned structs need to be freed by the caller.
*/
struct debugging_info *get_debugging_info_c(
const uintptr_t *program_counters, int num_program_counters,
int max_debugging_infos, int *num_debugging_infos);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // LIBBACKTRACE_WRAPPER_H