From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8104 invoked by alias); 21 May 2018 20:43:18 -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 7507 invoked by uid 89); 21 May 2018 20:43:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 May 2018 20:43:16 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4LKdAUQ044147 for ; Mon, 21 May 2018 16:43:14 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2j41aghfay-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 May 2018 16:43:14 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 May 2018 16:43:13 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 21 May 2018 16:43:12 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4LKhA1D57344176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 May 2018 20:43:10 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C43C0112065; Mon, 21 May 2018 16:43:15 -0400 (EDT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A26C7112062; Mon, 21 May 2018 16:43:15 -0400 (EDT) Received: from pedro.localdomain (unknown [9.18.235.153]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 21 May 2018 16:43:15 -0400 (EDT) Received: by pedro.localdomain (Postfix, from userid 1000) id 5498E3C03BA; Mon, 21 May 2018 17:43:08 -0300 (-03) From: Pedro Franco de Carvalho To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 8/8] [PowerPC] Recognize isa205 in linux core files In-Reply-To: <20180517082239.B7DD3D802CA@oc3748833570.ibm.com> References: <20180517082239.B7DD3D802CA@oc3748833570.ibm.com> Date: Mon, 21 May 2018 20:46:00 -0000 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18052120-0056-0000-0000-00000451B696 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009062; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000261; SDB=6.01035686; UDB=6.00529760; IPR=6.00814815; MB=3.00021228; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-21 20:43:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052120-0057-0000-0000-00000895D15D Message-Id: <87d0xorb8j.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-21_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805210245 X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00508.txt.bz2 Ulrich Weigand writes: > Pedro Franco de Carvalho wrote: >> Ulrich Weigand writes: >> >> > Maybe this routine should now be moved to ppc-linux-tdep.c ... >> > >> >> + CORE_ADDR hwcap = 0; >> >> + >> >> + target_auxv_search (target, AT_HWCAP, &hwcap); >> >> + >> >> + features.isa205 = ppc_linux_has_isa205 (hwcap); >> > >> > ... so it can be reused here? >> > >> > Otherwise this looks OK to me. >> >> Should the routine take a struct target_ops * parameter, so that >> core_read_description can pass its target (for calling >> target_auxv_search)? In this case all the calls in ppc_linux_nat.c would >> also have to be updated. > > Right, I guess that makes sense. > > (Another question is why ppp-linux-nat.c repeats this call all the > time, maybe it would be better to cache the result per inferior ... > But that's certainly a separate issue.) Now I'm confused as to which target should be passed to target_auxv_search. It uses the target parameter for reading the auxv data but then it calls target_auxv_parse through the global target_stack. Should ppc-linux-tdep also also pass target_stack in core_read_description, for consistency? Or should ppc-linux-nat be changed to pass "this"? I can do this either by moving ppc_linux_get_hwcap to ppc-linux-tdep.c and adding a target parameter, and then change all the call sites in ppc-linux-nat.c, or I can make ppc_linux_get_hwcap a private method of ppc_linux_nat_target and pass "this" inside it (which wouldn't require changing the call sites), and leave the bare call to target_auxv_search in ppc-linux-tdep.c. I haven't changed this in v2 yet. I did change how an error is checked and handled to make it more explicit. And it turns out that target_auxv_search already caches the whole auxv for each inferior. This part could still be improved because ppc_linux_nat_target::auxv_parse calls ppc_linux_target_wordsize (which issues a ptrace call) a second time, and at the point were it is called the wordsize is already known, but it's not clear how to pass the wordsize to auxv_parse in read_description. Thanks! Pedro