From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81C13C001DE for ; Mon, 31 Jul 2023 13:52:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQTJb-0004Q5-HK; Mon, 31 Jul 2023 09:52:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQTJU-0004OI-HS for qemu-devel@nongnu.org; Mon, 31 Jul 2023 09:51:57 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qQTJR-0002tp-Au for qemu-devel@nongnu.org; Mon, 31 Jul 2023 09:51:56 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fe1e1142caso13576035e9.0 for ; Mon, 31 Jul 2023 06:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690811511; x=1691416311; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9C61sNBuLzkP1k7MRGfWxhB6WPJh2Tq71aTnep3VwTY=; b=hgL3LJ4UbBI66bG/QiBth9eUNg5I+oqxWFsmTMTz1CCwJSbu61BSpk0r/IdaOeHuka Gx3C7ghuD3CaQffRhxbvAaISlraH7FmeBl4U/lvb2m6BnJQwHjazCPFTJvbCpgKahCbZ 0BGtLzVHJ21k4/pyfYFYH0Na+Abts0XOdUYIZqMreN17bT5DnMsMdxAZbUkAYKwQxKDl fZlUFoAkHd1QbHHDGDWPHgKT2HRtJsEkUIbJ5eH0KGP1FyzfSuZwfTGPAy11imywQxbH qCLJBGB09vPQZWLgHMIFdpBumwCCTuqxcJKIlnVnuIqzPFY+hXkQYxvCbnRH363Tgp9s l9zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690811511; x=1691416311; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9C61sNBuLzkP1k7MRGfWxhB6WPJh2Tq71aTnep3VwTY=; b=S7xP5UnGq0AKiWnSybp9bTewCq05dj0/bRuQD/NnPJO5GenTLJs+velYL9cYq51rd9 iqU2/3adfKvSGR5erp0sTbrKyjtcxYuYihVS9QdnQ+Z0G/ZOkXrnbQ+SdHKQlN5c7cUh 6UJyxleiKaS2PbmMwrtbpoN3uhBlfOTwePfUuzhhocqQbVfhTtgotshPA04bXSZ921og nq3+xY4fBJ5QZQgxnSEQeIAWOWmJS1pveJ9RiRKKO5zOvA122RvuPqY/+WccSxbljU4G GEsfOacvlZ8OA6dXCVXHrzhLXjmW0vDWYsCMknPFTR/wy7JEW+VJ4LngCLuWdk6kBYh3 pBkw== X-Gm-Message-State: ABy/qLato7c934BP9nMe5XUb0UkpA4Q7dZgEaHCewMYw/9CWRNe8EDpc Oi0TR0TpYgWpXnT3YLqL+OvCVA== X-Google-Smtp-Source: APBJJlHILCBJRNZrn5crmer00CWRWg2FEycLAoJ3X2ChQegv8+/byit6ZlNXsw37noTTEhadIYXccw== X-Received: by 2002:adf:ef05:0:b0:315:8f4f:81b8 with SMTP id e5-20020adfef05000000b003158f4f81b8mr8322326wro.50.1690811511118; Mon, 31 Jul 2023 06:51:51 -0700 (PDT) Received: from [192.168.69.115] ([176.187.198.42]) by smtp.gmail.com with ESMTPSA id h4-20020adffa84000000b0031417fd473csm13249602wrr.78.2023.07.31.06.51.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jul 2023 06:51:50 -0700 (PDT) Message-ID: Date: Mon, 31 Jul 2023 15:51:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC PATCH 02/24] gdbstub: Introduce GDBFeature structure Content-Language: en-US To: Akihiko Odaki Cc: Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Thomas Huth , Alexandre Iooss , Mahmoud Mandour , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Richard Henderson , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , John Snow , Cleber Rosa , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Xiaojuan Yang , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Stafford Horne , Daniel Henrique Barboza , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , David Gibson , Greg Kurz , Nicholas Piggin , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei , Yoshinori Sato , David Hildenbrand , Ilya Leoshkevich , Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , Max Filippov , qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org References: <20230731084354.115015-1-akihiko.odaki@daynix.com> <20230731084354.115015-3-akihiko.odaki@daynix.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20230731084354.115015-3-akihiko.odaki@daynix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.101, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On 31/7/23 10:43, Akihiko Odaki wrote: > Before this change, the information from a XML file was stored in an > array that is not descriptive. Introduce a dedicated structure type to > make it easier to understand and to extend with more fields. > > Signed-off-by: Akihiko Odaki > --- > MAINTAINERS | 2 +- > meson.build | 2 +- > include/exec/gdbstub.h | 9 ++++-- > gdbstub/gdbstub.c | 4 +-- > stubs/gdbstub.c | 6 ++-- > scripts/feature_to_c.py | 44 ++++++++++++++++++++++++++ > scripts/feature_to_c.sh | 69 ----------------------------------------- > 7 files changed, 58 insertions(+), 78 deletions(-) > create mode 100755 scripts/feature_to_c.py > delete mode 100644 scripts/feature_to_c.sh > diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h > index 7d743fe1e9..bd5bc91dda 100644 > --- a/include/exec/gdbstub.h > +++ b/include/exec/gdbstub.h > @@ -10,6 +10,11 @@ > #define GDB_WATCHPOINT_READ 3 > #define GDB_WATCHPOINT_ACCESS 4 > > +typedef struct GDBFeature { > + const char *xmlname; > + const char *xml; > +} GDBFeature; > + > > /* Get or set a register. Returns the size of the register. */ > typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); > @@ -38,7 +43,7 @@ void gdb_set_stop_cpu(CPUState *cpu); > */ > extern bool gdb_has_xml; > > -/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */ > -extern const char *const xml_builtin[][2]; > +/* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ > +extern const GDBFeature gdb_features[]; Maybe clearer named gdb_static_features[].