From nobody Wed Nov 27 13:05:32 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1699367381; cv=none; d=zohomail.com; s=zohoarc; b=kgDxGO89F8tpy3vOJpvJDYv6aSN3Rg/kQXqJsN4XAI+3eaU8LzlhSBL4A2ZdVSk5mysxtZeBoaNfzYUGQ2Rsl6vGKby2bukruJq4jFrpqnHEYygxPjbvSReKTkO4TOTMQ765kf8IxNvej5NUwXFgJKLP3MTb/qFNUtClyPYg+to= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699367381; 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:To:To:Message-Id:Reply-To; bh=TCUM1KTtV0lNE+xPv3unN8jBYCV0t3kSWslOuRVU4wE=; b=gL6CucPktgJaq+sNvaK8XVV1ItTU32GLiNwowzZgBiepXEVD8Spkgw875QA2R8VEXbEHJ8ZuPJ8wicWUWT9aQvCkPmaOUk4vaxar54w0D1edHlr/o2y/5c1MMfhaKgC0wC5LQpH8dZ9/RJGyA1szoGrO4L17KW73SjovcIebFdI= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699367381039660.0018509402646; Tue, 7 Nov 2023 06:29:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0N0O-0004Xo-1V; Tue, 07 Nov 2023 09:24:36 -0500 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 1r0Mzv-0004EG-Q8 for qemu-devel@nongnu.org; Tue, 07 Nov 2023 09:24:08 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0Mzt-0007Zq-3Q for qemu-devel@nongnu.org; Tue, 07 Nov 2023 09:24:07 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4084de32db5so49506185e9.0 for ; Tue, 07 Nov 2023 06:24:04 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e22-20020a05600c109600b0040523bef620sm6709710wmd.0.2023.11.07.06.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 06:23:58 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6E4466575F; Tue, 7 Nov 2023 14:23:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699367043; x=1699971843; 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=TCUM1KTtV0lNE+xPv3unN8jBYCV0t3kSWslOuRVU4wE=; b=Bh2YMPwMJ9VvykRZuhJmijisaurKqngaibw903L0mlBYmKvSkBjX4iRdEsW7H56s8W e0qwSDwT2oLXz13nUOGTKOPqUleR6PnUgCp3hH3K2ZgBvN4nm8UWZR9zAzbMdSuCSF5T 1/+cl+9MR1FI15gV+Zeia3LDVtwwgkuOnHS9RZcq534q1IUKvw6/A1o77/0kkyxRJH9Z LtivUpUCe/zkJsYbQZVhu/DE296jNxsKadj3RXuMxRdrKQ6Zwb4QKCFuejlpzLt9Vry7 nnf3kY1TuCYrZJMF+JKkyoydXUNwuWFgDdUacM06lO6RPvPt86QMYOx6DlJZ7FN32kLR 2wnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699367043; x=1699971843; 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=TCUM1KTtV0lNE+xPv3unN8jBYCV0t3kSWslOuRVU4wE=; b=ltdjqQmTCJoNxqvgcOTRFvxIj1G0FHZ0Y8+zss3SlP5FSrpZXKhI1T05q/LkiQFHHA bNf5pb7L/pQAC8iW8kXzZBPVNvV/WUYi2OPVWUQNlTw0scm/ufRMlP2SdPXUXnJYNNJn DFqIli6REzE1ikaTMCUmNs7bbhISvJfsAkHuR50iHqsqTgCA7Vp16FfHCZXtdB0eEkBe 3tLxL4+lNFPoVRxfCE/oywp89Qri5KasyDFaxcVQV7hynzpr5f0yw9/P1JIa/gH1Nqh+ 2heWDTi+bPa0jSc0aq51Wvnxavaa1MN6SDyd/yNvmdDXCeXsRLkRc8Vpvf/I22ndRAQ5 tKcA== X-Gm-Message-State: AOJu0Yz/n092WJJGNb1HtrMysRwp+Yl17fjgkTi+SHkTEhKXdMKZis8M I8BvD3ahcKPYl0qUAu0gwWWoog== X-Google-Smtp-Source: AGHT+IGNGzOHaSt6b31r5NrSrgouRNywPuUkZrufKsro3l21Cc0nuWH8a7g5Rn6/ePcjI3rCNcThDw== X-Received: by 2002:a7b:c5cc:0:b0:404:4b6f:d705 with SMTP id n12-20020a7bc5cc000000b004044b6fd705mr2484239wmk.17.1699367043500; Tue, 07 Nov 2023 06:24:03 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Subject: [PULL 09/23] gdbstub: Introduce gdb_find_static_feature() Date: Tue, 7 Nov 2023 14:23:40 +0000 Message-Id: <20231107142354.3151266-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231107142354.3151266-1-alex.bennee@linaro.org> References: <20231107142354.3151266-1-alex.bennee@linaro.org> 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: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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=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 @linaro.org) X-ZM-MESSAGEID: 1699367382074100008 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=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20231025093128.33116-3-akihiko.odaki@daynix.com> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20231106185112.2755262-10-alex.bennee@linaro.org> 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.39.2