From patchwork Fri Apr 25 02:48:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Blaikie X-Patchwork-Id: 673 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 04110360AAB for ; Thu, 24 Apr 2014 19:48:13 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id 984254EEB320; Thu, 24 Apr 2014 19:48:13 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 6CEE24EEB310 for ; Thu, 24 Apr 2014 19:48:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; q=dns; s=default; b= fcppshhiB7dKZHTiOhCDUTGYSsavwEhsZ5TMZMWdoK4G5Q2ZQd9/1x2w9vumJrwe eKIK4Qa65TcueHb6+QVKs4r7EK0i7JkX9zx2aHCSDCLeLA9pQiDRbd5xBmwvQPXL mkaLlNBlkBQwM4eLii411oOLLCF5e4+7rpCFaqjQTNM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; s=default; bh=jhOEh c4zWongQyCbrMJ78VLD42c=; b=b9XKvBehnK2aGiXHwwG5SQpTniEm9GwnsdM+c CwytzL0BVcRgHPSMOXoCgTtNWAkGYcYmcQI+4EaF5nWklRlYTHcV84AHLDw45tdL lv4Gw4440tWC4TtZMbQBhSE+iIjm9VlNZFSZcFIsXoo+1xZaJs2atugZlptujAS1 9Sl0Zs= Received: (qmail 29793 invoked by alias); 25 Apr 2014 02:48:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 29764 invoked by uid 89); 25 Apr 2014 02:48:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f170.google.com Received: from mail-ve0-f170.google.com (HELO mail-ve0-f170.google.com) (209.85.128.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 25 Apr 2014 02:48:03 +0000 Received: by mail-ve0-f170.google.com with SMTP id pa12so3992897veb.15 for ; Thu, 24 Apr 2014 19:48:01 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.53.1.69 with SMTP id be5mr3540679vdd.27.1398394081354; Thu, 24 Apr 2014 19:48:01 -0700 (PDT) Received: by 10.58.186.176 with HTTP; Thu, 24 Apr 2014 19:48:01 -0700 (PDT) In-Reply-To: <21336.17090.670369.508165@ruffy.mtv.corp.google.com> References: <21336.17090.670369.508165@ruffy.mtv.corp.google.com> Date: Thu, 24 Apr 2014 19:48:01 -0700 Message-ID: Subject: Re: [patch] Mark some tests as XFAIL/UNSUPPORTED hidden due to GCC's omission of typedefs in inheritance. From: David Blaikie To: Doug Evans , Pedro Alves Cc: gdb-patches , keiths@redhat.com X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in On Wed, Apr 23, 2014 at 3:46 PM, Doug Evans wrote: > David Blaikie writes: > > gdb.cp/impl-this.exp is testing the ability to scope names within a > > class and includes cases where the base class was specified via a > > typedef. > > > > Due to GCC's PR14819 these tests weren't actually testing this case - > > GCC produces the same debug info regardless of whether there's a > > typedef used in the base specifier. > > > > Clang correctly produces the typedef debug info for the base type and > > exposes a variety of failures/limitations in these test cases. > > > > The attached patch updates the tests to flag these cases as > > unsupported under GCC and xfail as appropriate under Clang. > > commit 7fa92f9a15f440129dd5a989511f3bbda646afa5 > > Author: David Blaikie > > Date: Sun Apr 13 11:15:44 2014 -0700 > > > > Mark some tests as XFAIL/UNSUPPORTED hidden due to GCC's omission of typedefs in inheritance. > > > > gdb/testsuite/ > > * gdb.cp/impl-this.exp: Mark several tests XFAIL/UNSUPPORTED due to > > PR16841 and GCC PR60833 > > There are several calls to setup_kfail passing gdb/x and gdb/y. > x and y need to be fixed. Ah, right, sorry - jumbled up a few bug numbers. The GDB bug is PR16841, I've updated all the kfails (both 'x' and 'y' - at first I'd thought they might be separate bugs, but I'm guessing they're the same one - I've mentioned the 'y' case down the bottom of PR16841, manifesting as "Cannot access memory at address 0x0") to refer to that GDB PR. > According to gdb/testsuite/README I think (!) setup_xfail should > be used here instead of setup_kfail, since the problem originates > with gcc. > > kfail = known gdb problem > xfail = known environment problem (e.g. compiler) Yep, that's my understanding as well - it's just that in this case these are actually GDB problems, so far as I can see, and should correctly be marked as KFAILs. Based on Pedro Alves's suggestion I've added some more of the detail that I mentioned in my first email, to the commit message (in the attached updated patch). The GCC bug is exposed in the suite as UNSUPPORTED - since GCC doesn't use the typedef in the inheritance, GCC doesn't actually exercise this part of the compiler. The non-typedef'd base tests can be exercised with either Clang or GCC's output, but since GCC doesn't use the typedef in the inheritance, testing that in GDB won't actually test anything other than redundantly test the non-typedef path again. > Ok with those changes. > [Though I can well imagine I'm missing something. > This part of the testsuite and c++ is a bit beyond me.] Let me know if there's some more information you'd like/I can provide. Happy to try to explain in more detail. Updated patch attached with * more detailed commit message * kfail with GDB bug number (GDB 16841) instead of placeholders commit bbb659b200a11a81853f1573f69a42e135b37244 Author: David Blaikie Date: Sun Apr 13 11:15:44 2014 -0700 Due to GCC's PR60833 several tests weren't providing their intended coverage, thus obscuring GDB PR16841 GCC PR60833 causes GCC to emit inheritance by referencing the base type directly, omitting any typedefs used in the original source. This bug makes it impossible to test that GCC can handle this situation and the test coverage added in gdb.cp/impl-this.exp was just redundantly testing the no-typedef case. Clang emits and uses the typedef in the inheritance and thus exposes the limitation in GDB (filed as PR16841) when encountering this situation. KFAIL tests under Clang and mark them UNSUPPORTED under GCC (since GCC's output cannot doesn't include the intended DWARF necessary to exercise GCC's behavior here). gdb/testsuite/ * gdb.cp/impl-this.exp: Mark several tests KFAIL/UNSUPPORTED due to GDB PR16841 and GCC PR60833 diff --git gdb/testsuite/ChangeLog gdb/testsuite/ChangeLog index 0cd9d83..7e360ae 100644 --- gdb/testsuite/ChangeLog +++ gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-04-24 David Blaikie + + * gdb.cp/impl-this.exp: Mark several tests KFAIL/UNSUPPORTED due to + GDB PR16841 and GCC PR60833 + 2014-04-25 Yao Qi * gdb.dwarf2/dwz.exp (Dwarf::assemble): Remove unused diff --git gdb/testsuite/gdb.cp/impl-this.exp gdb/testsuite/gdb.cp/impl-this.exp index dd1bc64..3191806 100644 --- gdb/testsuite/gdb.cp/impl-this.exp +++ gdb/testsuite/gdb.cp/impl-this.exp @@ -30,13 +30,22 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { with_test_prefix "before run" { gdb_test "print i" "No symbol \"i\" in current context." gdb_test "print D::i" "Cannot reference non-static field \"i\"" - gdb_test "print D::B::i" "Cannot reference non-static field \"i\"" - gdb_test "print B::i" "Cannot reference non-static field \"i\"" gdb_test "print D::C::i" "Cannot reference non-static field \"i\"" gdb_test "print C::i" "Cannot reference non-static field \"i\"" - gdb_test "print D::B::A::i" \ - "Cannot reference non-static field \"i\"" - gdb_test "print B::A::i" "Cannot reference non-static field \"i\"" + if {[test_compiler_info {gcc-*-*}]} { + unsupported "gdb/16841" + } else { + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::i" "Cannot reference non-static field \"i\"" + gdb_test "print D::Bint::i" "Cannot reference non-static field \"i\"" + gdb_test "print B::i" "Cannot reference non-static field \"i\"" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::A::i" \ + "Cannot reference non-static field \"i\"" + gdb_test "print D::Bint::A::i" \ + "Cannot reference non-static field \"i\"" + gdb_test "print B::A::i" "Cannot reference non-static field \"i\"" + } gdb_test "print A::i" "Cannot reference non-static field \"i\"" gdb_test "print D::C::A::i" "Cannot reference non-static field \"i\"" gdb_test "print C::A::i" "Cannot reference non-static field \"i\"" @@ -61,18 +70,27 @@ gdb_continue_to_breakpoint "continue to D::f" with_test_prefix "at D::f (valid expressions)" { gdb_test "print i" "= 4" gdb_test "print D::i" "= 4" - gdb_test "print D::B::i" "= 2" - gdb_test "print B::i" "= 2" - gdb_test "print D::Bint::i" \ - "No type \"Bint\" within class or namespace \"D\"." - gdb_test "print Bint::i" "= 2" + if {[test_compiler_info {gcc-*-*}]} { + unsupported "gdb/16841" + } else { + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::i" "= 2" + setup_kfail gdb/16841 *-*-* + gdb_test "print B::i" "= 2" + setup_kfail gdb/16841 *-*-* + gdb_test "print Bint::i" "= 2" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::Bint::i" "= 2" + setup_kfail gdb/16841 *-*-* + gdb_test "print Bint::i" "= 2" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::A::i" "= 1" + gdb_test "print B::A::i" "= 1" + gdb_test "print D::Bint::A::i" "= 1" + gdb_test "print Bint::A::i" "= 1" + } gdb_test "print D::C::i" "= 3" gdb_test "print C::i" "= 3" - gdb_test "print D::B::A::i" "= 1" - gdb_test "print B::A::i" "= 1" - gdb_test "print D::Bint::A::i" \ - "No type \"Bint\" within class or namespace \"D\"." - gdb_test "print Bint::A::i" "= 1" gdb_test "print A::i" "= 1" gdb_test "print D::C::A::i" "= 1" gdb_test "print C::A::i" "= 1" @@ -86,29 +104,40 @@ with_test_prefix "at D::f (valid expressions)" { # Test some invalid expressions with_test_prefix "at D::f (invalid expressions)" { - gdb_test "print D::B::c" "There is no field named c" - gdb_test "print D::B::A::c" "There is no field named c" - gdb_test "print D::Bint::c" \ - "No type \"Bint\" within class or namespace \"D\"." - - gdb_test "print D::Bint::A::c" \ - "No type \"Bint\" within class or namespace \"D\"." - gdb_test "print D::C::A::c" "There is no field named c" - gdb_test "print B::c" "There is no field named c" - gdb_test "print B::A::c" "There is no field named c" - gdb_test "print Bint::c" "There is no field named c" - gdb_test "print Bint::A::c" "There is no field named c" + if {[test_compiler_info {gcc-*-*}]} { + unsupported "gdb/16841" + } else { + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::c" "There is no field named c" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::A::c" "There is no field named c" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::Bint::c" \ + "No type \"Bint\" within class or namespace \"D\"." + setup_kfail gdb/16841 *-*-* + gdb_test "print D::Bint::A::c" \ + "No type \"Bint\" within class or namespace \"D\"." + gdb_test "print B::c" "There is no field named c" + gdb_test "print B::A::c" "There is no field named c" + gdb_test "print Bint::c" "There is no field named c" + gdb_test "print Bint::A::c" "There is no field named c" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::x" "There is no field named x" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::B::A::x" "There is no field named x" + setup_kfail gdb/16841 *-*-* + gdb_test "print D::Bint::x" \ + "No type \"Bint\" within class or namespace \"D\"." + setup_kfail gdb/16841 *-*-* + gdb_test "print D::Bint::A::x" \ + "No type \"Bint\" within class or namespace \"D\"." + gdb_test "print B::x" "There is no field named x" + gdb_test "print B::A::x" "There is no field named x" + gdb_test "print Bint::x" "There is no field named x" + gdb_test "print Bint::A::x" "There is no field named x" + } gdb_test "print C::A::c" "There is no field named c" - gdb_test "print D::B::x" "There is no field named x" - gdb_test "print D::B::A::x" "There is no field named x" - gdb_test "print D::Bint::x" \ - "No type \"Bint\" within class or namespace \"D\"." - gdb_test "print D::Bint::A::x" \ - "No type \"Bint\" within class or namespace \"D\"." - gdb_test "print B::x" "There is no field named x" - gdb_test "print B::A::x" "There is no field named x" - gdb_test "print Bint::x" "There is no field named x" - gdb_test "print Bint::A::x" "There is no field named x" + gdb_test "print D::C::A::c" "There is no field named c" gdb_test "print D::C::x" "There is no field named x" gdb_test "print C::x" "There is no field named x" gdb_test "print D::C::A::x" "There is no field named x" @@ -117,8 +146,14 @@ with_test_prefix "at D::f (invalid expressions)" { # Test some ambiguous names with_test_prefix "at D::f (ambiguous names)" { - gdb_test "print B::common" " = 200" - gdb_test "print Bint::common" " = 200" + if {[test_compiler_info {gcc-*-*}]} { + unsupported "gdb/16841" + } else { + setup_kfail gdb/16841 *-*-* + gdb_test "print B::common" " = 200" + setup_kfail gdb/16841 *-*-* + gdb_test "print Bint::common" " = 200" + } gdb_test "print C::common" " = 300" gdb_test "print am.i" " = 1000" gdb_test "print am.A::i" \