Revert "[gdb] Fix warning in foreach_arch selftests"

This reverts commit fc18b1c5afd ("[gdb] Fix warning in foreach_arch
selftests").

The commit introduced regressions for an --enable-targets=all build:
...
Running selftest print_one_insn::A6.^M
Self test failed: Cannot access memory at address 0x0^M
...
and while investigating those I realized that the commit fc18b1c5afd
complicates things by trying to set the current osabi.

So, revert the patch in preparation for a simpler solution.

Tested on x86_64-linux.
This commit is contained in:
Tom de Vries
2022-06-03 15:34:50 +02:00
parent a98600052e
commit 0e02119e65
3 changed files with 13 additions and 68 deletions

View File

@ -66,28 +66,12 @@ foreach_arch_test_generator (const std::string &name,
auto test_fn
= ([=] ()
{
/* Prevent warnings when setting architecture with current osabi
settings, like:
A handler for the OS ABI "GNU/Linux" is not built into this
configuration of GDB. Attempting to continue with the
default aarch64:ilp32 settings. */
enum gdb_osabi_mode mode;
enum gdb_osabi osabi;
get_osabi (mode, osabi);
set_osabi (osabi_user, GDB_OSABI_NONE);
SCOPE_EXIT
{
reset ();
set_osabi (mode, osabi);
};
struct gdbarch_info info;
info.bfd_arch_info = bfd_scan_arch (arch);
struct gdbarch *gdbarch = gdbarch_find_by_info (info);
SELF_CHECK (gdbarch != NULL);
function (gdbarch);
reset ();
});
tests.emplace_back (string_printf ("%s::%s", name.c_str (), arch),