2018-06-17 09:08:51 +00:00
|
|
|
--- a/libdwfl/argp-std.c
|
|
|
|
+++ b/libdwfl/argp-std.c
|
2017-05-05 23:05:56 +00:00
|
|
|
@@ -56,9 +56,6 @@ static const struct argp_option options[
|
2015-06-14 17:43:40 +00:00
|
|
|
{ "linux-process-map", 'M', "FILE", 0,
|
|
|
|
N_("Find addresses in files mapped as read from FILE"
|
|
|
|
" in Linux /proc/PID/maps format"), 0 },
|
|
|
|
- { "kernel", 'k', NULL, 0, N_("Find addresses in the running kernel"), 0 },
|
|
|
|
- { "offline-kernel", 'K', "RELEASE", OPTION_ARG_OPTIONAL,
|
|
|
|
- N_("Kernel with all modules"), 0 },
|
|
|
|
{ "debuginfo-path", OPT_DEBUGINFO, "PATH", 0,
|
|
|
|
N_("Search path for separate debuginfo files"), 0 },
|
|
|
|
{ NULL, 0, NULL, 0, NULL, 0 }
|
2017-05-05 23:05:56 +00:00
|
|
|
@@ -85,15 +82,6 @@ static const Dwfl_Callbacks proc_callbac
|
2015-06-14 17:43:40 +00:00
|
|
|
.find_elf = INTUSE(dwfl_linux_proc_find_elf),
|
|
|
|
};
|
|
|
|
|
|
|
|
-static const Dwfl_Callbacks kernel_callbacks =
|
|
|
|
- {
|
|
|
|
- .find_debuginfo = INTUSE(dwfl_standard_find_debuginfo),
|
|
|
|
- .debuginfo_path = &debuginfo_path,
|
|
|
|
-
|
|
|
|
- .find_elf = INTUSE(dwfl_linux_kernel_find_elf),
|
|
|
|
- .section_address = INTUSE(dwfl_linux_kernel_module_section_address),
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
/* Structure held at state->HOOK. */
|
|
|
|
struct parse_opt
|
|
|
|
{
|
2018-06-17 09:08:51 +00:00
|
|
|
@@ -226,43 +214,6 @@ parse_opt (int key, char *arg, struct ar
|
2015-06-14 17:43:40 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
- case 'k':
|
|
|
|
- {
|
|
|
|
- struct parse_opt *opt = state->hook;
|
|
|
|
- if (opt->dwfl == NULL)
|
|
|
|
- {
|
|
|
|
- Dwfl *dwfl = INTUSE(dwfl_begin) (&kernel_callbacks);
|
|
|
|
- int result = INTUSE(dwfl_linux_kernel_report_kernel) (dwfl);
|
|
|
|
- if (result != 0)
|
2018-06-17 09:08:51 +00:00
|
|
|
- return fail (dwfl, result, _("cannot load kernel symbols"), state);
|
2015-06-14 17:43:40 +00:00
|
|
|
- result = INTUSE(dwfl_linux_kernel_report_modules) (dwfl);
|
|
|
|
- if (result != 0)
|
|
|
|
- /* Non-fatal to have no modules since we do have the kernel. */
|
2018-06-17 09:08:51 +00:00
|
|
|
- argp_failure (state, 0, result, _("cannot find kernel modules"));
|
2015-06-14 17:43:40 +00:00
|
|
|
- opt->dwfl = dwfl;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- goto toomany;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- case 'K':
|
|
|
|
- {
|
|
|
|
- struct parse_opt *opt = state->hook;
|
|
|
|
- if (opt->dwfl == NULL)
|
|
|
|
- {
|
|
|
|
- Dwfl *dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
|
|
|
|
- int result = INTUSE(dwfl_linux_kernel_report_offline) (dwfl, arg,
|
|
|
|
- NULL);
|
|
|
|
- if (result != 0)
|
2018-06-17 09:08:51 +00:00
|
|
|
- return fail (dwfl, result, _("cannot find kernel or modules"), state);
|
2015-06-14 17:43:40 +00:00
|
|
|
- opt->dwfl = dwfl;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- goto toomany;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
case ARGP_KEY_SUCCESS:
|
|
|
|
{
|
|
|
|
struct parse_opt *opt = state->hook;
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/libdwfl/Makefile.am
|
|
|
|
+++ b/libdwfl/Makefile.am
|
|
|
|
@@ -49,7 +49,7 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
|
|
|
|
argp-std.c find-debuginfo.c \
|
|
|
|
dwfl_build_id_find_elf.c \
|
|
|
|
dwfl_build_id_find_debuginfo.c \
|
|
|
|
- linux-kernel-modules.c linux-proc-maps.c \
|
|
|
|
+ linux-proc-maps.c \
|
|
|
|
dwfl_addrmodule.c dwfl_addrdwarf.c \
|
|
|
|
cu.c dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
|
|
|
|
dwfl_module_addrdie.c dwfl_addrdie.c \
|