{}
};
-/* Return true if regcache::cooked_{read,write}_test should be skipped for
- GDBARCH. */
-
-static bool
-selftest_skiparch (struct gdbarch *gdbarch)
-{
- const char *name = gdbarch_bfd_arch_info (gdbarch)->printable_name;
-
- /* Avoid warning:
- Running selftest regcache::cooked_{read,write}_test::m68hc11.
- warning: No frame soft register found in the symbol table.
- Stack backtrace will not work.
- We could instead capture the output and then filter out the warning, but
- that seems more trouble than it's worth. */
- return (strcmp (name, "m68hc11") == 0
- || strcmp (name, "m68hc12") == 0
- || strcmp (name, "m68hc12:HCS12") == 0);
-}
-
/* Test regcache::cooked_read gets registers from raw registers and
memory instead of target to_{fetch,store}_registers. */
static void
cooked_read_test (struct gdbarch *gdbarch)
{
- if (selftest_skiparch (gdbarch))
+ if (selftest_skip_warning_arch (gdbarch))
return;
scoped_mock_context<target_ops_no_register> mockctx (gdbarch);
static void
cooked_write_test (struct gdbarch *gdbarch)
{
- if (selftest_skiparch (gdbarch))
+ if (selftest_skip_warning_arch (gdbarch))
return;
/* Create a mock environment. A process_stratum target pushed. */
registers_changed ();
reinit_frame_cache ();
}
+
+/* See selftest-arch.h. */
+
+bool
+selftest_skip_warning_arch (struct gdbarch *gdbarch)
+{
+ const char *name = gdbarch_bfd_arch_info (gdbarch)->printable_name;
+
+ /* Avoid warning:
+ Running selftest <test>::m68hc11.
+ warning: No frame soft register found in the symbol table.
+ Stack backtrace will not work.
+ We could instead capture the output and then filter out the warning, but
+ that seems more trouble than it's worth. */
+ return (strcmp (name, "m68hc11") == 0
+ || strcmp (name, "m68hc12") == 0
+ || strcmp (name, "m68hc12:HCS12") == 0);
+}
+
} /* namespace selftests */
#endif /* GDB_SELF_TEST */
extern void
register_test_foreach_arch (const std::string &name,
self_test_foreach_arch_function *function);
+
+/* Return true if GDBARCH should be skipped in some selftests to avoid
+ warnings. */
+
+extern bool selftest_skip_warning_arch (struct gdbarch *gdbarch);
}
#endif /* GDB_SELFTEST_ARCH_H */