From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30582 invoked by alias); 20 Jun 2017 14:07: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 30565 invoked by uid 89); 20 Jun 2017 14:07:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static. X-HELO: mail-io0-f178.google.com Received: from mail-io0-f178.google.com (HELO mail-io0-f178.google.com) (209.85.223.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Jun 2017 14:07:39 +0000 Received: by mail-io0-f178.google.com with SMTP id k93so85208159ioi.2 for ; Tue, 20 Jun 2017 07:07:39 -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=2SieDOM6y+qf7Qqs0ZCvvbjqLbZj+SBOjB8JHOYwFxg=; b=mKjhivHfgEAk1C7vuNzRcI4bDprKIPmB/XWyBuu9O4inDXJsONzXpZ7O9DhcskgKkG c2IGtjjmRxNnMvLyzzEcFYbOHCOE68zTk4tnYS4iZzeq1SbB4ViPneuQXwr6R8o56jaG xiMxnj6azpQ1dCSp5J2pm0EAS7E8NXlutt3xrmByoJf5Sr8bBJd2zGSNzytDA/xnKHeJ GL8pEavxBOb8v3cvY461ceO7b5xM0Tks2lRzdcGYNmO6xzDZddHg/ICQKQ2xGJMl1buM MQrQsV98R8KiTxXedQ10m0OUv6PACoe+4vtPlPJZg7vagMrZUWBcKJU1sZ314v6SnbRW LLkw== X-Gm-Message-State: AKS2vOyeD6VTwWkAkd3JHbe4pPhA6salRfqoOyLOmrLIx84rGI8BaopV v3m9/97wr7hYNyYD X-Received: by 10.107.128.84 with SMTP id b81mr25420668iod.26.1497967657938; Tue, 20 Jun 2017 07:07:37 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id b70sm7906048ioe.57.2017.06.20.07.07.36 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 20 Jun 2017 07:07:37 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 07/25] Lazily and dynamically create i386-linux target descriptions References: <1497256916-4958-1-git-send-email-yao.qi@linaro.org> <1497256916-4958-8-git-send-email-yao.qi@linaro.org> Date: Tue, 20 Jun 2017 14:07:00 -0000 In-Reply-To: (Pedro Alves's message of "Tue, 20 Jun 2017 12:01:23 +0100") Message-ID: <86k2464us8.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-06/txt/msg00574.txt.bz2 Pedro Alves writes: > I don't see the unit test in the patch. > It is moved to patch 08/25. > Can you say something about the "regnum =3D %ld" change? Is it > related to the rest of the patch? > Without this change, the lazily generated tdesc doesn't equal to the original pre-generated tdesc if the register has regnum attribute, like most of the reg doesn't have "regnum" attribute so the number is allocated sequentially. If the reg has "regnum", it explicitly set the register number. I'll rewrite the commit log this way, Instead of using pre-generated target descriptions, this patch changes GDB to lazily and dynamically create target descriptions according to the target hardware capability (xcr0 in i386). This support any combination of target features. Some reg in XML target description has attribute "regnum" which set the register number explicitly rather than using the sequentially allocated number, In order to handle this, this patch also changes the visitor to print the code to set regnum when reg has attribute "regnum". 2017-06-20 Yao Qi * i386-linux-tdep.c: Don't include features/i386/i386-XXX-linux.c. include features/i386/32bit-XXX.c instead. (i386_linux_read_description): Generate target description if it doesn't exist. * target-descriptions.c (print_c_tdesc::visit): Print code to set regnum. (print_c_tdesc) : New field. * features/i386/32bit-linux.c: Regenerated. * features/i386/32bit-sse.c: Regenerated. >>=20 >> 2017-04-27 Yao Qi >>=20 >> * i386-linux-tdep.c (i386_linux_read_description): Generate >> target description if it doesn't exist. >> [GDB_SELF_TEST] (i386_linux_read_description_test): New unit tes= t. >> (_initialize_i386_linux_tdep) [GDB_SELF_TEST]: Register unit tes= t. > > Leading TAB vs spaces. > These two lines should be removed. >> +private: >> + /* The register number to use for the next register we see. */ >> + int next_regnum =3D 0; >> }; > > "m_" prefix. I'll fix it. --=20 Yao (=E9=BD=90=E5=B0=A7)