From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106048 invoked by alias); 16 May 2017 15:46:15 -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 105265 invoked by uid 89); 16 May 2017 15:46:15 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:dtd, SYSTEM X-HELO: mail-pg0-f49.google.com Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 May 2017 15:46:13 +0000 Received: by mail-pg0-f49.google.com with SMTP id q125so58940523pgq.2 for ; Tue, 16 May 2017 08:46:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=SuBvvd2iQKTg3l3vIlV+4LbhRa6PlOTGK4WIKVhnH7I=; b=PhZdYWxf6lBOT1qBGhDTix+LtmHeflWW4Nf/N4TmI3yVnMLmSLJPpF9vU7t/IoiK2q J61DSUk/kczfJhdZscPXPMmKbfW8PXz723Qkj9vHnMYnmB7VbbaDVw/XgXoy6qqiD1/q njJJUvFeS/L36/xpJ+ssO2avPeTpOCdytm5/sisN5aG5q/EyYfylywF+oDZDvBqo8loP SHIm2VhtoNnJhfGYeqkqy1bMeULFh9Wc4lv8fs9aoCfB6qJvOpBxr/D2061RySlj7MQ5 f97dRPlSvtD7yg7ypDRqEXi4+P9Am4/vKGIpXXXsdZaab6gm9FstMp2hJe0odYmsuKts qMGw== X-Gm-Message-State: AODbwcB5Xr9Cxl8+fCXlNrhVG4sv6BpeV4JbGS5bex99lEUvIeWdmDeE 4Blju3rTzTzKDA== X-Received: by 10.84.232.3 with SMTP id h3mr16948929plk.42.1494949575238; Tue, 16 May 2017 08:46:15 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id r73sm26232675pfa.65.2017.05.16.08.46.13 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 16 May 2017 08:46:14 -0700 (PDT) From: Yao Qi To: Philipp Rudo Cc: gdb-patches@sourceware.org Subject: Re: [RFC 2/7] Add unit test to builtin tdesc generated by xml References: <1494518105-15412-1-git-send-email-yao.qi@linaro.org> <1494518105-15412-3-git-send-email-yao.qi@linaro.org> <20170516140027.29636db3@ThinkPad> Date: Tue, 16 May 2017 15:46:00 -0000 In-Reply-To: <20170516140027.29636db3@ThinkPad> (Philipp Rudo's message of "Tue, 16 May 2017 14:00:27 +0200") Message-ID: <86a86cajp8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00352.txt.bz2 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 removin= g 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. 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. --=20 Yao (=E9=BD=90=E5=B0=A7)