| OLD | NEW |
| 1 # Copyright 1998-1999, 2001-2004, 2007-2012 Free Software Foundation, | 1 # Copyright 1998-1999, 2001-2004, 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 # This tests: | 22 # This tests: |
| 23 # 0. method arguments are correct | 23 # 0. method arguments are correct |
| 24 # 1. access to class data members inside method scopes | 24 # 1. access to class data members inside method scopes |
| 25 # 2. correct param types for methods in ptype. | 25 # 2. correct param types for methods in ptype. |
| 26 # 3. const and volatile methods | 26 # 3. const and volatile methods |
| 27 | 27 |
| 28 # (#0 and #1 above relate to an HP specific problem -- GDB must correctly | 28 # (#0 and #1 above relate to an HP specific problem -- GDB must correctly |
| 29 # integrate FPARAM symbols in HP debug info into the local var list | 29 # integrate FPARAM symbols in HP debug info into the local var list |
| 30 # for the function or method's block.) | 30 # for the function or method's block.) |
| 31 | 31 |
| 32 if $tracelevel then { | |
| 33 strace $tracelevel | |
| 34 } | |
| 35 | |
| 36 # | 32 # |
| 37 # test running programs | 33 # test running programs |
| 38 # | 34 # |
| 39 | 35 |
| 40 if { [skip_cplus_tests] } { continue } | 36 if { [skip_cplus_tests] } { continue } |
| 41 | 37 |
| 42 set testfile "method" | 38 standard_testfile .cc |
| 43 set srcfile ${testfile}.cc | |
| 44 set binfile ${objdir}/${subdir}/${testfile} | |
| 45 | 39 |
| 46 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug c++}] != "" } { | 40 if [get_compiler_info "c++"] { |
| 47 untested method.exp | |
| 48 return -1 | |
| 49 } | |
| 50 | |
| 51 if [get_compiler_info $binfile "c++"] { | |
| 52 return -1 | 41 return -1 |
| 53 } | 42 } |
| 54 | 43 |
| 55 gdb_exit | 44 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
| 56 gdb_start | 45 return -1 |
| 57 gdb_reinitialize_dir $srcdir/$subdir | 46 } |
| 58 gdb_load ${binfile} | |
| 59 | |
| 60 | 47 |
| 61 # | 48 # |
| 62 # set it up at a breakpoint so we can play with the variable values | 49 # set it up at a breakpoint so we can play with the variable values |
| 63 # | 50 # |
| 64 if ![runto_main] then { | 51 if ![runto_main] then { |
| 65 perror "couldn't run to breakpoint" | 52 perror "couldn't run to breakpoint" |
| 66 continue | 53 continue |
| 67 } | 54 } |
| 68 | 55 |
| 69 gdb_test "break A::foo" \ | 56 gdb_test "break A::foo" \ |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 163 |
| 177 gdb_test_multiple "cont" "finish program" { | 164 gdb_test_multiple "cont" "finish program" { |
| 178 -re "Continuing.\r\n$inferior_exited_re normally.*$gdb_prompt $" { | 165 -re "Continuing.\r\n$inferior_exited_re normally.*$gdb_prompt $" { |
| 179 pass "finish program" | 166 pass "finish program" |
| 180 } | 167 } |
| 181 -re "Continuing.* EXIT code 0.*$inferior_exited_re normally.*$gdb_prompt $"
{ | 168 -re "Continuing.* EXIT code 0.*$inferior_exited_re normally.*$gdb_prompt $"
{ |
| 182 pass "finish program (exit wrapper)" | 169 pass "finish program (exit wrapper)" |
| 183 } | 170 } |
| 184 } | 171 } |
| 185 | 172 |
| OLD | NEW |