Even if we cannot create a proper Dwarf dbg we can still print the
information of various debug sections. All all debug print section
functions already check first they can access the appropriate data.

Signed-off-by: Mark Wielaard <[email protected]>
---
 src/ChangeLog | 4 ++++
 src/readelf.c | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 6985b58..e92f115 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
 2015-03-17  Mark Wielaard  <[email protected]>
 
+       * readelf.c (print_debug): Don't return, but always use dummy_dbg.
+
+2015-03-17  Mark Wielaard  <[email protected]>
+
        * readelf.c (print_gdb_index_section): Add overflow checking for
        dataend checks.
 
diff --git a/src/readelf.c b/src/readelf.c
index b717757..7f84eda 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -8188,8 +8188,6 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr 
*ehdr)
       if ((print_debug_sections & ~section_exception) != 0)
        error (0, 0, gettext ("cannot get debug context descriptor: %s"),
               dwfl_errmsg (-1));
-      if ((print_debug_sections & section_exception) == 0)
-       return;
       dbg = &dummy_dbg;
     }
 
-- 
2.1.0

Reply via email to