From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104804 invoked by alias); 22 May 2018 12:46:46 -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 85355 invoked by uid 89); 22 May 2018 12:39:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=bare, sooner 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 ESMTP; Tue, 22 May 2018 12:39:33 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4MCdRbu013360 for ; Tue, 22 May 2018 08:39:32 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j4g588v1k-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 May 2018 08:39:31 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2018 13:39:29 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 22 May 2018 13:39:28 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4MCdRSN3146208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 22 May 2018 12:39:27 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AC0AAE051; Tue, 22 May 2018 13:28:41 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 796EBAE045; Tue, 22 May 2018 13:28:41 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.77]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 May 2018 13:28:41 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 19099D804DB; Tue, 22 May 2018 14:39:27 +0200 (CEST) Subject: Re: [PATCH 8/8] [PowerPC] Recognize isa205 in linux core files To: pedromfc@linux.vnet.ibm.com (Pedro Franco de Carvalho) Date: Tue, 22 May 2018 12:48:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <87d0xorb8j.fsf@linux.vnet.ibm.com> from "Pedro Franco de Carvalho" at May 21, 2018 05:43:08 PM MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18052212-0040-0000-0000-0000043C8598 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052212-0041-0000-0000-00002641B8B1 Message-Id: <20180522123927.19099D804DB@oc3748833570.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-22_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805220148 X-SW-Source: 2018-05/txt/msg00543.txt.bz2 Pedro Franco de Carvalho wrote: > 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. Right, this is all a bit confused right now and really ought to be cleaned up ... That's something for the future, though. > 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. The latter makes more sense to me. Sooner or later, we want to eliminate most uses of target_stack anyway, so if we are already within target code, that target should be passed to subroutine calls wherever appropriate. > I haven't changed this in v2 yet. I did change how an error is checked > and handled to make it more explicit. Yes, that looks fine for now. > 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. Probably the best solution longer term would be to cache the parameters describing the auxv vector (size of the key, size of the data, byte order) in struct auxv_data, have them determined once per inferior and then re-used. This would also allow removing most of the near-duplicate auxv_parse overloads ... Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com