aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-10-10 13:37:58 +0100
committerNick Clifton <nickc@redhat.com>2017-10-10 13:37:58 +0100
commitae7e78255666733d238e676a0bab14986a1483dd (patch)
tree489c740480a9b99d23059ecafc66d18103af0ccd /binutils
parentfc3c534364ca6d6de4f0dbcaf347ec85f5e2f8ff (diff)
downloadgdb-ae7e78255666733d238e676a0bab14986a1483dd.zip
gdb-ae7e78255666733d238e676a0bab14986a1483dd.tar.gz
gdb-ae7e78255666733d238e676a0bab14986a1483dd.tar.bz2
Improve the speed of the --dwarf-start option by skipping processing of any comp unit that ends before the specified start address.
PR 22249 * dwarf.c (process_debug_info): Skip any comp unit that ends before dwarf_start_die.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/dwarf.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index ca4990e..9f2e5f0 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-10 Tom Tromey <tromey@sourceware.org>
+
+ PR 22249
+ * dwarf.c (process_debug_info): Skip any comp unit that ends
+ before dwarf_start_die.
+
2017-10-06 Alan Modra <amodra@gmail.com>
* dwarf.c (process_debug_info): Consolidate header length checks.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 91f95ff..2506d53 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2667,6 +2667,14 @@ process_debug_info (struct dwarf_section *section,
SAFE_BYTE_GET_AND_INC (type_offset, hdrptr, offset_size, end);
}
+ if (dwarf_start_die > (cu_offset + compunit.cu_length
+ + initial_length_size))
+ {
+ start = section_begin + cu_offset + compunit.cu_length
+ + initial_length_size;
+ continue;
+ }
+
if ((do_loc || do_debug_loc || do_debug_ranges)
&& num_debug_info_entries == 0
&& ! do_types)