From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32707 invoked by alias); 24 Apr 2014 00:20:30 -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 32694 invoked by uid 89); 24 Apr 2014 00:20:30 -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-ie0-f202.google.com Received: from mail-ie0-f202.google.com (HELO mail-ie0-f202.google.com) (209.85.223.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 24 Apr 2014 00:20:29 +0000 Received: by mail-ie0-f202.google.com with SMTP id lx4so426024iec.5 for ; Wed, 23 Apr 2014 17:20:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=edm+09d3MCR1fvP9AFt3AxaUr5FZpGLBo+/uTEQA324=; b=iyYKPnQURAb+fXJq1stnjy2oOUexx+jyZILl5fz2CZrh22MYkAhxMYaNayftJ24FtC /oN5E6+wmp0uxUC1gU0fsHV45nWJcvGQHrPng3ZFogJqqeJni0P0bpn+7xG2Xp+LpEPU LRZvOls5CpFhmcKtgFaEc+2mm+Wjlcd0kNwZNfi2Qzz8SmYyJesgZgRVW77/fn35qfab UA6qjgsMvLpgHQvZwV08QE+J+1CccdkgO/bQF0Nhm2rAWEdX3BUV0uwmOkNQz/yfnnN4 Ll0Lpmo83o58FAx2N+GOqf+jq2Lfvz4uHmmz5lcth4cmriKODC3zivHKZrFDpj+TImf3 vB5Q== X-Gm-Message-State: ALoCoQkOTxHYa5t9pieKooo3a/zoVcmV/zeCmVhXsdh2vG5XfI25hHvT+EKZBp4gmkxRduKNdhjYt/zH4XZM1CGQTzyN/iH0Z+4390uE30cufpvBOxctSMDIDTiq3lxuI3eJ2oF/y9Ndn4odDYd4lSDifIEl9g1OIobcF4x9MXtbgLxuzkYtvH4Eo9yMl7yr39N8emF10Nb9faN6bzg5ak17kuJePy7Ltw== X-Received: by 10.182.105.1 with SMTP id gi1mr27407858obb.6.1398298827284; Wed, 23 Apr 2014 17:20:27 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id g21si332457yhe.3.2014.04.23.17.20.27 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Apr 2014 17:20:27 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id BB04A31C056; Wed, 23 Apr 2014 17:20:26 -0700 (PDT) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21336.22730.235280.1770@ruffy.mtv.corp.google.com> Date: Thu, 24 Apr 2014 00:20:00 -0000 To: David Blaikie Cc: gdb-patches Subject: Re: [patch] [gdb/testsuite] include a use of the definition of a type to cause clang to emit debug info In-Reply-To: References: X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00483.txt.bz2 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.