From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40857 invoked by alias); 25 Jan 2018 16:56:05 -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 40847 invoked by uid 89); 25 Jan 2018 16:56:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 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; Thu, 25 Jan 2018 16:56:04 +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 w0PGtJrq032203 for ; Thu, 25 Jan 2018 11:56:02 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fqjhd9rdm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 25 Jan 2018 11:56:02 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Jan 2018 16:56:00 -0000 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; Thu, 25 Jan 2018 16:55:57 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0PGtv0k49283268; Thu, 25 Jan 2018 16:55:57 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3080E11C04C; Thu, 25 Jan 2018 16:49:33 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0BF1411C04A; Thu, 25 Jan 2018 16:49:33 +0000 (GMT) Received: from ThinkPad (unknown [9.152.212.63]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 25 Jan 2018 16:49:32 +0000 (GMT) Date: Thu, 25 Jan 2018 16:56:00 -0000 From: Philipp Rudo To: Alan Hayward Cc: Yao Qi , "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH v2 6/8] Create xml from target descriptions In-Reply-To: References: <7C97CC6A-92CB-4702-820D-206022F07102@arm.com> <20180125141423.1ff34025@ThinkPad> <86vafqc58o.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 18012516-0040-0000-0000-00000408C94A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012516-0041-0000-0000-0000260C5430 Message-Id: <20180125175556.33b98409@ThinkPad> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-25_07:,, 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-1801250228 X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00537.txt.bz2 On Thu, 25 Jan 2018 16:13:16 +0000 Alan Hayward wrote: > > On 25 Jan 2018, at 13:14, Philipp Rudo wrote: > >=20 > >=20 > > i don't really like print_xml_feature::visit_pre being declared in arch= /tdesc.h > > with different implementations in target-descriptions.c and gdbserver/t= desc.c > > while all other visit_* implementations are in arch/tdesc.c. I would p= refere > > visit_pre being implemented in arch/tdesc.c, too. Even when it means t= o add > > some #ifdef GDBSERVER ... #else ... #endif blocks until there is a comm= on tdesc.=20=20 >=20 > Thanks for the review! >=20 > A common print_xml_feature would require 4 ifdefs, which would be too mes= sy. > I=E2=80=99ll take a look see if I can communise the tdesc_architecture an= d tdesc_osabi > interfaces - it should be fairly simple to do. > Once done, I should be able to add a common print_xml_feature without any > ifdefs. Hopefully. >=20 Having a common interface would be even better :) >=20 > > On 25 Jan 2018, at 15:44, Yao Qi wrote: > >=20 > > Philipp Rudo writes: > >=20=20=20 > >> Same for tdesc_type::make_gdb_type (patch #5). But here i would prefe= r to not > >> even declare the method for GDBserver, i.e. > >>=20 > >> struct tdesc_type > >> { > >>=20 > >> [...] > >>=20 > >> #ifndef GDBSERVER > >> virtual type *make_gdb_type (struct gdbarch *gdbarch) const =3D 0; > >> #endif > >> }; > >>=20 > >> The problem i see with implementing stubs calling error is that you ca= nnot find > >> out you made a mistake until you call the function during run-time. T= his gives > >> room to nasty bugs which could easily be prevented when there is a com= pile bug.=20=20 > >=20 > >=20 > > make_gdb_type and gdbarch shouldn't be put into arch/tdesc.h at all, if > > possible. You can create an sub-class of tdesc_element_visitor in gdb > > side, and create the gdb type by visiting these elements, like this, > >=20 > > class gdb_type_creator : public tdesc_element_visitor=20=20 > =E2=80=A6. >=20 > Nice idea. I can add an extra patch into the series to do this. Yeah, Yao's solution is better than mine. Oh i forgot to tell you, great series. Philipp