diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp index 3fdadf9827f..6bee0ad2e2c 100644 --- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp +++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp @@ -74,7 +74,7 @@ proc test {} { # Seen when "set debug libthread_db" is on. exp_continue } - -re "warning: Cannot attach to lwp $decimal: Operation not permitted" { + -re "Cannot attach to lwp $decimal: Operation not permitted" { # On Linux, PTRACE_ATTACH sometimes fails with # EPERM, even though /proc/PID/status indicates # the thread is running. @@ -96,6 +96,10 @@ proc test {} { } } + if { $eperm } { + continue + } + # Sleep a bit and try updating the thread list. We should # know about all threads already at this point. If we see # "New Thread" or similar being output, then "attach" is