+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 "".
+
2021-04-01 Egeyar Bagcioglu <egeyar@gmail.com>
* lib/pdtrace.in: Fix obvious typo.
# Now restart gdb and load the corefile.
clean_restart ${testfile}
-foreach name { corefile core0file } { with_test_prefix $name {
- set core_loaded [gdb_core_cmd [subst $$name] "re-load generated corefile"]
+proc load_core { filename } {
+ global horiz nl
+
+ set core_loaded [gdb_core_cmd $filename "re-load generated corefile"]
if { $core_loaded == -1 } {
# No use proceeding from here.
- continue
+ return
}
# FIXME: now what can we test about the thread state?
gdb_test "info threads" "\\* ${horiz} thread2 .*${nl}" \
"thread2 is current thread in corefile"
-}}
+}
+
+foreach name { corefile core0file } {
+ set filename [subst $$name]
+ if { $filename == "" } {
+ continue
+ }
+ with_test_prefix $name {
+ load_core $filename
+ }
+}