From nobody Mon Sep 16 20:01:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1694851563; cv=none; d=zohomail.com; s=zohoarc; b=NIfSFHpb1rDWWniaolmfSVJF26cDenfgOPYfVUKhXRLwW7kvwsEfcRczYFasZHMPCGaKpzbI9d5iGrwkMZ1ZOWYSfV7cpruP9K8RkGwsS4vRy1G+FpoIdTQlssKlVwdOpdSy878wjo+mmJ8aN4Q3hSizFN//1iIm1hyUFMx0i2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694851563; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=Tnf03Q7+288TJsyd7lSqF33vPvOy+ywzsBcRMgBbA/w=; b=hQZ89Z26GF0/C18yXqBEf2CyI28we+FLI1+s4uKy8FCdNSOVnvEZwbTx5F71NW0uzbzE04eT33uNBU72DQcguQ2nvWlNMOSEKLo/lpXRiyeO82596onw4wJTYObJruQLQanOP4Ux/wWZ7MKz7uoWpsYqHISJZXfJTjm3uQZbU+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694851563136580.3120750536311; Sat, 16 Sep 2023 01:06:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhQG3-0003DG-H5; Sat, 16 Sep 2023 04:02:27 -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 1qhQFy-0003CD-Fe for qemu-devel@nongnu.org; Sat, 16 Sep 2023 04:02:25 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhQFw-0005yC-Gq for qemu-devel@nongnu.org; Sat, 16 Sep 2023 04:02:21 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68fbb10dec7so2651542b3a.3 for ; Sat, 16 Sep 2023 01:02:20 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id z21-20020aa791d5000000b0068a46cd4120sm4029484pfa.199.2023.09.16.01.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 01:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1694851339; x=1695456139; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tnf03Q7+288TJsyd7lSqF33vPvOy+ywzsBcRMgBbA/w=; b=vm4AFZzb5KvicQXETQ4tsqDN8UtvnmLkT4jY0DKLzfuLjeI90iLvV7rO82GYe4Wgyo k7WhR1YH1Dk3eSSiQfLs29cQzFKLDLPs/1PaPbAmxL++KqklH9rMpZSEz7jIfhF+I7jI c4itAyzOv5v4//wNPCdu+q1w2ygbDQ2VJXb8vpYXo9GykFXCZ/mI+ROZ2u4nUtRJfmlk ArYuvJ9mTVAbV8Egf1+H3FIKkCENPN33ps7Ve//hjQ2rvACJoMfbU9cR4LbiPq6+PS4M gQADStUDVN/LD86Doce6v67aMmJqRp50IYK+OgSa3b/nAe6B9MFlW0mOTOBp5+ZlWH1B OfSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694851339; x=1695456139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tnf03Q7+288TJsyd7lSqF33vPvOy+ywzsBcRMgBbA/w=; b=KD/57abey0YMDVoyxBAFFA6QbO3GyZTht26v964bAel9GtAmPCntJlhP3uVxRkKSOK PZiFPB++bOJFO1ggLqxv3K5g3lrjrTzZoea24PP4pE6tB5EpKbW/3I/X3nUFA/e1HTj5 LSYqaRvKEYnzHyk3Co4bY8AsTWt+Mz0mRR0AP4Vw96ohx3+/cF+Pcg4eXlUzh0uVN1cU brsDLj/wUaoYW6P2vQmAAAmgiKQkk1U+cbdcDhWomWIJ4cRB/cJMWGrZqQ8amROCEtLC 1Y/aQtE445KR8YB+hAgYsD0mJFauWztA9hS+GgtMsOOY4AHdpITGRTHw690UpF/yP6lG ZOSg== X-Gm-Message-State: AOJu0YyUv9jwA5+ZeOOVPkWRv08rPGfM0I3o7Rdg4LBHCp2s+VAK58AV 4lbiwspVW9iwIrazvdnFUVRhJnjFcFh6eWAPgjY= X-Google-Smtp-Source: AGHT+IG5ylxptxqrsqMDXDxOX5FX2lPnsuYBAo9rVpjiC8hcbcg1obJnCwHBwkcdrMC6mKnoAJx9Rg== X-Received: by 2002:a05:6a20:3d1d:b0:131:f504:a631 with SMTP id y29-20020a056a203d1d00b00131f504a631mr4703700pzi.51.1694851339293; Sat, 16 Sep 2023 01:02:19 -0700 (PDT) From: Akihiko Odaki To: Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Mikhail Tyutin , Aleksandr Anenkov , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Akihiko Odaki , Richard Henderson Subject: [PATCH v8 02/19] gdbstub: Introduce gdb_find_static_feature() Date: Sat, 16 Sep 2023 17:01:19 +0900 Message-ID: <20230916080149.129989-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230916080149.129989-1-akihiko.odaki@daynix.com> References: <20230916080149.129989-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1694851564474100001 This function is useful to determine the number of registers exposed to GDB from the XML name. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 2 ++ gdbstub/gdbstub.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index a43aa34dad..071021415a 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -44,6 +44,8 @@ void gdb_register_coprocessor(CPUState *cpu, */ int gdbserver_start(const char *port_or_device); =20 +const GDBFeature *gdb_find_static_feature(const char *xmlname); + void gdb_set_stop_cpu(CPUState *cpu); =20 /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 9810d15278..fd73d6d257 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -420,6 +420,19 @@ static const char *get_feature_xml(const char *p, cons= t char **newp, return NULL; } =20 +const GDBFeature *gdb_find_static_feature(const char *xmlname) +{ + const GDBFeature *feature; + + for (feature =3D gdb_static_features; feature->xmlname; feature++) { + if (!strcmp(feature->xmlname, xmlname)) { + return feature; + } + } + + g_assert_not_reached(); +} + static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) { CPUClass *cc =3D CPU_GET_CLASS(cpu); --=20 2.42.0