summaryrefslogtreecommitdiffstats
path: root/libdwfl/argp-std.c
diff options
context:
space:
mode:
authorJan Kratochvil <[email protected]>2013-05-30 13:21:20 +0200
committerJan Kratochvil <[email protected]>2013-05-30 13:21:20 +0200
commit8ff862960efb648cdff647d7fad1be5acffe9b11 (patch)
tree436d529a28ceed160be3cbe85bf285b418d6a029 /libdwfl/argp-std.c
parent63d8bfd36e8717e274be5cc3b472b87475f4cc12 (diff)
Use DT_DEBUG library search first.
libdwfl/ 2013-05-30 Jan Kratochvil <[email protected]> * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set executable_for_core before calling dwfl_core_file_report. * core-file.c (clear_r_debug_info): New function. (dwfl_core_file_report): Move raw segments reporting lower. New variable r_debug_info, pass it to dwfl_segment_report_module. Call clear_r_debug_info in the end. Return sum of LISTED and SNIFFED. * dwfl_module_build_id.c (check_notes): Move into __libdwfl_find_elf_build_id. (__libdwfl_find_build_id): Rename to ... (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits, build_id_elfaddr and build_id_len. Verify MOD vs. ELF. (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and set, rename data_vaddr to data_elfaddr. Do not call found_build_id. (__libdwfl_find_elf_build_id): Update the check_notes caller, do not adjust its data_elfaddr parameter. (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id. * dwfl_segment_report_module.c (dwfl_segment_report_module): New parameter r_debug_info. New variable name_is_final. Adjust addresses according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL. Do not overwrite NAME by SONAME if NAME_IS_FINAL. * libdwflP.h (__libdwfl_find_elf_build_id): New declaration. (struct r_debug_info_module, struct r_debug_info): New definitions. (dwfl_segment_report_module, dwfl_link_map_report): Add parameter r_debug_info. * link_map.c: Include fcntl.h. (report_r_debug): Add parameter r_debug_info, describe it in the function comment. Delete dwfl_addrmodule call and its dependent code. Verify build-id before calling dwfl_report_elf, also supply executable_for_core to it. Store r_debug_info->module info when appropriate. (dwfl_link_map_report): Add parameter r_debug_info. New variable in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug caller parameters. tests/ 2013-05-30 Jan Kratochvil <[email protected]> * Makefile.am (EXTRA_DIST): Add test-core-lib.so.bz2, test-core.core.bz2 and test-core.exec.bz2. * run-addrname-test.sh: New test for these files. * run-unstrip-n.sh: Update expected output. New test for these files. * test-core-lib.so.bz2: New file. * test-core.core.bz2: New file. * test-core.exec.bz2: New file. Signed-off-by: Jan Kratochvil <[email protected]>
Diffstat (limited to 'libdwfl/argp-std.c')
-rw-r--r--libdwfl/argp-std.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index e54f720c..c8843909 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -295,6 +295,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
if (opt->core)
{
+ if (opt->e)
+ dwfl->executable_for_core = strdup (opt->e);
+
int fd = open64 (opt->core, O_RDONLY);
if (fd < 0)
{
@@ -330,9 +333,6 @@ parse_opt (int key, char *arg, struct argp_state *state)
_("No modules recognized in core file"));
return ENOENT;
}
-
- if (opt->e)
- dwfl->executable_for_core = strdup (opt->e);
}
else if (opt->e)
{