From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107981 invoked by alias); 19 Aug 2015 20:43:03 -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 107966 invoked by uid 89); 19 Aug 2015 20:43:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f181.google.com Received: from mail-io0-f181.google.com (HELO mail-io0-f181.google.com) (209.85.223.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 19 Aug 2015 20:43:01 +0000 Received: by iods203 with SMTP id s203so23525390iod.0 for ; Wed, 19 Aug 2015 13:42:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=AoI2IkVuEaJeTFxO/6q2Jjsiq2TQDMIsYe31rzbtxnk=; b=cVjKonvRadAGHxFXs7PCgPpEPlBahrcGJX4v6sX5vwcNz/vItEEiCCATpWv091oqOB WSXA7I41yQYGCZ0gS4mM/7tEWby5vFwn+m6xFRR4IYEv/fTA2ZXzyyA40dVIh+cCP8re bJnbNvsnYE02o6lG5zNsfzfFlr903PcDrhIpBJTzDzkO2MyP0Or0Rbm28wWcAPICFXb+ 7UsEeZJSroekASd6oKen31rISLduSU9pjATv1yF3NKGBZ+nY7OC5La8rVl7aTpt2huzx yQsZ6om9QLeVYKHx3N3/lOWbRgn0qeAmNjMU6QeRHnAl52NyBs1BZAUeEBj22iVwXOOA XiDw== X-Gm-Message-State: ALoCoQmLxA1s/W6iE5uSl7ChQdyK4K9c5GS5YMgcfi2hSTLP0ob6NTjjLO2iEicecwXtRUXc3dah X-Received: by 10.107.12.84 with SMTP id w81mr13888890ioi.33.1440016979027; Wed, 19 Aug 2015 13:42:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.19.130 with HTTP; Wed, 19 Aug 2015 13:42:19 -0700 (PDT) In-Reply-To: <55D4E0CB.7070404@redhat.com> References: <1439988825-19754-1-git-send-email-lgustavo@codesourcery.com> <55D48179.2030000@redhat.com> <55D485D1.8040802@codesourcery.com> <55D48891.7050808@redhat.com> <55D4C47F.6080902@codesourcery.com> <55D4DF8C.1000408@redhat.com> <55D4E0CB.7070404@redhat.com> From: Doug Evans Date: Wed, 19 Aug 2015 20:43:00 -0000 Message-ID: Subject: Re: [PATCH] Fix language of compilation unit with unknown file extension (Re: [PATCH] Guard compile tests from running when unsupported + harden feature support check) To: Pedro Alves Cc: Luis Machado , gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00531.txt.bz2 On Wed, Aug 19, 2015 at 1:02 PM, Pedro Alves wrote: > On 08/19/2015 08:57 PM, Pedro Alves wrote: >> On 08/19/2015 07:01 PM, Luis Machado wrote: >>> It could be either a GDB bug for not honoring the language in the DIE >>> itself or a testcase issue for not naming the source file with the >>> correct language extension. >> >> I think it's a GDB bug. See patch below. > > I had left some unnecessary bits in the test's assembly (copy/paste, and > then insufficient trimming). Here's a leaner version. > > --- > From 8451d7202d4126bfaec5a49fe555989b6fd9b2b1 Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Wed, 19 Aug 2015 20:52:44 +0100 > Subject: [PATCH] Fix language of compilation unit with unknown file extension > > Here, in dwarfread.c:process_full_comp_unit: > > /* Set symtab language to language from DW_AT_language. If the > compilation is from a C file generated by language preprocessors, do > not set the language if it was already deduced by start_subfile. */ > if (!(cu->language == language_c > && COMPUNIT_FILETABS (cust)->language != language_c)) > COMPUNIT_FILETABS (cust)->language = cu->language; > > in case start_subfile doesn't manage to deduce a language > COMPUNIT_FILETABS(cust)->language ends up as language_unknown, not > language_c. So the condition above evals false and we never set the > language from the cu's language. > > gdb/ChangeLog: > 2015-08-19 Pedro Alves > > * dwarf2read.c (process_full_comp_unit): To tell whether > start_subfile managed to deduce a language, test for > language_unknown instead of language_c. > > gdb/testsuite/ChangeLog: > 2015-08-19 Pedro Alves > > * gdb.dwarf2/comp-unit-lang.exp: New file. > * gdb.dwarf2/comp-unit-lang.c: New file. LGTM. I'm assuming the "global lang" in the test is necessary. Didn't verify it though.