[gdb/testsuite] Fix xfail handling in gdb.threads/gcore-thread.exp
When running test-case gdb.threads/gcore-thread.exp on openSUSE Tumbleweed,
I run into these XFAILs:
...
XFAIL: gdb.threads/gcore-thread.exp: clear __stack_user.next
XFAIL: gdb.threads/gcore-thread.exp: clear stack_used.next
...
Apart from the xfail, the test-case also sets core0file to "":
...
-re "No symbol \"${symbol}\" in current context\\.\r\n$gdb_prompt $" {
xfail $test
# Do not do the verification.
set core0file ""
}
...
After which we run into this FAIL, because gdb_core_cmd fails to load a
core file called "":
...
(gdb) core ^M
No core file now.^M
(gdb) FAIL: gdb.threads/gcore-thread.exp: core0file: \
re-load generated corefile
...
Fix this FAIL by skipping gdb_core_cmd if the core file is "".
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-04-06 Tom de Vries <tdevries@suse.de>
PR testsuite/27691
* gdb.threads/gcore-thread.exp: Don't call gdb_core_cmd with core
file "".