| 1 |
// Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
|
| 4 |
#ifndef DRGN_DEBUG_INFO_OPTIONS_H |
| 5 |
#define DRGN_DEBUG_INFO_OPTIONS_H |
| 6 |
|
| 7 |
#include "drgn_internal.h" |
| 8 |
|
| 9 |
// X macro expanding to all debug info options. |
| 10 |
#define DRGN_DEBUG_INFO_OPTIONS \ |
| 11 |
LIST_OPTION(directories) \ |
| 12 |
BOOL_OPTION(try_module_name, true) \ |
| 13 |
BOOL_OPTION(try_build_id, true) \ |
| 14 |
LIST_OPTION(debug_link_directories) \ |
| 15 |
BOOL_OPTION(try_debug_link, true) \ |
| 16 |
BOOL_OPTION(try_procfs, true) \ |
| 17 |
BOOL_OPTION(try_embedded_vdso, true) \ |
| 18 |
BOOL_OPTION(try_reuse, true) \ |
| 19 |
BOOL_OPTION(try_supplementary, true) \ |
| 20 |
LIST_OPTION(kernel_directories) \ |
| 21 |
ENUM_OPTION(try_kmod, drgn_kmod_search_method, \ |
| 22 |
DRGN_KMOD_SEARCH_DEPMOD_OR_WALK) |
| 23 |
|
| 24 |
struct drgn_debug_info_options { |
| 25 |
#define LIST_OPTION(name) const char * const *name; |
| 26 |
#define BOOL_OPTION(name, default_value) bool name; |
| 27 |
#define ENUM_OPTION(name, type, default_value) enum type name; |
| 28 |
DRGN_DEBUG_INFO_OPTIONS |
| 29 |
#undef ENUM_OPTION |
| 30 |
#undef BOOL_OPTION |
| 31 |
#undef LIST_OPTION |
| 32 |
}; |
| 33 |
|
| 34 |
void drgn_debug_info_options_init(struct drgn_debug_info_options *options); |
| 35 |
void drgn_debug_info_options_deinit(struct drgn_debug_info_options *options); |
| 36 |
|
| 37 |
char *drgn_format_debug_info_options(struct drgn_debug_info_options *options); |
| 38 |
|
| 39 |
#endif /* DRGN_DEBUG_INFO_OPTIONS_H */ |