From nobody Thu Jan 1 07:24:04 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=1698226351; cv=none; d=zohomail.com; s=zohoarc; b=cq6Ba4n+IEk4JxaKqEzAs+VFQHVmOwE9bRRp3F2v+4JYonXoHF5RCqpDqYn+b9SmtToHUiesmHHnCqQFEn5REDKD099RjaiTiNjkVYhXO0xqI3lIUC5Ig+yRbnmVwzx8k8xDNkffDhMdGkDtoMxs6RbhsSiqDm9dI7LFQlAU4eo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698226351; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:Message-Id:Reply-To:To; bh=HmquHc4fVmtSSJQpb3DzKUGsBKKZi/AhuKxsiBAYgxY=; b=RRknQEIe48aCVF8paSwyvs547idYdK5SZQF7LDiDuoLywhmyG6ydvD/0X2HiXHv92qTE1jZZbUGVpZ6TIIxS+xELIj6iL1KbOMBHxCsiX5TXZF1cL9r9jY8gjS68HCWE1CMnKs1LAeC0KbJOmBljH8ZeA/x1VqvRdXlQ3VE3u/U= 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 1698226351012252.0405379154862; Wed, 25 Oct 2023 02:32:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvaFF-0002Fy-Df; Wed, 25 Oct 2023 05:32:09 -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 1qvaEv-0001mc-Jp for qemu-devel@nongnu.org; Wed, 25 Oct 2023 05:31:50 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvaEu-0002Bi-1b for qemu-devel@nongnu.org; Wed, 25 Oct 2023 05:31:49 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5a9bc2ec556so3543829a12.0 for ; Wed, 25 Oct 2023 02:31:47 -0700 (PDT) Received: from localhost ([157.82.205.15]) by smtp.gmail.com with UTF8SMTPSA id b12-20020a17090acc0c00b0027d12b1e29dsm10103577pju.25.2023.10.25.02.31.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 02:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1698226307; x=1698831107; 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=HmquHc4fVmtSSJQpb3DzKUGsBKKZi/AhuKxsiBAYgxY=; b=NGsX15M9dkjKgLloypgWesCYGZCLwtN89250LHovMft2fFiFF2H+RS8DOFtvcNQQmu 9TZ8QA01MH/Q7R8uFmKcy22y8bj6jErchyppIiQn5qqVVVnbC+l+eos9VX5Mdj7gBLV5 JsW4S+PGqvCLo0VDUFGexRDeo0IPqut1rEX3RdxEDMXVXEW1VtZOuNLMmtaG8QQiOo0O necLZ/Txg4TddFmESBTcblBpJsHQyU4srjwHuY8cJqky3D7+CgFbrN6ESmRFdEN8MCDW mZFYOKAxrJvxAd0Y4DigIArXz8nRdW44zsWoWpNghDyY4nV4lXMTfiF0MH9HKqo5E5k5 Pe1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698226307; x=1698831107; 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=HmquHc4fVmtSSJQpb3DzKUGsBKKZi/AhuKxsiBAYgxY=; b=uWe+eKqT4qrn2scTSzm2e+beAEX8rAz53m5P47hmIKD6kLirf037D870XE//3fcv+1 21NTLNbxLxC4U4lbc4yxipEjD0j7AWMV9I/Qk5szcjqOlL74vi9pTbRLBRv3niLMN1y4 i3e71SVULXfvVaY7voBHlCKN5VQ5IJmtgpH6OvYjreI+iDXGKN74qcfJwvjFxqwmqFnD uyI+tsa/thl8Ycm9UIU3l6n8GiTSzztEJE3JF5GpKScEbOPd6hcSmTPjD1ZYjeR0NHV/ v45z8HJKNlYuYMR7E83SBg00Hcfw7zOSp1hFpFztfUOURr9br9nkOOdQYjmNzQsEJtVY MgsQ== X-Gm-Message-State: AOJu0Yx4HUQjRf27ogpGRPI5fauw+ysbgNLSK706iN7jebVy9nH0z2lo CszOgTGb0ntTSgGWabEUriMwjw== X-Google-Smtp-Source: AGHT+IE0wPq2K7X9cDn3TwEEUJLfzCVu35dJusX3AIf7qe8wUpVTwrGTllakO6HJE6ofnEvK0j4B6Q== X-Received: by 2002:a17:90a:4985:b0:27d:7666:9596 with SMTP id d5-20020a17090a498500b0027d76669596mr11593294pjh.11.1698226306832; Wed, 25 Oct 2023 02:31:46 -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 v16 02/18] gdbstub: Introduce gdb_find_static_feature() Date: Wed, 25 Oct 2023 18:31:02 +0900 Message-ID: <20231025093128.33116-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231025093128.33116-1-akihiko.odaki@daynix.com> References: <20231025093128.33116-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::534; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x534.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: 1698226352575100003 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 | 8 ++++++++ gdbstub/gdbstub.c | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index a43aa34dad..7fe00506c7 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -44,6 +44,14 @@ void gdb_register_coprocessor(CPUState *cpu, */ int gdbserver_start(const char *port_or_device); =20 +/** + * gdb_find_static_feature() - Find a static feature. + * @xmlname: The name of the XML. + * + * Return: The static feature. + */ +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 29540a0284..ae24c4848f 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -422,6 +422,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