From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45714 invoked by alias); 12 Jul 2016 13:22:59 -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 45695 invoked by uid 89); 12 Jul 2016 13:22:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=DW_AT_low_pc, DW_AT_name, dw_at_high_pc, dw_at_low_pc X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 12 Jul 2016 13:22:57 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6CDIhn1126687 for ; Tue, 12 Jul 2016 09:22:55 -0400 Received: from e06smtp17.uk.ibm.com (e06smtp17.uk.ibm.com [195.75.94.113]) by mx0a-001b2d01.pphosted.com with ESMTP id 242we1xf6w-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 12 Jul 2016 09:22:54 -0400 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Jul 2016 14:22:52 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 12 Jul 2016 14:22:51 +0100 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: uweigand@de.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id AAFBC17D8056 for ; Tue, 12 Jul 2016 14:24:16 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6CDMolM9503186 for ; Tue, 12 Jul 2016 13:22:50 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6CDMoLh002915 for ; Tue, 12 Jul 2016 07:22:50 -0600 Received: from oc7340732750.ibm.com (dyn-9-152-213-42.boeblingen.de.ibm.com [9.152.213.42]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u6CDMnla002912; Tue, 12 Jul 2016 07:22:50 -0600 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id C26FA3BED; Tue, 12 Jul 2016 15:22:49 +0200 (CEST) Subject: Re: [testsuite patchv2] [ppc64] gdb_target_symbol fix for function descriptors [Re: [testsuite patch] [ppc64] +kfail: gdb_target To: qiyaoltc@gmail.com (Yao Qi) Date: Tue, 12 Jul 2016 13:22:00 -0000 From: "Ulrich Weigand" Cc: jan.kratochvil@redhat.com (Jan Kratochvil), gdb-patches@sourceware.org (gdb-patches@sourceware.org), kevinb@redhat.com (Kevin Buettner) In-Reply-To: from "Yao Qi" at Jul 12, 2016 01:56:36 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071213-0004-0000-0000-00000342C592 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071213-0005-0000-0000-00001AE3A196 Message-Id: <20160712132249.C26FA3BED@oc7340732750.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-12_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607120123 X-SW-Source: 2016-07/txt/msg00127.txt.bz2 Yao Qi wrote: > I am not sure what is the best approach of detecting function descriptor, so > I copy Ulrich. > > I suspect we should check whether the program is compiled with ELFv1, > in which function descriptor is used. So probably, we need to check > __powerpc64__ and (!defined(_CALL_ELF) || _CALL_ELF !=3D 2) instead. Well, most of the gdb.dwarf2 test cases simply use explicitly placed labels for the DW_AT_low_pc / DW_AT_high_pc attributes. See e.g. dw2-unresolved-main.c: asm (".globl cu_text_start"); asm ("cu_text_start:"); int main (void) { [...] } asm (".globl cu_text_end"); asm ("cu_text_end:"); and then in dw2-unresolved.S: /* main */ .uleb128 3 /* Abbrev: DW_TAG_subprogram */ .byte 1 /* DW_AT_decl_file */ .byte 2 /* DW_AT_decl_line */ .ascii "main\0" /* DW_AT_name */ .4byte .Ltype_uchar-.Lcu1_begin /* DW_AT_type */ .4byte cu_text_start /* DW_AT_low_pc */ .4byte cu_text_end /* DW_AT_high_pc */ This is a bit of a hack, but should simply work on both architectures with and without function descriptors. (Also, it actually gives you something to use for DW_AT_high_pc as well, which would be hard to come by otherwise in any case.) If for some reason you want to check programmatically for presence of function descriptors, then I agree that the __powerpc64__ ELFv1 ABI check as you mention above is the correct way to do that. Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com