From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40699 invoked by alias); 17 May 2017 09:09:58 -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 40673 invoked by uid 89); 17 May 2017 09:09:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=neat 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; Wed, 17 May 2017 09:09:56 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4H98pWM046288 for ; Wed, 17 May 2017 05:09:58 -0400 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2agck69x52-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 17 May 2017 05:09:57 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 May 2017 10:09:56 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 17 May 2017 10:09:54 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4H99rqf5964192; Wed, 17 May 2017 09:09:53 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9697D4C046; Wed, 17 May 2017 10:08:36 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7CCB54C04E; Wed, 17 May 2017 10:08:36 +0100 (BST) Received: from ThinkPad (unknown [9.152.212.148]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 17 May 2017 10:08:36 +0100 (BST) Date: Wed, 17 May 2017 09:09:00 -0000 From: Philipp Rudo To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [RFC 2/7] Add unit test to builtin tdesc generated by xml In-Reply-To: <86a86cajp8.fsf@gmail.com> References: <1494518105-15412-1-git-send-email-yao.qi@linaro.org> <1494518105-15412-3-git-send-email-yao.qi@linaro.org> <20170516140027.29636db3@ThinkPad> <86a86cajp8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17051709-0008-0000-0000-0000044AB643 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051709-0009-0000-0000-00001DB5F3DB Message-Id: <20170517110952.0b1fbd10@ThinkPad> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-17_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705170071 X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00376.txt.bz2 Hi Yao, On Tue, 16 May 2017 16:46:11 +0100 Yao Qi wrote: > Philipp Rudo writes: > > Hi Philipp, > Thanks for your comments. > > > The only thing you could have done to make it better is to get rid of the > > conversion to C altogether and create the target description directly by > > parsing the XML file. I don't see a benefit in the conversion and removing > > it would simplify the code even more. But that is a long term goal and > > your patch set definitely helps towards that goal. > > As I described in the commit log, "the reason that we transform xml files > to c files is that GDB is still able to have some target description > without xml parsing support." so that XML parsing is not a hard > requirement for GDB. Nowadays, XML parsing is only used for remote > debugging. In native debugging, GDB just uses these pre-generated > builtin target descriptions, without parsing any XML. Ok, I see my mistake now. I thought XML parsing would always be present. Then the target descriptions could be handled similar to syscalls. But that was clearly focused too much on GDB on Linux. For other systems and GDBserver this needn't necessarily work... Sorry for the mistake. > Suppose XML parsing is always there, at least on Linux host, GDB can > create a big buffer contains various target features in the runtime. We > can do this on top of patch 6/7, like this, (take i386-linux as an > example), > > /* Return a string having XML contents reflecting the right target > description according to XCR0. */ > > std::string > i386_linux_read_description (uint64_t xcr0) > { > std::string buffer; > > buffer.append (""); > buffer.append (""); > buffer.append (""); > buffer.append (" i386"); > buffer.append (" GNU/Linux"); > > if (xcr0 & X86_XSTATE_X87) > { > /* Open 32bit-core.xml and copy its content here. */ > } > > if (xcr0 & X86_XSTATE_SSE) > { > /* Open 32bit-sse.xml and copy its content here. */ > } > > .... > > buffer.append (""); > > return buffer; > } > > Even further, this code can be shared between GDB and GDBserver, so that > GDBserver can compose the XML contents and send it to GDB. Note that > GDBserver doesn't need to parse the XML. That would be neat! Thanks Philipp