This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [binutils patch] DWARF-5: readelf: .debug_names
- From: Nick Clifton <nickc at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Mon, 12 Jun 2017 10:56:14 +0100
- Subject: Re: [binutils patch] DWARF-5: readelf: .debug_names
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 54538C0587CD
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 54538C0587CD
- References: <20170526181552.GA15442@host1.jankratochvil.net> <8d6d8339-8fbe-9ac1-5e97-84fcbd264215@redhat.com> <20170610071349.GA13161@host1.jankratochvil.net>
Hi Jan,
> thanks for the approval but I cannot check it in yet as it depends on:
> [gcc patch] DWARF-5: Define DW_IDX_GNU_static and DW_IDX_GNU_external
OK.
>>> + printf (_("Version %ld\n"), (long) dwarf_version);
>>> + if (dwarf_version != 5)
>>
>> Shouldn't this test be for >= 5 ?
>
> 0..4: Such .debug_names format has never been defined anywhere.
> 5: The supported version.
> 6..65535: Their format may/will change, I do not think readelf should attempt
> decoding future unknown data format.
>
> It is written similarly as .gdb_index version check is written:
> /* Prior versions are obsolete, and future versions may not be
> backwards compatible. */
> if (version < 3 || version > 8)
> {
> warn (_("Unsupported version %lu.\n"), (unsigned long) version);
> return 0;
> }
Fair enough - but please could you add a comment to this effect so that future
readers of the code do wonder about the version check.
Cheers
Nick