This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [dwarf2read] Fix crash when loading dwp files: calculate num_sections based on actual section indices, not just the number of sections.
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: Jordan Rupprecht <rupprecht at google dot com>, gdb-patches at sourceware dot org, Eric Christopher <echristo at gmail dot com>, David Blaikie <dblaikie at gmail dot com>, dje at google dot com
- Date: Tue, 26 Feb 2019 08:08:47 -0700
- Subject: Re: [PATCH] [dwarf2read] Fix crash when loading dwp files: calculate num_sections based on actual section indices, not just the number of sections.
- References: <439bf4f6859a539472a2e51a028b9503@polymtl.ca> <20190225201715.144927-1-rupprecht@google.com> <CABC7LbQ27C=fDcj=btTFkDY1q2GVNz9R9Qp0XRhweAnnc2--2A@mail.gmail.com> <1b6df15638153631ea87fa1bc7c24dd2@polymtl.ca>
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
>> - dwp_file->num_sections = bfd_count_sections (dwp_file->dbfd) + 1;
>> + dwp_file->num_sections = elf_numsections (dwp_file->dbfd);
Simon> I have tweaked the original commit message a bit and pushed.
Simon> Thanks again for the patch.
I wonder if there's any way to reach this with a non-ELF objfile --
Mach-O seems probable. I think we also handle DWARF on AIX (ECOFF IIRC)
but I don't know if that does dwp.
Tom