From patchwork Tue Sep 9 21:17:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 2713 Received: (qmail 27775 invoked by alias); 9 Sep 2014 21:17:19 -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 27758 invoked by uid 89); 9 Sep 2014 21:17:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 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-ob0-f202.google.com Received: from mail-ob0-f202.google.com (HELO mail-ob0-f202.google.com) (209.85.214.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 09 Sep 2014 21:17:15 +0000 Received: by mail-ob0-f202.google.com with SMTP id wp18so2950539obc.1 for ; Tue, 09 Sep 2014 14:17:13 -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=u1EnCyPH9pclfA7hUtUPgvBvYwQ+cLXyYyqwi9rUnZw=; b=WG0k4yjd6pyhIAl+qdT9PzlmMGbcuT2C83bl9nk1/XnJCn5Y24Ob2RKQ3MPy/2gFie OsIfZHjutzTNBeBPzpLvE7+UiRFleUVmOdEAbymJOc4I1p+r0JP/tj+wRFNlFk7Cx39k tKyog3+FkzSWsV0kihnodBsJ4bXEFQX7kmAxl8cOWGoi1/Qo6A5a8QgquFfqSViVlWcz cnEMGAaE3PIJrTIbsKjMU9Xi1zOZXBwfGxFWwnYahTNl/hbHu9Sycad8HynuTTaMa3Mr ZtF5WSN6YV8GZ7tEHj7E+16rQMpMSlWWWfdj9e0DUmSAfvrHOGduQHJ+VWqBuGcYufaD GXlg== X-Gm-Message-State: ALoCoQnnsRkJoZHoMYZtRN7HMjY7+0XfJAuMhH1pkqXsOEHvFOQjdGtPJz9iS+G++bS8T9ZSU6QvgHLBm+ISal5J00VEo7yRz43y6Xwu16ecgempIyIvoioMN/Ys5YNI2XTQ1o94OflGGHRHV+VMUfywJ89uUx80qS64EsQjdHbFxWTTlU4QlUM= X-Received: by 10.182.102.34 with SMTP id fl2mr23932852obb.16.1410297433912; Tue, 09 Sep 2014 14:17:13 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id e24si1078088yhe.3.2014.09.09.14.17.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2014 14:17:13 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com ([172.17.128.107]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id vSkrGb3h.1; Tue, 09 Sep 2014 14:17:13 -0700 From: Doug Evans MIME-Version: 1.0 Message-ID: <21519.28248.577451.227482@ruffy2.mtv.corp.google.com> Date: Tue, 9 Sep 2014 14:17:12 -0700 To: Jan Kratochvil Cc: Thomas Schwinge , gdb-patches@sourceware.org Subject: Re: [GCC PR55056] Re: [RFC patch] testsuite: Workaround issues with GCC 4.8.0pre + gdb.trace new KFAIL In-Reply-To: <20130614133849.GA12925@host2.jankratochvil.net> References: <20130126202645.GA4888@host2.jankratochvil.net> <5106D7E1.1060705@codesourcery.com> <20130129174955.GA17823@host2.jankratochvil.net> <20130202092240.GA24458@host2.jankratochvil.net> <20130203172721.GA8611@host2.jankratochvil.net> <87r4g4vo94.fsf@kepler.schwinge.homeip.net> <20130614133849.GA12925@host2.jankratochvil.net> X-IsSubscribed: yes [- gcc] Jan Kratochvil writes: > On Fri, 14 Jun 2013 15:02:47 +0200, Thomas Schwinge wrote: > > On Sun, 3 Feb 2013 18:27:21 +0100, Jan Kratochvil wrote: > > > gdb/testsuite/ > > > 2013-02-02 Jan Kratochvil > > > > > > Workaround GCC PR debug/55056 and GDB PR server/15081. > > > * gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef. > > > (caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef. > > > (caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef. > > > * gdb.base/restore.exp: New variable opts. Test caller3, caller4 and > > > caller5 for l1, l2 and l3. New prepare_for_testing. > > > * gdb.base/store.c (wack_longest, wack_float, wack_double) > > > (wack_doublest): Protect l and r by GCC_PR_55056 #ifdef. > > > * gdb.base/store.exp: New variable opts. Test longest, float, double > > > and doublest functions for l and r. New prepare_for_testing. > > > * gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by > > > GCC_PR_55056 #ifdef. Protect locar by GDB_PR_15081 #ifdef. > > > * gdb.trace/unavailable.c: Likewise. > > > * gdb.trace/collection.exp: New variable opts. Test reglocal_test_func > > > for locf, locd and locar. New prepare_for_testing. > > > (gdb_collect_locals_test): Increase list size to 43. > > > * gdb.trace/unavailable.exp: Likewise. > > > > As far as I can tell, no consensus has yet been reached about the > > approach to fix this issue discussed in this thread. (I have not looked > > at the proposed patch in detail.) > > I have found now I posted the testsuite workaround for GDB > http://sourceware.org/ml/gdb-patches/2013-01/msg00688.html > but it has never been checked-in (neither in Fedora) which explains why you > see PASS->FAIL (which I also see on Fedora 19). Hi. The patch kinda died at this point. Have you thought of how you might do it differently now? If not, any objections to committing it? [rebased on top of current head] gdb/testsuite/ 2013-01-26 Jan Kratochvil Workaround GCC PR debug/55056 and GDB PR server/15081. * gdb.base/restore.c (caller3): Protect l1 by GCC_PR_55056 #ifdef. (caller4): Protect l1 and l2 by GCC_PR_55056 #ifdef. (caller5): Protect l1, l2 and l3 by GCC_PR_55056 #ifdef. * gdb.base/restore.exp: New variable opts. Test caller3, caller4 and caller5 for l1, l2 and l3. New prepare_for_testing. * gdb.base/store.c (wack_longest, wack_float, wack_double) (wack_doublest): Protect l and r by GCC_PR_55056 #ifdef. * gdb.base/store.exp: New variable opts. Test longest, float, double and doublest functions for l and r. New prepare_for_testing. * gdb.trace/collection.c (reglocal_test_func): Protect locf and locd by GCC_PR_55056 #ifdef. Protect locar by GDB_PR_15081 #ifdef. * gdb.trace/collection.exp: New variable opts. Test reglocal_test_func for locf, locd and locar. New prepare_for_testing. (gdb_collect_locals_test): Increase list size to 43. diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c index 2ef0d36..70682da 100644 --- a/gdb/testsuite/gdb.base/restore.c +++ b/gdb/testsuite/gdb.base/restore.c @@ -205,6 +205,10 @@ caller2 (void) int caller3 (void) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register int l1 = increment (0x7eeb); /* caller3 prologue */ register int l2 = increment (l1); register int l3 = increment (l2); @@ -221,7 +225,15 @@ caller3 (void) int caller4 (void) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register int l1 = increment (0x7eeb); /* caller4 prologue */ + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register int l2 = increment (l1); register int l3 = increment (l2); register int l4 = increment (l3); @@ -238,8 +250,20 @@ caller4 (void) int caller5 (void) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register int l1 = increment (0x7eeb); /* caller5 prologue */ + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register int l2 = increment (l1); + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register int l3 = increment (l2); register int l4 = increment (l3); register int l5 = increment (l4); diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp index 9bba535..65ef4b9 100644 --- a/gdb/testsuite/gdb.base/restore.exp +++ b/gdb/testsuite/gdb.base/restore.exp @@ -24,7 +24,37 @@ standard_testfile set executable $testfile -if { [prepare_for_testing $testfile.exp $executable $srcfile] } { +set opts {debug} + +if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } { + return -1 +} + +if {![runto_main]} { + return -1 +} + +foreach caller { caller3 caller4 caller5 } { with_test_prefix $caller { + gdb_breakpoint $caller + gdb_continue_to_breakpoint $caller + + foreach l { l1 l2 l3 } { with_test_prefix $l { + set test "info addr $l" + gdb_test_multiple $test $test { + -re "\r\nSymbol \"$l\" is optimized out\\.\r\n$gdb_prompt $" { + lappend opts additional_flags=-DGCC_PR_55056 + xfail "$test (register variable has no location)" + } + -re "\r\nSymbol \"$l\" is .*\r\n$gdb_prompt $" { + pass $test + } + } + }} +}} + +set executable ${testfile}opts + +if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } { return -1 } diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c index 545515d..3ac4a1a 100644 --- a/gdb/testsuite/gdb.base/store.c +++ b/gdb/testsuite/gdb.base/store.c @@ -98,6 +98,10 @@ wack_long (register long u, register long v) long wack_longest (register longest u, register longest v) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register longest l = u, r = v; l = add_longest (l, r); return l + r; @@ -106,6 +110,10 @@ wack_longest (register longest u, register longest v) float wack_float (register float u, register float v) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register float l = u, r = v; l = add_float (l, r); return l + r; @@ -114,6 +122,10 @@ wack_float (register float u, register float v) double wack_double (register double u, register double v) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register double l = u, r = v; l = add_double (l, r); return l + r; @@ -122,6 +134,10 @@ wack_double (register double u, register double v) doublest wack_doublest (register doublest u, register doublest v) { + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register doublest l = u, r = v; l = add_doublest (l, r); return l + r; diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp index f0fab90..f235bd2 100644 --- a/gdb/testsuite/gdb.base/store.exp +++ b/gdb/testsuite/gdb.base/store.exp @@ -18,7 +18,37 @@ standard_testfile set executable $testfile -if { [prepare_for_testing $testfile.exp $executable $srcfile] } { +set opts {debug} + +if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } { + return -1 +} + +if {![runto_main]} { + return -1 +} + +foreach func { longest float double doublest } { with_test_prefix $func { + gdb_breakpoint wack_$func + gdb_continue_to_breakpoint wack_$func + + foreach var { l r } { with_test_prefix $var { + set test "info addr $var" + gdb_test_multiple $test $test { + -re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" { + lappend opts additional_flags=-DGCC_PR_55056 + xfail "$test (register variable has no location)" + } + -re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" { + pass $test + } + } + }} +}} + +set executable ${testfile}opts + +if { [prepare_for_testing $testfile.exp $executable $srcfile $opts] } { return -1 } diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c index a568c37..9dcadae 100644 --- a/gdb/testsuite/gdb.trace/collection.c +++ b/gdb/testsuite/gdb.trace/collection.c @@ -141,10 +141,23 @@ int reglocal_test_func () /* test collecting register locals */ { register char locc = 11; register int loci = 12; + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register float locf = 13.3; + /* volatile is a GCC PR debug/55056 workaround. */ +#ifdef GCC_PR_55056 + volatile +#endif register double locd = 14.4; register test_struct locst; - register int locar[4]; + /* The "register" removal is a GDB PR server/15081 workaround as it cannot + handle DW_OP_piece variables occupying more than 64 bits on gcc-4.8.0. */ +#ifndef GDB_PR_15081 + register +#endif + int locar[4]; int i; locst.memberc = 15; diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp index e0763d9..4fca436 100644 --- a/gdb/testsuite/gdb.trace/collection.exp +++ b/gdb/testsuite/gdb.trace/collection.exp @@ -19,7 +19,43 @@ load_lib "trace-support.exp" standard_testfile set executable $testfile -if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} { +set opts {debug nowarnings} + +if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} { + return -1 +} + +if {![runto reglocal_test_func]} { + return -1 +} + +foreach var { locf locd } { with_test_prefix $var { + set test "info addr $var" + gdb_test_multiple $test $test { + -re "\r\nSymbol \"$var\" is optimized out\\.\r\n$gdb_prompt $" { + lappend opts additional_flags=-DGCC_PR_55056 + xfail "$test (register variable has no location)" + } + -re "\r\nSymbol \"$var\" is .*\r\n$gdb_prompt $" { + pass $test + } + } +}} + +set test "info addr locar" +gdb_test_multiple $test $test { + -re "\r\nSymbol \"locar\" is a variable \[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\\[8-byte piece\\\]\[^\r\n\]*\\.\r\n$gdb_prompt $" { + lappend opts additional_flags=-DGDB_PR_15081 + kfail gdb/15081 "$test (GDB cannot handle >64-bit trace data))" + } + -re "\r\nSymbol \"locar\" is .*\r\n$gdb_prompt $" { + pass $test + } +} + +set executable ${testfile}opts + +if {[prepare_for_testing $testfile.exp $executable $srcfile $opts]} { return -1 } @@ -300,7 +336,7 @@ proc gdb_collect_locals_test { func mylocs msg } { # Find the comment-identified line for setting this tracepoint. set testline 0 - gdb_test_multiple "list $func, +30" "collect $msg: find tracepoint line" { + gdb_test_multiple "list $func, +43" "collect $msg: find tracepoint line" { -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" { set testline $expect_out(1,string) pass "collect $msg: find tracepoint line"