| OLD | NEW |
| 1 # Copyright (C) 2008-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 |
| 16 # Test handling of threads across an execl. | 16 # Test handling of threads across an execl. |
| 17 | 17 |
| 18 if { [is_remote target] } then { | 18 if { [is_remote target] } then { |
| 19 continue | 19 continue |
| 20 } | 20 } |
| 21 | 21 |
| 22 # Original image, loads a thread library. | 22 # Original image, loads a thread library. |
| 23 set testfile "execl" | 23 standard_testfile |
| 24 set srcfile ${testfile}.c | |
| 25 set binfile ${objdir}/${subdir}/${testfile} | |
| 26 | 24 |
| 27 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le {debug}] != "" } { | 25 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
le {debug}] != "" } { |
| 28 return -1 | 26 return -1 |
| 29 } | 27 } |
| 30 | 28 |
| 31 # New image, that does not load a thread library. | 29 # New image, that does not load a thread library. |
| 32 set testfile1 "execl1" | 30 set testfile1 "execl1" |
| 33 set srcfile1 ${testfile1}.c | 31 set srcfile1 ${testfile1}.c |
| 34 set binfile1 ${objdir}/${subdir}/${testfile1} | 32 set binfile1 [standard_output_file ${testfile1}] |
| 35 | 33 |
| 36 if {[gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {deb
ug}] != "" } { | 34 if {[gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {deb
ug}] != "" } { |
| 37 return -1 | 35 return -1 |
| 38 } | 36 } |
| 39 | 37 |
| 40 gdb_exit | 38 clean_restart ${binfile} |
| 41 gdb_start | |
| 42 gdb_reinitialize_dir $srcdir/$subdir | |
| 43 gdb_load ${binfile} | |
| 44 | 39 |
| 45 runto_main | 40 runto_main |
| 46 | 41 |
| 47 gdb_test "b [gdb_get_line_number "breakpoint here"]" \ | 42 gdb_test "b [gdb_get_line_number "breakpoint here"]" \ |
| 48 ".*Breakpoint .*execl.*" "set breakpoint at execl" | 43 ".*Breakpoint .*execl.*" "set breakpoint at execl" |
| 49 | 44 |
| 50 gdb_test "continue" ".*breakpoint here.*" "continue to exec" | 45 gdb_test "continue" ".*breakpoint here.*" "continue to exec" |
| 51 | 46 |
| 52 gdb_test "info threads" ".*3 *Thread.*2 *Thread.*1 *Thread.*" "info threads befo
re exec" | 47 gdb_test "info threads" ".*3 *Thread.*2 *Thread.*1 *Thread.*" "info threads befo
re exec" |
| 53 | 48 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 68 # New threads registered. | 63 # New threads registered. |
| 69 fail "$test" | 64 fail "$test" |
| 70 } | 65 } |
| 71 -re "$gdb_prompt $" { | 66 -re "$gdb_prompt $" { |
| 72 # Target doesn't register the main thread, pass for now. | 67 # Target doesn't register the main thread, pass for now. |
| 73 pass "$test" | 68 pass "$test" |
| 74 } | 69 } |
| 75 } | 70 } |
| 76 | 71 |
| 77 gdb_continue_to_end | 72 gdb_continue_to_end |
| OLD | NEW |