+2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * NEWS (Version 0.158): New.
+
2013-09-30 Mark Wielaard <mjw@redhat.com>
* NEWS: Update for readelf NT_SIGINFO and NT_FILE core notes.
+Version 0.158
+
+libdwfl: dwfl_core_file_report has new parameter executable.
+
Version 0.157
libdw: Add new functions dwarf_getlocations, dwarf_getlocation_attr
+2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * libdw.map (ELFUTILS_0.158): New.
+
2013-10-10 Mark Wielaard <mjw@redhat.com>
* dwarf_getfuncs.c (struct visitor_info): Rename start_offset to
dwarf_getlocation_die;
dwarf_getlocation_attr;
} ELFUTILS_0.156;
+
+ELFUTILS_0.158 {
+ global:
+ # Replaced ELFUTILS_0.146 version, which has a wrapper without executable.
+ dwfl_core_file_report;
+} ELFUTILS_0.157;
+2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * argp-std.c (parse_opt): Use executable parameter of
+ dwfl_core_file_report.
+ * core-file.c (dwfl_core_file_report): Add parameter executable. Set
+ it to DWFL. Add NEW_VERSION for it.
+ (_compat_without_executable_dwfl_core_file_report): New. Twice.
+ * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
+ the function comment.
+
2013-10-15 Mark Wielaard <mjw@redhat.com>
* linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
if (opt->core)
{
- if (opt->e)
- dwfl->executable_for_core = strdup (opt->e);
-
int fd = open64 (opt->core, O_RDONLY);
if (fd < 0)
{
return error == DWFL_E_ERRNO ? errno : EIO;
}
- int result = INTUSE(dwfl_core_file_report) (dwfl, core);
+ int result = INTUSE(dwfl_core_file_report) (dwfl, core, opt->e);
if (result < 0)
{
elf_end (core);
}
int
-dwfl_core_file_report (Dwfl *dwfl, Elf *elf)
+dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const char *executable)
{
size_t phnum;
if (unlikely (elf_getphdrnum (elf, &phnum) != 0))
return -1;
}
+ free (dwfl->executable_for_core);
+ if (executable == NULL)
+ dwfl->executable_for_core = NULL;
+ else
+ {
+ dwfl->executable_for_core = strdup (executable);
+ if (dwfl->executable_for_core == NULL)
+ {
+ __libdwfl_seterrno (DWFL_E_NOMEM);
+ return -1;
+ }
+ }
+
/* First report each PT_LOAD segment. */
GElf_Phdr notes_phdr;
int ndx = dwfl_report_core_segments (dwfl, elf, phnum, ¬es_phdr);
return sniffed || listed >= 0 ? listed + sniffed : listed;
}
INTDEF (dwfl_core_file_report)
+NEW_VERSION (dwfl_core_file_report, ELFUTILS_0.158)
+
+#ifdef SHARED
+int _compat_without_executable_dwfl_core_file_report (Dwfl *dwfl, Elf *elf);
+COMPAT_VERSION_NEWPROTO (dwfl_core_file_report, ELFUTILS_0.146,
+ without_executable)
+
+int
+_compat_without_executable_dwfl_core_file_report (Dwfl *dwfl, Elf *elf)
+{
+ return dwfl_core_file_report (dwfl, elf, NULL);
+}
+#endif
This can follow a dwfl_report_offline call to bootstrap the
DT_DEBUG method of following the dynamic linker link_map chain, in
case the core file does not contain enough of the executable's text
- segment to locate its PT_DYNAMIC in the dump. This might call
- dwfl_report_elf on file names found in the dump if reading some
- link_map files is the only way to ascertain those modules' addresses.
+ segment to locate its PT_DYNAMIC in the dump. In such case you need to
+ supply non-NULL EXECUTABLE, otherwise dynamic libraries will not be loaded
+ into the DWFL map. This might call dwfl_report_elf on file names found in
+ the dump if reading some link_map files is the only way to ascertain those
+ modules' addresses.
Returns the number of modules reported, or -1 for errors. */
-extern int dwfl_core_file_report (Dwfl *dwfl, Elf *elf);
+extern int dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const char *executable);
/* Call dwfl_report_module for each file mapped into the address space of PID.
Returns zero on success, -1 if dwfl_report_module failed,