This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v12 4/5] Function is_elf_target.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]