From: Tom de Vries Date: Thu, 5 Mar 2026 15:37:32 +0000 (+0100) Subject: [gdb/testsuite] Fix gdb.python/py-selected-context.exp with glibc debuginfo X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=486a34b5c8874550e3298f1bf4b024bd8be080e6;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix gdb.python/py-selected-context.exp with glibc debuginfo 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 : 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. --- diff --git a/gdb/testsuite/gdb.python/py-selected-context.exp b/gdb/testsuite/gdb.python/py-selected-context.exp index c287cc90d44..64fe2f35795 100644 --- a/gdb/testsuite/gdb.python/py-selected-context.exp +++ b/gdb/testsuite/gdb.python/py-selected-context.exp @@ -104,7 +104,8 @@ check_thread 1.2 "confirm expected thread selected" 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"