From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9/aJO1dSdGIBiQQAWB0awg (envelope-from ) for ; Thu, 05 May 2022 18:40:23 -0400 Received: by simark.ca (Postfix, from userid 112) id E75F81E058; Thu, 5 May 2022 18:40:23 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=EFU8GUXQ; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7E9C81E00D for ; Thu, 5 May 2022 18:40:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EEAF2385736F for ; Thu, 5 May 2022 22:40:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEAF2385736F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651790423; bh=pgS9GBzaTZupzgpP7623Y/jqpgxpM7XBIQOQzGA+msA=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EFU8GUXQlg277A1HMYx/+alSwNAYwNlfeHO6VzSqjIkRbfHuscsF3SPAxwN6s+DVt PmgFb8K9mpVtL/5ea0vIfKQEQvgzeNYhm4NJ1PmPBcdPfoeF90BXW3QCMgcMw10d4y PEgeGf9Tn792c8FuJh1i12A5bofhPeKw7sJhKfkQ= Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by sourceware.org (Postfix) with ESMTPS id 18F8D385801E for ; Thu, 5 May 2022 22:40:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 18F8D385801E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-53-YZ43Jki3OfOF5ZUD-PPq_A-1; Thu, 05 May 2022 18:40:02 -0400 X-MC-Unique: YZ43Jki3OfOF5ZUD-PPq_A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59320299E778; Thu, 5 May 2022 22:40:02 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.17.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 173F041617E; Thu, 5 May 2022 22:40:02 +0000 (UTC) Date: Thu, 5 May 2022 15:40:00 -0700 To: Tom de Vries Subject: Re: [PATCH][gdb/testsuite] Fix gdb.dwarf2/locexpr-data-member-location.exp with nopie Message-ID: <20220505154000.62c2a883@f35-zws-1> In-Reply-To: <20220504120046.GA8717@delia.home> References: <20220504120046.GA8717@delia.home> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Kevin Buettner via Gdb-patches Reply-To: Kevin Buettner Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Tom, On Wed, 4 May 2022 14:00:47 +0200 Tom de Vries wrote: > When running test-case gdb.dwarf2/locexpr-data-member-location.exp with > target board unix/-fno-PIE/-no-pie/-m32 I run into: > ... > (gdb) step^M > 26 return 0;^M > (gdb) FAIL: gdb.dwarf2/locexpr-data-member-location.exp: step into foo > ... > > The problem is that the test-case tries to mimic some gdb_compile_shlib > behaviour using: > ... > set flags {additional_flags=-fpic debug} > get_func_info foo $flags > ... > but this doesn't work with the target board setting, because we end up doing: > ... > gcc locexpr-data-member-location-lib.c -fpic -g -lm -fno-PIE -no-pie -m32 \ > -o func_addr23029.x > ... > while gdb_compile_shlib properly filters out the -fno-PIE -no-pie. > > Consequently, the address for foo determined by get_func_info doesn't match > the actual address of foo. > > Fix this by printing the address of foo using the result of gdb_compile_shlib. > > Any comments? Nice job on cleaning up the problems with this test case! (Though I did have to spend a while studying 'with_shared_gdb'.) LGTM... Kevin