From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5498 invoked by alias); 24 Apr 2014 00:29:24 -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 5485 invoked by uid 89); 24 Apr 2014 00:29:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 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-ve0-f178.google.com Received: from mail-ve0-f178.google.com (HELO mail-ve0-f178.google.com) (209.85.128.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 24 Apr 2014 00:29:22 +0000 Received: by mail-ve0-f178.google.com with SMTP id jw12so2140209veb.9 for ; Wed, 23 Apr 2014 17:29:20 -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:date :message-id:subject:from:to:cc:content-type; bh=gYQOIZD1+dpwzUfU77K5AO0Q9DrJchAeYLJPnEI/WNM=; b=eWU0mDjn4BE4/A50t1U3dLyNBPX2GR7+HfvM0wngYaD6Ggr40OSPrgONvPMnnIH8kd JpfbMfQunSObAybqZnmxzGHExpc9zIhefvHY8w3/9IDfupPYyoJ33ey3ai2AC56EdVIA aArkaUn2UMdLqULPe4oDoxQPchNpyK9S1WK7Zk6a9P/+qXFdTwQNL2Rgp7HMKCat2iN0 2bkdhEwtXVpHXCBFij9ZCdvuxq6E2wUGXTAYHKpxEtNPJvp5Vxe3Gdt7WE1gGOKrS76N phtcEa1TPuFRHs2p1QjFuMuC+UIlPSQnOaj4CNcMPj+hCCuv3n6oAVjfpaBrHpD1MB+0 Md1g== X-Gm-Message-State: ALoCoQk1a4BVay3kTV8S1h4pBtC4XDv1xB+DenGcmtHGKsP0+z8NubOm9Dw0t2jji2VHejwl9cOiH3wLboCM6NcyvkB/vKPw8+kEeo3LpMFEZp248y8ixLzx4JdxE41k9e77yxJghPKZ27YRRXUm7JqaaQzba8bm43s3VxLZXWpORSKI4ABJs427JtxW2TEAs+9zt0bvd+Xa0eUE/XpdWbB295RwmkouuA== MIME-Version: 1.0 X-Received: by 10.52.189.193 with SMTP id gk1mr20132563vdc.12.1398299360146; Wed, 23 Apr 2014 17:29:20 -0700 (PDT) Received: by 10.52.13.101 with HTTP; Wed, 23 Apr 2014 17:29:20 -0700 (PDT) In-Reply-To: <21336.22730.235280.1770@ruffy.mtv.corp.google.com> References: <21336.22730.235280.1770@ruffy.mtv.corp.google.com> Date: Thu, 24 Apr 2014 00:29:00 -0000 Message-ID: Subject: Re: [patch] [gdb/testsuite] include a use of the definition of a type to cause clang to emit debug info From: Doug Evans To: David Blaikie , Joel Brobecker , Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00485.txt.bz2 On Wed, Apr 23, 2014 at 5:20 PM, Doug Evans wrote: > David Blaikie writes: > > Clang has an optimization that causes a the debug info to only include > > the declaration of a type if the type is referenced but never used in > > a context that requires a definition (eg: pointers are handed around > > but never deferenced). > > > > This patch introduces a variable to one test file to cause clang to > > emit the full definition of the type as well as fixing up a related > > typo in the test message of the associated expect file. > > > > Like the difference between GCC and Clang in the emission of unused > > static entities, I think this case is also a matter of degrees - both > > GCC and Clang implement other similar optimizations* to the one > > outlined here and the GDB test suite has managed to pass without > > disabling those optimizations in GCC and I hope it's suitable to do > > the same for Clang. > > > > Though admittedly I don't have much of the context of the history of > > the testsuite, its priorities/preferences when it comes to > > distinguishing testing compiler behavior versus debugger behavior, > > etc. > > > > * the one I know of involves dynamic types: both GCC and Clang only > > emit the debug info definition of such a type in any translation unit > > that emits the key function. This means in many contexts where a full > > definition is provided in the source only a declaration is provided in > > the debug info. > > commit 1128f6fb45483d45668d09e0696f4a590334e0c4 > > Author: David Blaikie > > Date: Sat Apr 12 23:27:19 2014 -0700 > > > > Cause clang to emit the definition of a type used only by pointer > > > > gdb/testsuite/ > > * gdb.stabs/gdb11479.c: introduce a variable to cause clang to > > emit the full definition of type required by the test > > * gdb.stabs/gdb11479.exp: correct a typo in a test message > > ChangeLog conventions require one to document more specifically > where the change occurred. E.g., > > * gdb.stabs/gdb11479.c (tag_dummy_enum): New global to cause clang to > emit the full definition of type required by the test. > * gdb.stabs/gdb11479.exp (do_test): Correct a typo in a test message. > > Plus note the capitalization and period. > > Plus conventions also say to specify the "why" of things in source > and not the changelog. I realize we're not going to the trouble > of adding comments to every non-static function to document why it > has to be non-static. So I don't see a great need to do so here, > and I'd leave the ChangeLog entry as written. > I'm just writing this down in case the topic comes up. > > > > > diff --git gdb/testsuite/ChangeLog gdb/testsuite/ChangeLog > > index 730c116..07ba18e 100644 > > --- gdb/testsuite/ChangeLog > > +++ gdb/testsuite/ChangeLog > > @@ -1,3 +1,9 @@ > > +2014-04-12 David Blaikie > > + > > + * gdb.stabs/gdb11479.c: introduce a variable to cause clang to > > + emit the full definition of type required by the test > > + * gdb.stabs/gdb11479.exp: correct a typo in a test message > > + > > Mix of tabs and spaces. Just use tabs. > > Ok with those changes. Bleah. Sorry Joel. I didn't see your earlier mail. What do you think of adding a testcase that explicitly tests the user's expectation? [per Pedro's suggestion]