From patchwork Tue Dec 5 12:28:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rudo X-Patchwork-Id: 24728 Received: (qmail 37481 invoked by alias); 5 Dec 2017 12:29:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 37365 invoked by uid 89); 5 Dec 2017 12:29:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham 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; Tue, 05 Dec 2017 12:29:21 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vB5CTBVn094828 for ; Tue, 5 Dec 2017 07:29:19 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2entesu95u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 05 Dec 2017 07:29:17 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Dec 2017 12:29:08 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 5 Dec 2017 12:29:05 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vB5CT4nM57278588; Tue, 5 Dec 2017 12:29:04 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87E604C04A; Tue, 5 Dec 2017 12:23:56 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E6CA4C04E; Tue, 5 Dec 2017 12:23:56 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 5 Dec 2017 12:23:56 +0000 (GMT) From: Philipp Rudo To: gdb-patches@sourceware.org Cc: Andreas Arnez , Ulrich Weigand Subject: [PATCH v2 04/11] s390: gdbarch_tdep add field tdesc Date: Tue, 5 Dec 2017 13:28:52 +0100 In-Reply-To: <20171205122859.2919-1-prudo@linux.vnet.ibm.com> References: <20171205122859.2919-1-prudo@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17120512-0040-0000-0000-000004169173 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120512-0041-0000-0000-000020B98834 Message-Id: <20171205122859.2919-5-prudo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-05_04:, , 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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712050180 X-IsSubscribed: yes Add a field for the target description to gdbarch_tdep. This will later be needed to pass the 'correct' target description from osabi_init to gdbarch_init. Unfortunately this cannot be done using gdbarch_info as it is only passed by copy, not reference. gdb/ChangeLog: * s390-linux-tdep.c (gdbarch_tdep) : New field. (s390_gdbarch_tdep_alloc): Adjust. (s390_gdbarch_init): Adjust. --- gdb/s390-linux-tdep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c index afee82304c..caef47a2a4 100644 --- a/gdb/s390-linux-tdep.c +++ b/gdb/s390-linux-tdep.c @@ -100,6 +100,9 @@ enum s390_vector_abi_kind struct gdbarch_tdep { + /* Target description. */ + const struct target_desc *tdesc; + /* ABI version. */ enum s390_abi_kind abi; @@ -7816,6 +7819,8 @@ s390_gdbarch_tdep_alloc () { struct gdbarch_tdep *tdep = XCNEW (struct gdbarch_tdep); + tdep->tdesc = NULL; + tdep->abi = ABI_NONE; tdep->vector_abi = S390_VECTOR_ABI_NONE; @@ -7882,6 +7887,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) else tdesc = tdesc_s390x_linux64; } + tdep->tdesc = tdesc; /* Check any target description for validity. */ if (tdesc_has_registers (tdesc)) @@ -8124,7 +8130,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ax_pseudo_register_push_stack (gdbarch, s390_ax_pseudo_register_push_stack); set_gdbarch_gen_return_address (gdbarch, s390_gen_return_address); - tdesc_use_registers (gdbarch, tdesc, tdesc_data); + tdesc_use_registers (gdbarch, tdep->tdesc, tdesc_data); set_gdbarch_register_name (gdbarch, s390_register_name); /* Assign pseudo register numbers. */