]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.python/py-selected-context.exp with glibc debuginfo
authorTom de Vries <tdevries@suse.de>
Thu, 5 Mar 2026 15:37:32 +0000 (16:37 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 5 Mar 2026 15:37:32 +0000 (16:37 +0100)
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/testsuite/gdb.python/py-selected-context.exp

index c287cc90d44ceba132a4eac738176314815208a9..64fe2f3579515eebad4f0fe27aeadb188973bc47 100644 (file)
@@ -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"