From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40893 invoked by alias); 14 Sep 2017 17:48:35 -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 40819 invoked by uid 89); 14 Sep 2017 17:48:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS 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, 14 Sep 2017 17:48:22 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9B0DC058EAF for ; Thu, 14 Sep 2017 17:48:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A9B0DC058EAF Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com 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 0FE2D6F11D; Thu, 14 Sep 2017 17:48:15 +0000 (UTC) Subject: Re: [pushed] gdb.base/nodebug.exp: Rename called functions To: Pedro Alves , GDB Patches References: <1505411179-2986-1-git-send-email-palves@redhat.com> From: Pedro Alves Message-ID: Date: Thu, 14 Sep 2017 17:48:00 -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: <1505411179-2986-1-git-send-email-palves@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00393.txt.bz2 The $subject is incorrect, but I failed to notice it until it was too late. I was originally going to rename the functions, until I realized that unloading symbols was a more complete fix. Thanks, Pedro Alves On 09/14/2017 06:46 PM, Pedro Alves wrote: > I'm seeing these failures on my system: > > FAIL: gdb.base/nodebug.exp: p (double) mult (2.0, 3.0) > FAIL: gdb.base/nodebug.exp: p ((double (*) (double, double)) mult)(2.0f, 3.0f) > FAIL: gdb.base/nodebug.exp: p ((double (*) (double, double)) mult)(2, 3) > > The problem is simply that GDB is finding a symbol named "mult" from > glibc's debug info: > > (gdb) ptype mult > type = enum expression_operator {var, num, lnot, mult, divide, module, plus, minus, less_than, greater_than, less_or_equal, greater_or_equal, equal, not_equal, land, lor, qmop} > > (gdb) info types expression_operator > All types matching regular expression "expression_operator": > > File plural-exp.h: > enum expression_operator; > > Fix this by unloading symbols from shared libraries. > > gdb/testsuite/ChangeLog: > 2017-09-14 Pedro Alves > > * gdb.base/nodebug.exp (nodebug_runto): New procedure. > (top level): Use it instead of runto. > --- > gdb/testsuite/ChangeLog | 5 +++++ > gdb/testsuite/gdb.base/nodebug.exp | 19 +++++++++++++++++-- > 2 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog > index 2726d46..745d2d1 100644 > --- a/gdb/testsuite/ChangeLog > +++ b/gdb/testsuite/ChangeLog > @@ -1,3 +1,8 @@ > +2017-09-14 Pedro Alves > + > + * gdb.base/nodebug.exp (nodebug_runto): New procedure. > + (top level): Use it instead of runto. > + > 2017-09-11 Tom Tromey > > * gdb.base/ena-dis-br.exp (test_ena_dis_br): Update test. > diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp > index 2099456..3a2a821 100644 > --- a/gdb/testsuite/gdb.base/nodebug.exp > +++ b/gdb/testsuite/gdb.base/nodebug.exp > @@ -39,6 +39,21 @@ if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != " > > clean_restart $binfile > > +# Run to FUNC and unload symbols from system shared libraries, to > +# avoid conflicts with the minsyms in the program. E.g., > +# intl/plural-exp.h has 'enum expression_operator {..., mult, ...}'. > + > +proc nodebug_runto {func} { > + with_test_prefix $func { > + if ![runto $func] { > + return false > + } > + gdb_test_no_output "nosharedlibrary" \ > + "unload symbols from system libraries" > + return true > + } > +} > + > # Test calling no-debug functions involving argument types that may > # require coercion/promotion, both prototyped and unprototyped, both > # return-type-cast style, and function-pointer-cast styles. > @@ -73,7 +88,7 @@ proc test_call_promotion {} { > gdb_test "p /d ((uint8 (*) ()) add8_noproto)((uint8) 2, (uint8) 3)" " = 5" > } > > -if [runto inner] then { > +if [nodebug_runto inner] then { > > # Expect to find global/local symbols in each of text/data/bss. > > @@ -273,7 +288,7 @@ if [runto inner] then { > > # Now, try that we can give names of file-local symbols which happen > # to be unique, and have it still work > - if [runto middle] then { > + if [nodebug_runto middle] then { > gdb_test "backtrace 10" "#0.*middle.*#1.*top.*#2.*main.*" \ > "backtrace from middle in nodebug.exp" > } >