With test-case gdb.python/py-selected-context.exp, I run into:
...
(gdb) thread 1
[Switching to thread 1.1 (Thread 0x7ffff7cc0080 (LWP
1793477))]
57 return INTERNAL_SYSCALL_CANCEL (...
Python Exception <class 'gdb.GdbError'>: error from gdb_selected_context_handler
(gdb) FAIL: $exp: switch thread, handler raises an error
...
The regexp doesn't expect the source line, which indeed is not printed if I
de-install glibc debuginfo.
Fix this by updating the regexp.
Tested on x86_64-linux.
gdb_test "thread 1" \
[multi_line \
"\\\[Switching to thread 1\\.1\[^\r\n\]*\\\]" \
- "#0\\s+\[^\r\n\]+" \
+ "#0\\s+\[^\r\n\]+(" \
+ "$decimal\t\[^\r\n\]+)?" \
"\[^\r\n\]+: error from gdb_selected_context_handler"] \
"switch thread, handler raises an error"
check_thread 1.1 "thread switched despite handler error"