From patchwork Thu Nov 30 16:35:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 24636 Received: (qmail 95659 invoked by alias); 30 Nov 2017 16:35:52 -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 95648 invoked by uid 89); 30 Nov 2017 16:35:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Nov 2017 16:35:50 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B89BC051670; Thu, 30 Nov 2017 16:35:49 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8367B60244; Thu, 30 Nov 2017 16:35:48 +0000 (UTC) Subject: [pushed] Fix gdb.linespec/cpls-ops.exp on 32-bit (Re: [pushed] Re: [PATCH 36/40] Add comprehensive C++ operator linespec/location/completion tests) To: Yao Qi References: <1496406158-12663-1-git-send-email-palves@redhat.com> <1496406158-12663-37-git-send-email-palves@redhat.com> <238ba190-4005-8fc9-b75c-0b4857db4df4@redhat.com> <62723028-4930-2b1e-97df-b1f491540750@redhat.com> Cc: Keith Seitz , GDB Patches From: Pedro Alves Message-ID: Date: Thu, 30 Nov 2017 16:35:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <62723028-4930-2b1e-97df-b1f491540750@redhat.com> On 11/30/2017 04:05 PM, Pedro Alves wrote: > Looks like I considered the possibility of different size_t typedefs > at some point but didn't really address it fully: > > proc test_operator_new {class_name brackets} { > # The type size_t is typedef-ed to. > set size_t "unsigned long" > > I'll fix this when I have a chance. I went ahead and pushed this in. From e3919f3e898aa5ab9a98dcaf9e242a9ebacc0757 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 30 Nov 2017 16:32:10 +0000 Subject: [PATCH] Fix gdb.linespec/cpls-ops.exp on 32-bit gdb.linespec/cpls-ops.exp is currently failing on x86-64 -m32 and other 32-bit ports: b test_op_new::operator new(unsigned int) FAIL: gdb.linespec/cpls-ops.exp: operator-new: tab complete "b test_op_new::operator" (timeout) ^CQuit (gdb) complete b test_op_new::operator b test_op_new::operator new(unsigned int) (gdb) FAIL: gdb.linespec/cpls-ops.exp: operator-new: cmd complete "b test_op_new::operator" The problem is simply that the testcase incorrectly assumes that size_t is "unsigned long". Fix this by extracting the right type with the "ptype" command. gdb/testsuite/ChangeLog: 2017-11-30 Pedro Alves * gdb.linespec/cpls-ops.exp (check_explicit_skips_function_argument): Extract the underlying type of size_t instead of hardcoding it. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.linespec/cpls-ops.exp | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d19eca2..5b8151d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-11-30 Pedro Alves + + * gdb.linespec/cpls-ops.exp + (check_explicit_skips_function_argument): Extract the underlying + type of size_t instead of hardcoding it. + 2017-11-29 Pedro Alves PR c++/19436 diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp index c1b6c33..d58a6de 100644 --- a/gdb/testsuite/gdb.linespec/cpls-ops.exp +++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp @@ -43,8 +43,17 @@ proc check_explicit_skips_function_argument {function} { # testing operator new. proc test_operator_new {class_name brackets} { - # The type size_t is typedef-ed to. - set size_t "unsigned long" + global gdb_prompt + + # Extract the type size_t is typedef-ed to. + set size_t "" + set test "get size_t underlying type" + gdb_test_multiple "ptype size_t" $test { + -re " = (\[ a-z\]*)\r\n$gdb_prompt $" { + set size_t $expect_out(1,string) + pass "$test" + } + } # Complete all prefixes between "operato" and the full prototype. foreach cmd_prefix {"b" "b -function"} {