| OLD | NEW |
| 1 # Copyright 2008-2012 Free Software Foundation, Inc. | 1 # Copyright 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 load_lib dwarf.exp | 15 load_lib dwarf.exp |
| 16 | 16 |
| 17 # This test can only be run on targets which support DWARF-2 and use gas. | 17 # This test can only be run on targets which support DWARF-2 and use gas. |
| 18 if {![dwarf2_support]} { | 18 if {![dwarf2_support]} { |
| 19 return 0 | 19 return 0 |
| 20 } | 20 } |
| 21 | 21 |
| 22 set testfile "dw2-ref-missing-frame" | 22 standard_testfile .S |
| 23 set srcsfile ${testfile}.S | |
| 24 set objsfile ${objdir}/${subdir}/${testfile}.o | |
| 25 set srcfuncfile ${testfile}-func.c | 23 set srcfuncfile ${testfile}-func.c |
| 26 set objfuncfile ${objdir}/${subdir}/${testfile}-func.o | |
| 27 set srcmainfile ${testfile}-main.c | 24 set srcmainfile ${testfile}-main.c |
| 28 set objmainfile ${objdir}/${subdir}/${testfile}-main.o | |
| 29 set executable ${testfile} | 25 set executable ${testfile} |
| 30 set binfile ${objdir}/${subdir}/${executable} | |
| 31 | 26 |
| 32 if { [gdb_compile "${srcdir}/${subdir}/${srcsfile}" $objsfile object {}] != "" | 27 if {[prepare_for_testing_full $testfile.exp \ |
| 33 || [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" $objfuncfile object {}
] != "" | 28 » [list $testfile {} $srcfile {} $srcfuncfile {} \ |
| 34 || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" $objmainfile object {d
ebug}] != "" | 29 » $srcmainfile debug]]} { |
| 35 || [gdb_compile "$objsfile $objfuncfile $objmainfile" $binfile executable {
}] != "" } { | |
| 36 return -1 | 30 return -1 |
| 37 } | 31 } |
| 38 | 32 |
| 39 clean_restart $executable | |
| 40 | |
| 41 # First try referencing DW_AT_frame_base which is not defined. | 33 # First try referencing DW_AT_frame_base which is not defined. |
| 42 if [runto func_nofb] { | 34 if [runto func_nofb] { |
| 43 gdb_test "p func_nofb_var" {Could not find the frame base for "func_nofb".}
"func_nofb print" | 35 gdb_test "p func_nofb_var" {Could not find the frame base for "func_nofb".}
"func_nofb print" |
| 44 gdb_test "bt full" " in main .* main_var = 1" "func_nofb backtrace" | 36 gdb_test "bt full" " in main .* main_var = 1" "func_nofb backtrace" |
| 45 } | 37 } |
| 46 | 38 |
| 47 # GDB could have crashed. | 39 # GDB could have crashed. |
| 48 clean_restart $executable | 40 clean_restart $executable |
| 49 | 41 |
| 50 # And now try referencing DW_AT_frame_base defined using a self-reference | 42 # And now try referencing DW_AT_frame_base defined using a self-reference |
| 51 # (DW_OP_fbreg). | 43 # (DW_OP_fbreg). |
| 52 if [runto func_loopfb] { | 44 if [runto func_loopfb] { |
| 53 gdb_test "p func_loopfb_var" "DWARF-2 expression error: Loop detected .*" "f
unc_loopfb print" | 45 gdb_test "p func_loopfb_var" "DWARF-2 expression error: Loop detected .*" "f
unc_loopfb print" |
| 54 gdb_test "bt full" " in main .* main_var = 1" "func_loopfb backtrace" | 46 gdb_test "bt full" " in main .* main_var = 1" "func_loopfb backtrace" |
| 55 } | 47 } |
| OLD | NEW |