From nobody Wed Feb 11 02:12:34 2026 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=1692193772; cv=none; d=zohomail.com; s=zohoarc; b=BWHBwkj9lnRiZxkVdphYZ+iQVvq3e8i2hBM/S/HWgDjzNLLJEG+0bVgRPU0Q5MnIO2YS+TaChBTd+aJVofh+X5Cuwp7s7Thxvq7QbaZs1dDfbvENg0kllZLmYv3FoHtT2P7djbRn1OToUgixPJKfrXx78Sg9JOpWjN0sy9g6Rhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692193772; 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=Q7pUOq6IPFvx1k2W2dQWmkO3YzfVeoPk1QwhHtWlA7g=; b=SMXO8EZyrWMxZei/F05o0fiywfnF/SKxWInIsieqkZXCdHwYyM7cWnm/KazDdF5WxhBgje7PlZzAax1HbzKWdFAId7Q3s8aHSZPr2jzSeMzNqNIqv2atxaIZ3Fx3JYigftFZPJUY2VH6rk6Rbb8vcI2YmMHsO0vKoG1lU4zeY+4= 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 1692193772412687.9351062020983; Wed, 16 Aug 2023 06:49:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWGlZ-0004sV-1C; Wed, 16 Aug 2023 09:40:53 -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 1qWGlX-0004r8-HZ for qemu-devel@nongnu.org; Wed, 16 Aug 2023 09:40:51 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWGlU-0000zn-BP for qemu-devel@nongnu.org; Wed, 16 Aug 2023 09:40:51 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-688142a392eso5215368b3a.3 for ; Wed, 16 Aug 2023 06:40:48 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id k3-20020a637b43000000b0056601f864aesm928355pgn.2.2023.08.16.06.40.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 06:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1692193247; x=1692798047; 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=Q7pUOq6IPFvx1k2W2dQWmkO3YzfVeoPk1QwhHtWlA7g=; b=vwCKtoyfrrk42/4HH+3+hSvBoqmzUBm5MLSxVppI2oq2egx0NnB9Vs4S7e+YN1dZZF 2JkO4VguFG0rI04pEkZzQR/GWxBEFdNpY/tjO7CmFIWOFQY7Hw2ABL5oP9iHS1ZV0ARG MQkx05gDzEyY0XHiSQrpE1fgdyw9En/Vzb0/VCZX9kmy7i1AUJR46tNu3GTpXAz2/l/c yIG96kA5Jv2MSkm04324GUE3uFsxejmO/QlNfFJH2wmUpb9jjJjB25sbZRThglVzM06r TLUWu6Ypt7hDdQLDxAE6mbOqo1TRqnX0TfObSg1qXSmGwFXZdswGyUY9b7+sid03ndMO BXrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692193247; x=1692798047; 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=Q7pUOq6IPFvx1k2W2dQWmkO3YzfVeoPk1QwhHtWlA7g=; b=PM9+Ra+nUYbSRzFlGD+5NuzjpeV+XGGsAMig/2yZLPY0eBs+jQFLxYF8OiijsLBAcm uY/EzyHyDZMtvn/qaMOSVic9IkXgep7G+HVAj/Fbxy2d+ADjALLFe/cArvGu7O9SPXDW 2/Ew2xKDcJcS7wSDTi6FGTAJVzrp0uIsENYUibE9EiCig/E8Gc2vdK79NvoFe0SJpuEu CIlpwf76K6ky+PGaHQh3SPgPMKXIiHiMe3z6KRDYDCviqUHO3KPn6DCkguJL11SwbAEV lJTJ/GAQ7tka8d+ENIr8cwnfZc2j6+N35VI5Rb2+pvKo+5GQKIMu7mW63rm3aZn6wVXf 5OuA== X-Gm-Message-State: AOJu0Ywj0Pslb5uc6C2tH/1U66eb14AYLJEP3rRcKN/npS82d0IzZqon hSnyoU1uG6X+1d7/udpTaXW+aw== X-Google-Smtp-Source: AGHT+IF73ab4ODGSTuDdXiRfCqRWNV8FCLniM5IHFM4TtcBfNVUdVkYCHtTIOwZ/arFkLGT/B3a1yg== X-Received: by 2002:a05:6a20:7f8f:b0:134:8d7f:f4d9 with SMTP id d15-20020a056a207f8f00b001348d7ff4d9mr3116593pzj.52.1692193247152; Wed, 16 Aug 2023 06:40:47 -0700 (PDT) From: Akihiko Odaki To: Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Alexandre Iooss , Mahmoud Mandour , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Richard Henderson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=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=20Le=20Goater?= , 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, Anton Kochkov , Akihiko Odaki Subject: [PATCH v3 04/25] gdbstub: Introduce gdb_find_static_feature() Date: Wed, 16 Aug 2023 22:39:14 +0900 Message-ID: <20230816133938.18310-5-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230816133938.18310-1-akihiko.odaki@daynix.com> References: <20230816133938.18310-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::42a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42a.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1692193774319100001 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 --- 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 9b484d7eef..d0dcc99ed4 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -34,6 +34,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 /** diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 2772f07bbe..5829e82073 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -414,6 +414,19 @@ static const char *get_feature_xml(const char *p, cons= t char **newp, return name ? gdb_static_features[i].xml : 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; + } + } + + abort(); +} + static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) { CPUClass *cc =3D CPU_GET_CLASS(cpu); --=20 2.41.0