From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57982 invoked by alias); 13 Jul 2018 18:29:42 -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 57943 invoked by uid 89); 13 Jul 2018 18:29:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:1548 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; Fri, 13 Jul 2018 18:29:40 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6DIT19g001419 for ; Fri, 13 Jul 2018 14:29:39 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k6wc8t2e5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 13 Jul 2018 14:29:38 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Jul 2018 12:29:38 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 13 Jul 2018 12:29:36 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6DITXXc8978888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 13 Jul 2018 11:29:33 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDEB67805C; Fri, 13 Jul 2018 12:29:33 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8028C7805F; Fri, 13 Jul 2018 12:29:33 -0600 (MDT) Received: from pedro.localdomain (unknown [9.85.180.127]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 13 Jul 2018 12:29:33 -0600 (MDT) Received: by pedro.localdomain (Postfix, from userid 1000) id BA3553C0472; Fri, 13 Jul 2018 15:29:30 -0300 (-03) From: Pedro Franco de Carvalho To: Ulrich Weigand Cc: gdb-patches@sourceware.org, edjunior@gmail.com Subject: Re: [PATCH 17/17] [PowerPC] Add gdbserver support for EBB and PMU registers In-Reply-To: <20180713164022.7163BD80276@oc3748833570.ibm.com> References: <20180713164022.7163BD80276@oc3748833570.ibm.com> Date: Fri, 13 Jul 2018 18:29:00 -0000 MIME-Version: 1.0 Content-Type: text/plain x-cbid: 18071318-0020-0000-0000-00000E3D8FC9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009364; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01060855; UDB=6.00544581; IPR=6.00838774; MB=3.00022133; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-13 18:29:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071318-0021-0000-0000-000062455A74 Message-Id: <878t6fj8fp.fsf@linux.vnet.ibm.com> X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00425.txt.bz2 Ulrich Weigand writes: > Pedro Franco de Carvalho wrote: > >> +ppc_store_ebbregset (struct regcache *regcache, const void *buf) >> +{ >> + int base; >> + char *regset = (char *) buf; >> + >> + base = find_regno (regcache->tdesc, "bescr"); >> + >> + /* The order in the kernel regset is: EBBRR, EBBHR, BESCR, in our >> + .dat file it is BESCR, EBBHR, EBBRR. */ >> + supply_register (regcache, base, ®set[16]); >> + supply_register (regcache, base + 1, ®set[8]); >> + supply_register (regcache, base + 2, ®set[0]); > > Why do this? Can't we recorder the XML file to make the order > the same, and simplify this routine? > >> + /* The order in the kernel regset is SIAR, SDAR, SIER, MMCR2, MMCR0. >> + In the .dat file is MMCR0, MMCR2, SIAR, SDAR, SIER. */ >> + supply_register (regcache, base, ®set[32]); >> + supply_register (regcache, base + 1, ®set[24]); >> + supply_register (regcache, base + 2, ®set[0]); >> + supply_register (regcache, base + 3, ®set[8]); >> + supply_register (regcache, base + 4, ®set[16]); > > Same here? I wanted to keep the registers in the tdescs in the order they were defined in the isa, since the tdescs are used in common powerpc code (in rs6000_gdbarch_init), and so are the fixed register numbers (in ppc-tdep.h), and the order they appear in the ptrace buffer is specific to Linux. But if this isn't a big deal I can change that to simplify this code. Thanks! -- Pedro Franco de Carvalho