From patchwork Fri Nov 3 19:59:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 740706 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp8056wrr; Fri, 3 Nov 2023 13:02:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJDcYw9oXHJnknj22/UpOQD9QCVlxx96cuE6p0PrIgcSBlk+E8eC6k4K+xmLc8FedCTsHr X-Received: by 2002:a05:6214:2b97:b0:66d:9f09:b69c with SMTP id kr23-20020a0562142b9700b0066d9f09b69cmr21052970qvb.29.1699041741554; Fri, 03 Nov 2023 13:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699041741; cv=none; d=google.com; s=arc-20160816; b=Vjc4zaxXt5E8vjY9DIRnxVxDrr590kf5GVi7//fyBKC7WvI9vd6KNyckCga/lM0Fep wg+Vt0iAT01jswyOMEZbhOj+IhwsbVdEb23DrMKOxgnvg3pFEvhsghMIZzhcWQJYihkM yUf63CPEOQRRERfAMfU6VODLKbUoRj/ATNF8sDvObtafleXT337QULov7OKKkfAf/4rc el+affzJ+Mj3y+uG9/hO2ae0UIeNaT50mS/DHsgEE8KjQ6oxe2pCjVo4+Gamvm52ISfZ XS5/ihYBNS7r0xkVJDCFmSKYU2PxWLnrnPHc+aRKo3PME8i/1wtHJeURNpD/JB+tpfOl eiYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ghs3EgBAGw158emkMP9920C3Uw5NjJncCpRRWZMRiCQ=; fh=+DJyABPrPOszaX8covAxj8Yhupz9POTwrYeebio0HgM=; b=y7QwbLsaeK1flh3S/QTUuTGwI8sCXWGI9BzMSJ/v6kG9Hgd7lrv5JfuagAWt4JVq8R lmZYPL28V3GSPKDejzgKYuEk5LfadWtEKixOYXOCJsavkaJgrDDXl9dUeZ/jWWhC6V1x b7hp9swl0550AUXkj1c3hArSdO0gdaOj4C0KWmsPT+SmZtYnPANCMcUr+TJmHcBXanVQ ylJhAiE7SDygLUj7Kiwcr4XQinPCdR1c/UmpJIUPwpWq03VUx9XFrOyrPSjpllAt8sUA V/EDTgklUJgCNdhTpR/2fRgdIcfwHrRzICwEmefxgSJXNFYn/XKUFkQNxSc8qfG5xXUo I/Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iJZ+yODm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p8-20020a0cfd88000000b0065b176ed459si1925622qvr.154.2023.11.03.13.02.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2023 13:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iJZ+yODm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qz0LT-0008Py-Dt; Fri, 03 Nov 2023 16:00:45 -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 1qz0L3-00089i-4F for qemu-devel@nongnu.org; Fri, 03 Nov 2023 16:00:18 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qz0Kt-0005a8-Eb for qemu-devel@nongnu.org; Fri, 03 Nov 2023 16:00:16 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-407c3adef8eso21016705e9.2 for ; Fri, 03 Nov 2023 13:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699041605; x=1699646405; 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=Ghs3EgBAGw158emkMP9920C3Uw5NjJncCpRRWZMRiCQ=; b=iJZ+yODmPaQB8LDfiQvHfif/WjF9FNaf0fXu6oYTXhBe7Flp1gXIeNSNp2G7cZXtBL oofsNV41BKwNkZCyRDx0UGJRn8bQlvkvNDIYtEH1hwXaqv+taQEzP2jP4KdPGNRIX50g iJcCbXo+2sGctHh0NRCy4VZDbL05F1ZalTqVjbp+ZeBcBJ921X4VxmLnPzxmr1NVOgUp tWRzHaicZgTCLUu2He/s9m3O/G8FQrIaJFr1syHOTOm+5qbkD+Vf4mXQlTveAdr5RXj3 JtPRtbvKUeHcnuuDCM75HCdch0uIko7Q3w/C4vqk/r9d0vlCsm3IE8JyUvHDEl+Xli3q cUrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699041605; x=1699646405; 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=Ghs3EgBAGw158emkMP9920C3Uw5NjJncCpRRWZMRiCQ=; b=ufnjM59S45xmWqHYXkslZ2yPZMFPp6sByugdbBrW7mzFXPJT1qHFZ8jQ/CMFNn1XRR wI2zMi8yXD8z1DLhGkoPJpypGuB8PiBZK2dPxZwv/E5hYZx4pt70FOlKK79skMKSLt4r Matzw5ZKKx71h87KAN34JizkGmf/4D1t/ml7NpkvxhSW73bN5VJNlByps9+Odzl22uUR oV61KJSaNjr+sTshtECRtP+6bxCNV0seO8ER2OiR8lvcYZhXiOeFmN50pVb/yZXSN/h8 bGe6iiiorReLK03LepUEwrWIgPUaYKkOKyeiC3z6zjVnVBb3OPKuz/J2DGOaA0erNpT7 9dkw== X-Gm-Message-State: AOJu0YzJTq3ea11Mc33721IDKz1TJhujRJ4AOMKIZgDNn5H5bkGDBypJ 1J0fkUilVk+eA/5wnIqsc4OU+Q== X-Received: by 2002:adf:e312:0:b0:31a:d4e4:4f63 with SMTP id b18-20020adfe312000000b0031ad4e44f63mr14339234wrj.18.1699041605580; Fri, 03 Nov 2023 13:00:05 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o25-20020a5d58d9000000b0032db430fb9bsm2584236wrf.68.2023.11.03.12.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 13:00:00 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8A23765748; Fri, 3 Nov 2023 19:59:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , "Edgar E. Iglesias" , Song Gao , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Wainer dos Santos Moschetta , Weiwei Li , Marcel Apfelbaum , Ilya Leoshkevich , Daniel Henrique Barboza , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?C=C3=A9dri?= =?utf-8?q?c_Le_Goater?= , Paolo Bonzini , David Hildenbrand , Brian Cain , qemu-ppc@nongnu.org, Palmer Dabbelt , qemu-riscv@nongnu.org, Eduardo Habkost , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Liu Zhiwei , Cleber Rosa , qemu-s390x@nongnu.org, Laurent Vivier , Yoshinori Sato , Nicholas Piggin , Thomas Huth , John Snow , Alexandre Iooss , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Mahmoud Mandour , Daniel Henrique Barboza , Bin Meng , Beraldo Leal , Richard Henderson , Michael Rolnik , Akihiko Odaki Subject: [PATCH 09/29] gdbstub: Introduce gdb_find_static_feature() Date: Fri, 3 Nov 2023 19:59:36 +0000 Message-Id: <20231103195956.1998255-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231103195956.1998255-1-alex.bennee@linaro.org> References: <20231103195956.1998255-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki 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é Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20231025093128.33116-3-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée --- 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); +/** + * 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); /* 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, const char **newp, return NULL; } +const GDBFeature *gdb_find_static_feature(const char *xmlname) +{ + const GDBFeature *feature; + + for (feature = 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 = CPU_GET_CLASS(cpu);