From: Stephan Rohr <stephan.rohr@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/1] gdb: Add functionality to disable test for specific architecture
Date: Thu, 23 Feb 2023 15:18:15 +0100 [thread overview]
Message-ID: <20230223141815.996942-2-stephan.rohr@intel.com> (raw)
In-Reply-To: <20230223141815.996942-1-stephan.rohr@intel.com>
From: "Rohr, Stephan" <stephan.rohr@intel.com>
A set of not supported architectures can be provided to the
'register_test_for_earch_arch' function such that this test
is skipped for all architectures contained in this set.
---
gdb/selftest-arch.c | 11 ++++++++---
gdb/selftest-arch.h | 5 ++++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/gdb/selftest-arch.c b/gdb/selftest-arch.c
index 691c40c14d7..d8fe49a1859 100644
--- a/gdb/selftest-arch.c
+++ b/gdb/selftest-arch.c
@@ -47,7 +47,8 @@ static bool skip_arch (const char *arch)
static std::vector<selftest>
foreach_arch_test_generator (const std::string &name,
- self_test_foreach_arch_function *function)
+ self_test_foreach_arch_function *function,
+ const std::set<std::string> &disabled_arch)
{
std::vector<selftest> tests;
std::vector<const char *> arches = gdbarch_printable_names ();
@@ -57,6 +58,9 @@ foreach_arch_test_generator (const std::string &name,
if (skip_arch (arch))
continue;
+ if (disabled_arch.count (arch) > 0)
+ continue;
+
struct gdbarch_info info;
info.bfd_arch_info = bfd_scan_arch (arch);
info.osabi = GDB_OSABI_NONE;
@@ -96,11 +100,12 @@ foreach_arch_test_generator (const std::string &name,
void
register_test_foreach_arch (const std::string &name,
- self_test_foreach_arch_function *function)
+ self_test_foreach_arch_function *function,
+ const std::set<std::string> &disabled_arch)
{
add_lazy_generator ([=] ()
{
- return foreach_arch_test_generator (name, function);
+ return foreach_arch_test_generator (name, function, disabled_arch);
});
}
diff --git a/gdb/selftest-arch.h b/gdb/selftest-arch.h
index a925e5a00dc..70b7f5224f8 100644
--- a/gdb/selftest-arch.h
+++ b/gdb/selftest-arch.h
@@ -19,6 +19,8 @@
#ifndef SELFTEST_ARCH_H
#define SELFTEST_ARCH_H
+#include <set>
+
typedef void self_test_foreach_arch_function (struct gdbarch *);
namespace selftests
@@ -28,7 +30,8 @@ namespace selftests
extern void
register_test_foreach_arch (const std::string &name,
- self_test_foreach_arch_function *function);
+ self_test_foreach_arch_function *function,
+ const std::set<std::string> &disabled_arch = {});
}
#endif /* SELFTEST_ARCH_H */
--
2.25.1
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2023-02-23 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 14:18 [PATCH 0/1] " Stephan Rohr
2023-02-23 14:18 ` Stephan Rohr [this message]
2023-02-23 17:51 ` [PATCH 1/1] gdb: " Andrew Burgess
2023-03-01 7:42 ` Rohr, Stephan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230223141815.996942-2-stephan.rohr@intel.com \
--to=stephan.rohr@intel.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).