| OLD | NEW |
| 1 # Copyright (C) 1992, 1994-1995, 2007-2012 Free Software Foundation, | 1 # Copyright (C) 1992, 1994-1995, 2007-2012 Free Software Foundation, |
| 2 # Inc. | 2 # Inc. |
| 3 | 3 |
| 4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
| 5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
| 6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
| 7 # (at your option) any later version. | 7 # (at your option) any later version. |
| 8 # | 8 # |
| 9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
| 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
| 13 # | 13 # |
| 14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
| 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 16 | 16 |
| 17 # This file was written by Fred Fish. (fnf@cygnus.com) | 17 # This file was written by Fred Fish. (fnf@cygnus.com) |
| 18 | 18 |
| 19 if $tracelevel then { | |
| 20 strace $tracelevel | |
| 21 } | |
| 22 | |
| 23 if { [skip_hp_tests] } then { continue } | 19 if { [skip_hp_tests] } then { continue } |
| 24 | 20 |
| 25 global message | 21 global message |
| 26 | 22 |
| 27 # | 23 # |
| 28 # test running programs | 24 # test running programs |
| 29 # | 25 # |
| 30 | 26 |
| 31 set testfile "xdb" | 27 set testfile "xdb" |
| 32 set binfile ${objdir}/${subdir}/${testfile} | 28 set binfile ${objdir}/${subdir}/${testfile} |
| 33 | 29 |
| 34 if { [gdb_compile "${srcdir}/${subdir}/xdb0.c" "${binfile}0.o" object {debug}]
!= "" } { | 30 if { [gdb_compile "${srcdir}/${subdir}/xdb0.c" "${binfile}0.o" object {debug}]
!= "" } { |
| 35 perror "Couldn't compile ${testfile}0.c to object" | 31 perror "Couldn't compile ${testfile}0.c to object" |
| 36 return -1 | 32 return -1 |
| 37 } | 33 } |
| 38 | 34 |
| 39 if { [gdb_compile "${srcdir}/${subdir}/xdb1.c" "${binfile}1.o" object {debug}]
!= "" } { | 35 if { [gdb_compile "${srcdir}/${subdir}/xdb1.c" "${binfile}1.o" object {debug}]
!= "" } { |
| 40 perror "Couldn't compile ${testfile}1.c to object" | 36 perror "Couldn't compile ${testfile}1.c to object" |
| 41 return -1 | 37 return -1 |
| 42 } | 38 } |
| 43 | 39 |
| 44 if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}]
!= "" } { | 40 if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}]
!= "" } { |
| 45 perror "Couldn't link ${testfile}." | 41 perror "Couldn't link ${testfile}." |
| 46 return -1 | 42 return -1 |
| 47 } | 43 } |
| 48 | 44 |
| 49 if [get_compiler_info ${binfile}] { | 45 if [get_compiler_info] { |
| 50 return -1; | 46 return -1; |
| 51 } | 47 } |
| 52 | 48 |
| 53 if { $gcc_compiled } then { continue } | 49 if { $gcc_compiled } then { continue } |
| 54 | 50 |
| 55 global GDBFLAGS | 51 global GDBFLAGS |
| 56 set saved_gdbflags $GDBFLAGS | 52 set saved_gdbflags $GDBFLAGS |
| 57 set GDBFLAGS "$GDBFLAGS --xdb" | 53 set GDBFLAGS "$GDBFLAGS --xdb" |
| 58 | 54 |
| 59 gdb_exit | 55 gdb_exit |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 gdb_load ${binfile} | 87 gdb_load ${binfile} |
| 92 | 88 |
| 93 gdb_test "break bar" "" | 89 gdb_test "break bar" "" |
| 94 gdb_test "run" "" | 90 gdb_test "run" "" |
| 95 gdb_test "backtrace full" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n.1.*
in foo \\(x=1\\) at.*xdb0\.h:8\r\nNo locals\.\r\n.2.* in main \\(\\) at.*xdb0\.c
:11\r\n.*x = 1" | 91 gdb_test "backtrace full" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n.1.*
in foo \\(x=1\\) at.*xdb0\.h:8\r\nNo locals\.\r\n.2.* in main \\(\\) at.*xdb0\.c
:11\r\n.*x = 1" |
| 96 gdb_test "bt 1 full" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n\\(More st
ack frames follow\.\.\.\\)" | 92 gdb_test "bt 1 full" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n\\(More st
ack frames follow\.\.\.\\)" |
| 97 gdb_test "bt full 2" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n.1.* in fo
o \\(x=1\\) at.*xdb0\.h:8\r\nNo locals\.\r\n\\(More stack frames follow\.\.\.\\)
" | 93 gdb_test "bt full 2" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n.1.* in fo
o \\(x=1\\) at.*xdb0\.h:8\r\nNo locals\.\r\n\\(More stack frames follow\.\.\.\\)
" |
| 98 | 94 |
| 99 set GDBFLAGS $saved_gdbflags | 95 set GDBFLAGS $saved_gdbflags |
| 100 return 0 | 96 return 0 |
| OLD | NEW |