multi-create-ns-info-thr.exp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright (C) 2007-2022 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 3 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. # Test running "info threads" while threads are being created and
  15. # exiting, in non-stop mode. Originally based on multi-create.exp.
  16. standard_testfile multi-create.c
  17. if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] == -1} {
  18. return -1
  19. }
  20. gdb_test_no_output "set pagination off"
  21. gdb_test_no_output "set non-stop on"
  22. if ![runto_main] {
  23. return -1
  24. }
  25. # Create a breakpoint that does "info threads" when hit, which will be
  26. # just while other threads are being created or exiting.
  27. set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
  28. gdb_breakpoint $srcfile:$bp_location1
  29. gdb_test "commands\ninfo threads\ncontinue&\nend" ".*" "set breakpoint commands"
  30. set test "continue -a&"
  31. gdb_test_multiple $test $test {
  32. -re "$gdb_prompt " {
  33. pass $test
  34. }
  35. }
  36. for {set i 0} {$i < 32} {incr i} {
  37. set test "continue to breakpoint $i"
  38. gdb_test_multiple "" $test {
  39. -re "Breakpoint $decimal,\[^\r\n\]*$srcfile:$bp_location1" {
  40. pass $test
  41. }
  42. }
  43. }