[gdb/testsuite] Handle with_set arch
authorTom de Vries <tdevries@suse.de>
Mon, 14 Nov 2022 11:12:19 +0000 (12:12 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 14 Nov 2022 11:12:19 +0000 (12:12 +0100)
commit7f21d259bcefda58b701af01cc6a749c8133fb2b
tree02b98b4e1c93a031383a8ba41b30762f0517a4b7
parent8d45c3a82a0eb5ecfc9049bed5569f9e27e3be8c
[gdb/testsuite] Handle with_set arch

I realized that the more irregular output of show arch:
...
(gdb) show arch^M
The target architecture is set to "auto" (currently "i386").^M
...
would be a problem for something like:
...
with_set arch powerpc:common64 {}
...
and indeed:
...
(gdb) set arch powerpc:common64^M
The target architecture is set to "powerpc:common64".^M
(gdb) FAIL: gdb.base/foo.exp: set arch powerpc:common64
...
and:
...
(gdb) set arch set to "auto" (currently "i386")^M
Undefined item: "set".^M
...

Fix this in with_set by handling this type of output.

Tested on x86_64-linux.
gdb/testsuite/lib/gdb.exp