OLD | NEW |
1 # Copyright 2009-2012 Free Software Foundation, Inc. | 1 # Copyright 2009-2013 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. |
(...skipping 14 matching lines...) Expand all Loading... |
26 set testfile "bkpt-multi-exec" | 26 set testfile "bkpt-multi-exec" |
27 | 27 |
28 set exec1 "bkpt-multi-exec" | 28 set exec1 "bkpt-multi-exec" |
29 set srcfile1 ${exec1}.c | 29 set srcfile1 ${exec1}.c |
30 set binfile1 [standard_output_file ${exec1}] | 30 set binfile1 [standard_output_file ${exec1}] |
31 | 31 |
32 set exec2 "crashme" | 32 set exec2 "crashme" |
33 set srcfile2 ${exec2}.c | 33 set srcfile2 ${exec2}.c |
34 set binfile2 [standard_output_file ${exec2}] | 34 set binfile2 [standard_output_file ${exec2}] |
35 | 35 |
36 if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}
] == -1 } { | 36 set compile_options {debug nowarnings} |
| 37 set dirname [relative_filename [pwd] [file dirname $binfile1]] |
| 38 lappend compile_options "additional_flags=-DBASEDIR=\"$dirname\"" |
| 39 |
| 40 if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" $compile_options]
== -1 } { |
37 return -1 | 41 return -1 |
38 } | 42 } |
39 | 43 |
40 if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}
] == -1 } { | 44 if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" $compile_options]
== -1 } { |
41 return -1 | 45 return -1 |
42 } | 46 } |
43 | 47 |
44 # Start with a fresh gdb | 48 # Start with a fresh gdb |
45 | 49 |
46 clean_restart ${exec1} | 50 clean_restart ${exec1} |
47 | 51 |
48 # Start the program running, and stop at main. | 52 # Start the program running, and stop at main. |
49 # | 53 # |
50 if ![runto_main] then { | 54 if ![runto_main] then { |
(...skipping 21 matching lines...) Expand all Loading... |
72 | 76 |
73 # Start the program running, and stop at main. | 77 # Start the program running, and stop at main. |
74 # | 78 # |
75 gdb_test "inferior 1" | 79 gdb_test "inferior 1" |
76 | 80 |
77 # Now run to the breakpoint. This should cross the exec, and stop at | 81 # Now run to the breakpoint. This should cross the exec, and stop at |
78 # the breakpoint before the crash. | 82 # the breakpoint before the crash. |
79 gdb_test "run" "${srcfile2}:${bp_location}.*set breakpoint here.*" | 83 gdb_test "run" "${srcfile2}:${bp_location}.*set breakpoint here.*" |
80 | 84 |
81 return 0 | 85 return 0 |
OLD | NEW |