Export dwfl_core_file_report.
authorRoland McGrath <roland@redhat.com>
Thu, 11 Mar 2010 07:49:13 +0000 (23:49 -0800)
committerRoland McGrath <roland@redhat.com>
Thu, 11 Mar 2010 08:00:20 +0000 (00:00 -0800)
NEWS
libdw/ChangeLog
libdw/libdw.map
libdwfl/ChangeLog
libdwfl/argp-std.c
libdwfl/core-file.c
libdwfl/libdwfl.h
libdwfl/libdwflP.h

diff --git a/NEWS b/NEWS
index a59406f..95f72a3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 Version 0.146:
 
+libdwfl: New function dwfl_core_file_report.
+
 Version 0.145:
 
 Fix build with --disable-dependency-tracking.
index c21b912..b23cd23 100644 (file)
@@ -1,3 +1,7 @@
+2010-03-10  Roland McGrath  <roland@redhat.com>
+
+       * libdw.map (ELFUTILS_0.146): New set.  Add dwfl_core_file_report.
+
 2010-02-15  Roland McGrath  <roland@redhat.com>
 
        * Makefile.am: Use config/eu.am for common stuff.
index 8eaeacd..1a9afb1 100644 (file)
@@ -232,3 +232,8 @@ ELFUTILS_0.144 {
   global:
     dwarf_aggregate_size;
 } ELFUTILS_0.143;
+
+ELFUTILS_0.146 {
+  global:
+    dwfl_core_file_report;
+} ELFUTILS_0.144;
index 7df643e..86cc693 100644 (file)
@@ -1,3 +1,10 @@
+2010-03-10  Roland McGrath  <roland@redhat.com>
+
+       * core-file.c (dwfl_core_file_report): Punt EHDR argument.
+       * argp-std.c (parse_opt): Update caller.
+       * libdwfl.h: Declare dwfl_core_file_report.
+       * libdwflP.h: Don't.
+
 2010-02-17  Roland McGrath  <roland@redhat.com>
 
        * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
index ce2e20a..e598c6e 100644 (file)
@@ -1,5 +1,5 @@
 /* Standard argp argument parsers for tools using libdwfl.
-   Copyright (C) 2005, 2007, 2008, 2009 Red Hat, Inc.
+   Copyright (C) 2005-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -225,9 +225,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
            return error == DWFL_E_ERRNO ? errno : EIO;
          }
 
-       GElf_Ehdr ehdr;
-       int result = INTUSE(dwfl_core_file_report) (dwfl, core,
-                                                   gelf_getehdr (core, &ehdr));
+       int result = INTUSE(dwfl_core_file_report) (dwfl, core);
        if (result < 0)
          {
            elf_end (core);
index 1872d8a..2f0ca8a 100644 (file)
@@ -403,18 +403,17 @@ dwfl_elf_phdr_memory_callback (Dwfl *dwfl, int ndx,
 }
 
 int
-dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const GElf_Ehdr *ehdr)
+dwfl_core_file_report (Dwfl *dwfl, Elf *elf)
 {
-  GElf_Phdr notes_phdr;
-
   size_t phnum;
-  if (unlikely (ehdr == NULL) || unlikely (elf_getphdrnum (elf, &phnum) != 0))
+  if (unlikely (elf_getphdrnum (elf, &phnum) != 0))
     {
-      __libdw_seterrno (DWFL_E_LIBELF);
+      __libdwfl_seterrno (DWFL_E_LIBELF);
       return -1;
     }
 
   /* First report each PT_LOAD segment.  */
+  GElf_Phdr notes_phdr;
   int ndx = dwfl_report_core_segments (dwfl, elf, phnum, &notes_phdr);
   if (unlikely (ndx <= 0))
     return ndx;
index fafc75e..51e9818 100644 (file)
@@ -1,5 +1,5 @@
 /* Interfaces for libdwfl.
-   Copyright (C) 2005-2009 Red Hat, Inc.
+   Copyright (C) 2005-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -359,6 +359,15 @@ extern int dwfl_linux_kernel_report_offline (Dwfl *dwfl, const char *release,
                                             int (*predicate) (const char *,
                                                               const char *));
 
+/* Examine an ET_CORE file and report modules based on its contents.
+   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.
+   Returns the number of modules reported, or -1 for errors.  */
+extern int dwfl_core_file_report (Dwfl *dwfl, Elf *elf);
 
 /* Call dwfl_report_module for each file mapped into the address space of PID.
    Returns zero on success, -1 if dwfl_report_module failed,
index d08d8a7..58edacb 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal definitions for libdwfl.
-   Copyright (C) 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
+   Copyright (C) 2005-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -400,10 +400,6 @@ extern int dwfl_link_map_report (Dwfl *dwfl, const void *auxv, size_t auxv_size,
                                 Dwfl_Memory_Callback *memory_callback,
                                 void *memory_callback_arg);
 
-/* Examine an ET_CORE file and report modules based on its contents.  */
-extern int dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const GElf_Ehdr *ehdr);
-
-
 
 /* Avoid PLT entries.  */
 INTDECL (dwfl_begin)