[gdb] Fix warning in foreach_arch selftests
authorTom de Vries <tdevries@suse.de>
Wed, 1 Jun 2022 17:29:40 +0000 (19:29 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 1 Jun 2022 17:29:40 +0000 (19:29 +0200)
commitfc18b1c5afd77960b221d81f382de5c9cf5e75d9
treeb6a939c3f2d3b47bc5f92f5971b6b49468fd9f5f
parent80fa4b2a606763e71c4b599fa88288f554a0ea5b
[gdb] Fix warning in foreach_arch selftests

When running the selftests, I run into:
...
$ gdb -q -batch -ex "maint selftest"
  ...
Running selftest execute_cfa_program::aarch64:ilp32.
warning: 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.
...
and likewise for execute_cfa_program::i8086 and
execute_cfa_program::ia64-elf32.

The warning can easily be reproduced outside the selftests by doing:
...
$ gdb -q -batch -ex "set arch aarch64:ilp32"
...
and can be prevented by first doing "set osabi none".

Fix the warning by setting osabi to none while doing selftests that iterate
over all architectures.

Tested on x86_64-linux.
gdb/osabi.c
gdb/osabi.h
gdb/selftest-arch.c