next-while-other-thread-longjmps.exp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright (C) 2015-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. # This test has the main thread step over a few lines, while a few
  15. # threads constantly do setjmp/long and others do try/catch. The
  16. # "next" commands in the main thread should be able to complete
  17. # undisturbed.
  18. standard_testfile
  19. set linenum [gdb_get_line_number "set break here"]
  20. if {[prepare_for_testing "failed to prepare" \
  21. $testfile $srcfile {c++ debug pthreads}] == -1} {
  22. return -1
  23. }
  24. if ![runto_main] then {
  25. return 0
  26. }
  27. gdb_breakpoint $linenum
  28. gdb_continue_to_breakpoint "start line"
  29. for {set i 1} {$i <= 10} {incr i} {
  30. gdb_test "next" " line $i .*" "next to line $i"
  31. }