+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (print_debug): Record and reset section_info status in
+ implicit_debug_sections and print_debug_sections.
+
2018-05-28 Mark Wielaard <mark@klomp.org>
* readelf.c (print_debug_units): Turn "Could not find split compile
we must make sure to handle it before handling any other debug
section. Various other sections depend on the CU DIEs being
scanned (silently) first. */
- if ((implicit_debug_sections & section_info) != 0)
+ bool implicit_info = (implicit_debug_sections & section_info) != 0;
+ bool explicit_info = (print_debug_sections & section_info) != 0;
+ if (implicit_info)
{
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
dwfl_end (skel_dwfl);
free (skel_name);
+ /* Turn implicit and/or explicit back on in case we go over another file. */
+ if (implicit_info)
+ implicit_debug_sections |= section_info;
+ if (explicit_info)
+ print_debug_sections |= section_info;
+
reset_listptr (&known_locsptr);
reset_listptr (&known_loclistsptr);
reset_listptr (&known_rangelistptr);
+2018-05-29 Mark Wielaard <mark@klomp.org>
+
+ * run-readelf-twofiles.sh: Add --debug-dump=loc testcase.
+
2018-05-28 Mark Wielaard <mark@klomp.org>
* run-readelf-info-plus.sh: New test.
#! /bin/sh
-# Copyright (C) 2011 Red Hat, Inc.
+# Copyright (C) 2011, 2018 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
testrun >/dev/null ${abs_top_builddir}/src/readelf -w testfile14 testfile14
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc testfile14 testfile14 << EOF
+
+testfile14:
+
+
+DWARF section [33] '.debug_loc' at offset 0xca9:
+
+ CU [ b] base: 0x0000000000400468 <caller>
+ [ 0] range 34, 35
+ 0x000000000040049c <main>..
+ 0x000000000040049c <main>
+ [ 0] breg7 -8
+ range 35, 46
+ 0x000000000040049d <main+0x1>..
+ 0x00000000004004ad <main+0x11>
+ [ 0] breg7 0
+ range 46, 47
+ 0x00000000004004ae <main+0x12>..
+ 0x00000000004004ae <main+0x12>
+ [ 0] breg7 -8
+
+testfile14:
+
+
+DWARF section [33] '.debug_loc' at offset 0xca9:
+
+ CU [ b] base: 0x0000000000400468 <caller>
+ [ 0] range 34, 35
+ 0x000000000040049c <main>..
+ 0x000000000040049c <main>
+ [ 0] breg7 -8
+ range 35, 46
+ 0x000000000040049d <main+0x1>..
+ 0x00000000004004ad <main+0x11>
+ [ 0] breg7 0
+ range 46, 47
+ 0x00000000004004ae <main+0x12>..
+ 0x00000000004004ae <main+0x12>
+ [ 0] breg7 -8
+EOF
+
exit 0