From patchwork Tue Jun 18 15:38:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33187 Received: (qmail 82385 invoked by alias); 18 Jun 2019 15:38:36 -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 82372 invoked by uid 89); 18 Jun 2019 15:38:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=3027, HX-Languages-Length:1568, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jun 2019 15:38:34 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 438C056092; Tue, 18 Jun 2019 11:38:33 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7gjdsh7jY6xt; Tue, 18 Jun 2019 11:38:33 -0400 (EDT) Received: from murgatroyd.Home (75-166-12-78.hlrn.qwest.net [75.166.12.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id E400456071; Tue, 18 Jun 2019 11:38:32 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix two buglets in cp_print_value_fields patch Date: Tue, 18 Jun 2019 09:38:30 -0600 Message-Id: <20190618153830.20876-1-tromey@adacore.com> MIME-Version: 1.0 Pedro and Tom both pointed out issues in the cp_print_value_fields patch, aka the fix for PR c++/20020. This patch addresses both issues. Tested on x86-64 Fedora 29. gdb/ChangeLog 2019-06-18 Tom Tromey * cp-valprint.c (cp_print_value_fields): Pass opts, not options, to cp_print_static_field. gdb/testsuite/ChangeLog 2019-06-18 Tom Tromey * gdb.cp/constexpr-field.exp: Use setup_xfail. --- gdb/ChangeLog | 5 +++++ gdb/cp-valprint.c | 2 +- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.cp/constexpr-field.exp | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 5781d7ab561..d3a38d885d8 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -302,7 +302,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, cp_print_static_field (TYPE_FIELD_TYPE (type, i), v, stream, recurse + 1, - options); + opts); } catch (const gdb_exception_error &ex) { diff --git a/gdb/testsuite/gdb.cp/constexpr-field.exp b/gdb/testsuite/gdb.cp/constexpr-field.exp index e4849efeae9..2f71cef952a 100644 --- a/gdb/testsuite/gdb.cp/constexpr-field.exp +++ b/gdb/testsuite/gdb.cp/constexpr-field.exp @@ -31,6 +31,7 @@ if {![runto_main]} { # "x" sometimes isn't available due to # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90526 -gdb_test "print x" " = {static f = .*}" +setup_xfail *-*-* gcc/90526 +gdb_test "print x" " = {static f = true}" gdb_test "print y" " = {static f = true}"