Initial implementation of the debuginfo API
[babeltrace.git] / include / babeltrace / debuginfo.h
1 #ifndef _BABELTRACE_DEBUGINFO_H
2 #define _BABELTRACE_DEBUGINFO_H
3
4 /*
5 * Babeltrace - Debug information state tracker
6 *
7 * Copyright (c) 2015 EfficiOS Inc.
8 * Copyright (c) 2015 Philippe Proulx <pproulx@efficios.com>
9 * Copyright (c) 2015 Antoine Busque <abusque@efficios.com>
10 * Copyright (c) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a copy
13 * of this software and associated documentation files (the "Software"), to deal
14 * in the Software without restriction, including without limitation the rights
15 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 * copies of the Software, and to permit persons to whom the Software is
17 * furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included in
20 * all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 * SOFTWARE.
29 */
30
31 struct debug_info;
32 struct ctf_event_definition;
33
34 #ifdef ENABLE_DEBUGINFO
35
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include <stddef.h>
39 #include <babeltrace/babeltrace-internal.h>
40
41 struct debug_info_source {
42 /* Strings are owned by debug_info_source. */
43 char *func;
44 uint64_t line_no;
45 char *filename;
46 };
47
48 BT_HIDDEN
49 struct debug_info *debug_info_create(void);
50
51 BT_HIDDEN
52 void debug_info_destroy(struct debug_info *debug_info);
53
54 BT_HIDDEN
55 void debug_info_handle_event(struct debug_info *debug_info,
56 struct ctf_event_definition *event);
57
58 #else /* ifdef ENABLE_DEBUGINFO */
59
60 static inline
61 struct debug_info *debug_info_create(void) { return malloc(1); }
62
63 static inline
64 void debug_info_destroy(struct debug_info *debug_info) { free(debug_info); }
65
66 static inline
67 void debug_info_handle_event(struct debug_info *debug_info,
68 struct ctf_event_definition *event) { }
69
70 #endif /* ENABLE_DEBUGINFO */
71
72 #endif /* _BABELTRACE_DEBUGINFO_H */
This page took 0.029801 seconds and 4 git commands to generate.