From patchwork Mon Nov 6 18:50:59 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: 741422 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1254911wrr; Mon, 6 Nov 2023 10:52:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEE1wLmnT3z5TGyT/EbmhmVzFrI/2YYGfdziz6Gdjh3Tly5B0c2tEq49TKMeaoS6ajchdX9 X-Received: by 2002:a9d:7345:0:b0:6b9:b600:589 with SMTP id l5-20020a9d7345000000b006b9b6000589mr32514014otk.15.1699296730224; Mon, 06 Nov 2023 10:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699296730; cv=none; d=google.com; s=arc-20160816; b=0RO9hHqU1f2D+Vb7Nib/TWX/P1n5mwYJFc66dj3utWBeaQo2K6Nj3MfUbPBuDhB3GY OAs643lNtIwGiaca6HBRW4TnN1YjQ7L5k62pq3RX1FtJKBQ3F3oxgbMKisJUoMx8B/DU cjG9U94ymcpAAoeU2ddvF2vrUUqp87A2s1Jn4W+6I/Km2uNmZPy99P2cAh3aMJAJIXQ+ w+Ur/La4uFRRNI9AfUgATCUol2/I30Wgl/hkPJLo+eHSQbMIZksjhM/banNBb7kpZ10q 24FsQAmuFtSVO2FggkcXVtmtCaqu9JNWV8vFL5KxXNkbb77o2RgcntvezPSUKRcg6S12 djSg== 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=eKIvEGRPtMkzzApfKX598M5fxDLEODeKT+ruNJk2aYQ=; fh=QpeTAvHhnTko3wrHMxWRvx4UcZ87hia2zOY3VJVcfak=; b=0a5no26VmmWzd/ZSM/KogrI2cwjEuJIZb65XwKGLpwMB/zGQXpYeHGuwOrgRl+irQS UGLcDq0PVI4wJdhXa2NA9ZEbmxFWME/0tsChCbYUp54UGAknN4Y/6LLeuBfTh+2lsKYx TibS9fCyDuzhtrSAPgPeV5WjdiNUea5lHp1U9Ik1Wk9PmjlbmLqzZBogJ0b5fCo+zWD4 4h03670P2ajH1tl+o602WPHijE4guWtPSrokLd9iwqK4C6Dm/0dpewChGzFhT03veYf4 Riv0lsioxxpAengCBSd8533IeNdAs6mG7wpvHXUACrwTjY79CI1BoBEY6P7lflyD2pTe jHoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QdzrJI+2; 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 z20-20020ac87f94000000b004035dadf9f5si5991504qtj.700.2023.11.06.10.52.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 10:52:10 -0800 (PST) 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=QdzrJI+2; 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 1r04h9-00068v-4d; Mon, 06 Nov 2023 13:51:31 -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 1r04h4-000642-CA for qemu-devel@nongnu.org; Mon, 06 Nov 2023 13:51:26 -0500 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r04gz-0000yo-Lg for qemu-devel@nongnu.org; Mon, 06 Nov 2023 13:51:26 -0500 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c5720a321aso64224871fa.1 for ; Mon, 06 Nov 2023 10:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699296679; x=1699901479; 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=eKIvEGRPtMkzzApfKX598M5fxDLEODeKT+ruNJk2aYQ=; b=QdzrJI+2tPBFPphVtIQeFt1woYqlXwxbcZOJ2wMIszE7gJnUpe9OGI0iGWM2XrLl17 HadXkbgwmnAG0jEBP1+EvDCxZEhy8RaTmvtpx4IK2kt15SiuSTlMEgMZxUDsuvO+O8iH 7sppZ0lzRh7cCxrpqoc8CbIMoxmF9YabwgyNj/4EOEgO2UiaenUThZuUBUSdwk+izUMP k0zSDuyc6g1Fk+ymcqP+hNRraABelNld3uNr0zpdib3p8CA2VrhvT0kZT4nGx9dz5aY9 uiDNs/hXjZKUh2uYwMCjnkMZyPoQdotohQDvhc65q+URMdTKuzWQ8bdkPPkhoq/4i4og nbDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699296679; x=1699901479; 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=eKIvEGRPtMkzzApfKX598M5fxDLEODeKT+ruNJk2aYQ=; b=lYP9oSVsCYHOgVDg/M+fkYaD/RbY6jNtugFdqYYwUnNt5h+aHjmfYl+xuDpnLOjra8 9y3UybMKhb0SZtCu90HXAu6md4QI0FJpjXf4WjsU47I7STEDWk7ErEuvz/WCpFG6YsRl NztQcT9oKdblVuDuzPHkgV7jsymizrNxAtrcEk81t4m3mgoTFlI9kYx1V8VndAvikyQr IEuk+p3kk6ZcDG9NQhl3yORjxDDOAoUztbHDcOsDPc8nKv3mm+nJHyeAA+drpABt5NC6 LmWTERxBAhg/I1xzPvnGGsrHe0jLOEDdkkFHedFeGVqqqPyX3DadGU3mSn2OYbNkXLkA epcg== X-Gm-Message-State: AOJu0Yw46wM5M+7OO5EQq+DalTKlRhuSgXRrkPJ42i7U+biQ9mdWuP4I 8F8NC6G306MARAis2dqOOKcdWQ== X-Received: by 2002:a05:651c:1249:b0:2c4:feef:852 with SMTP id h9-20020a05651c124900b002c4feef0852mr22669392ljh.32.1699296679715; Mon, 06 Nov 2023 10:51:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q24-20020a7bce98000000b0040648217f4fsm12793752wmj.39.2023.11.06.10.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 10:51:15 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 465616575C; Mon, 6 Nov 2023 18:51:13 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= , Mahmoud Mandour , Cleber Rosa , Wainer dos Santos Moschetta , Paolo Bonzini , Thomas Huth , Beraldo Leal , Alexandre Iooss , John Snow , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Chris Wulff , Marek Vasut , Richard Henderson , Akihiko Odaki Subject: [PATCH 09/22] gdbstub: Introduce gdb_find_static_feature() Date: Mon, 6 Nov 2023 18:50:59 +0000 Message-Id: <20231106185112.2755262-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231106185112.2755262-1-alex.bennee@linaro.org> References: <20231106185112.2755262-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x229.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 Message-Id: <20231103195956.1998255-10-alex.bennee@linaro.org> --- 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);