From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17351 invoked by alias); 17 Jul 2013 19:47:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17325 invoked by uid 89); 17 Jul 2013 19:47:02 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 17 Jul 2013 19:47:01 +0000 Received: by mail-ie0-f175.google.com with SMTP id a11so5006111iee.20 for ; Wed, 17 Jul 2013 12:46:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=KgzGDdjQ5mU8cs3uH8MwMyucalwbGx1kTMXWi9Vw1nU=; b=UQEFNYYbJdgcQZegbuo0vQ6RhZlTMUTx8qO+sp2GNTohcyKQFQbiqiisB7zRwqDLIE wO1ijCvmstMw73h0wbrwZb/PL2H0EIJYAag4weid4Z7EKUGwp9KM6Pas8zTRo4QV8guw yrWlCnXgEbIYMYrGuzFxdxiad9hyhIV4R7OFobSdTfdR/USAN1BlEgwR85t5FgzbHgbw pHrQ32ggCt8M/1j9XSi/wDgVQNb0fARh/Ro85p3QRsx0HVUj7CgBfMGYPbrLT1BAcdDx X1TNLOMUe/0+2kzDBOmCyznNwYGVAXLvwXHPocv/zEOu/cQmAShI74o5+OzAv6TaWsC0 hLpg== MIME-Version: 1.0 X-Received: by 10.50.129.4 with SMTP id ns4mr10954327igb.4.1374090414276; Wed, 17 Jul 2013 12:46:54 -0700 (PDT) Received: by 10.64.62.67 with HTTP; Wed, 17 Jul 2013 12:46:54 -0700 (PDT) In-Reply-To: <201307171843.r6HIhWEQ006115@glazunov.sibelius.xs4all.nl> References: <1374078455-906-1-git-send-email-nicolas.blanc@intel.com> <1374078455-906-5-git-send-email-nicolas.blanc@intel.com> <201307171843.r6HIhWEQ006115@glazunov.sibelius.xs4all.nl> Date: Wed, 17 Jul 2013 19:47:00 -0000 Message-ID: Subject: Re: [PATCH v12 4/5] Function is_elf_target. From: Doug Evans To: Mark Kettenis Cc: Nicolas Blanc , gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmrj7L/kOlnJeAjc0ExFdP2JxHyisymuqrN3rOMG2pE1wlPSX5SDs3p32B/8DPA7VEXAkADRGw/eNyH8WWcUH51a8JxgWuRSff4+I1iuZV100tATGswJ0/YeOiVhO0xvMnJEJJeWW1YyLhQVsMjevwLYNgfCJb0Nh5AVNi2kOGtVL1VLGa2r3J/4ZPCwZydp5OrPARlBjFkYeVE//nP1kN7zdGNAA== X-SW-Source: 2013-07/txt/msg00426.txt.bz2 On Wed, Jul 17, 2013 at 11:43 AM, Mark Kettenis wrote: >> From: Nicolas Blanc >> Date: Wed, 17 Jul 2013 18:27:34 +0200 >> >> 2013-17-07 Nicolas Blanc >> >> gdb/testsuite >> * lib/gdb.exp (is_elf_target): New function. >> >> Signed-off-by: Nicolas Blanc > > 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.