From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113051 invoked by alias); 6 Jul 2016 19:35:15 -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 113039 invoked by uid 89); 6 Jul 2016 19:35:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=compile_flags, prepended, $lines, him 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Jul 2016 19:35:13 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D904192A43; Wed, 6 Jul 2016 19:35:11 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u66JZ80O024536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jul 2016 15:35:10 -0400 Date: Wed, 06 Jul 2016 19:35:00 -0000 From: Jan Kratochvil To: Yao Qi Cc: "gdb-patches@sourceware.org" , Kevin Buettner Subject: [testsuite patchv2] [ppc64] gdb_target_symbol fix for function descriptors [Re: [testsuite patch] [ppc64] +kfail: gdb_target_symbol does not support function descriptors] Message-ID: <20160706193508.GA2313@host1.jankratochvil.net> References: <20160705145454.GA26978@host1.jankratochvil.net> <20160706081122.GA19754@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <20160706081122.GA19754@host1.jankratochvil.net> User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00102.txt.bz2 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 485 On Wed, 06 Jul 2016 10:11:22 +0200, Jan Kratochvil wrote: > Now the question is how to detect that. I used "powerpc64-*linux*" target > match in my patch but I guess that is not right. Maybe it could compile first > something and check if ".somesymbol" exists. Implemented the compile test. It works for me on RHEL-7.2 ppc64 and on Fedora 24 x86_64. OK for check-in? I see gdb_target_symbol_prefix is by Kevin so Ccing him if he sees it OK even on those platforms. Thanks, Jan --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=1 Content-length: 1777 gdb/testsuite/ChangeLog 2016-07-06 Jan Kratochvil * lib/gdb.exp (gdb_target_code_symbol_prefix): New. (gdb_target_symbol): Call it. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b7b8fad..7e64edc 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5690,11 +5690,48 @@ gdb_caching_proc gdb_target_symbol_prefix { return $prefix } +# gdb_target_code_symbol_prefix compiles a test program and tries to use +# '.' prefix at a code symbol to test if there are function descriptors. +# gdb_target_symbol_prefix is not expected to be needed on such targets. + +gdb_caching_proc gdb_target_code_symbol_prefix { + # Set up and compile a simple test program... + set srcc [standard_temp_file main[pid].c] + set srcs [standard_temp_file main[pid].s] + set exe [standard_temp_file main[pid].x] + + gdb_produce_source $srcc { + int main() { + return 0; + } + } + gdb_produce_source $srcs { + .8byte .main + } + + verbose "compiling testfile $srcc $srcs" 2 + set compile_flags {nodebug nowarnings quiet} + set lines [gdb_compile "$srcc $srcs" $exe executable $compile_flags] + + set prefix "" + + if [string match "" $lines] then { + verbose "gdb_target_code_symbol_prefix: returning \".\" prefix" 2 + set prefix "." + } + + file delete $srcc + file delete $srcs + file delete $exe + + return $prefix +} + # gdb_target_symbol returns the provided symbol with the correct prefix -# prepended. (See gdb_target_symbol_prefix, above.) +# prepended. proc gdb_target_symbol { symbol } { - set prefix [gdb_target_symbol_prefix] + set prefix [gdb_target_symbol_prefix][gdb_target_code_symbol_prefix] return "${prefix}${symbol}" } --WIyZ46R2i8wDzkSu--