This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v12 4/5] Function is_elf_target.
- From: Doug Evans <dje at google dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: Nicolas Blanc <nicolas dot blanc at intel dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 17 Jul 2013 12:46:54 -0700
- Subject: Re: [PATCH v12 4/5] Function is_elf_target.
- References: <1374078455-906-1-git-send-email-nicolas dot blanc at intel dot com> <1374078455-906-5-git-send-email-nicolas dot blanc at intel dot com> <201307171843 dot r6HIhWEQ006115 at glazunov dot sibelius dot xs4all dot nl>
On Wed, Jul 17, 2013 at 11:43 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> From: Nicolas Blanc <nicolas.blanc@intel.com>
>> Date: Wed, 17 Jul 2013 18:27:34 +0200
>>
>> 2013-17-07 Nicolas Blanc <nicolas.blanc@intel.com>
>>
>> gdb/testsuite
>> * lib/gdb.exp (is_elf_target): New function.
>>
>> Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
>
> That's a very incomplete list.
>
> I think a better solution is needed. Instead of whitelisting targets
> for what is basically the default, blacklisting targets that aren't
> ELF would be a better approach.
There are plenty of places in the testsuite that don't do an
exhaustive check for whether the system is elf.
Instead, they just cover enough cases that we care about.
Consider testsuite/lib/dwarf.exp:dwarf2_support
ortestsuite/lib/gdb.exp:skip_shlib_tests.
[I realize there's also some blacklist-using functions, e.g. skip_cplus_tests.
But for the task at hand, I'm ok with the whitelist since that is what
the testsuite uses today,
except that it replicates this list every time, with some apparent drift.
E.g., gdb.base/dup-sect.exp and gdb.python/py-section-script.exp.]
How about renaming the function to is_known_elf_target?
[Though for consistency's sake one might then want to rename
dwarf_support to known_dwarf_support.
Thus I prefer is_elf_target, but if necessary is_known_elf_target works too.]
One thing one could wish is requiring all places that currently
hardcode this list to be updated to use this function.
grepping for "istarget.*-elf" doesn't have that many hits and the spu
hits can be ignored.