| OLD | NEW |
| 1 # Copyright 1992, 1997, 1999, 2001-2004, 2007-2012 Free Software | 1 # Copyright 1992, 1997, 1999, 2001-2004, 2007-2012 Free Software |
| 2 # Foundation, Inc. | 2 # Foundation, 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 # Adapted for g++ 3.0 ABI by Michael Chastain. (chastain@redhat.com) | 18 # Adapted for g++ 3.0 ABI by Michael Chastain. (chastain@redhat.com) |
| 19 | 19 |
| 20 if $tracelevel then { | |
| 21 strace $tracelevel | |
| 22 } | |
| 23 | |
| 24 if { [skip_cplus_tests] } { continue } | 20 if { [skip_cplus_tests] } { continue } |
| 25 | 21 |
| 26 set testfile "cplusfuncs" | 22 standard_testfile .cc |
| 27 set srcfile ${testfile}.cc | |
| 28 set binfile ${objdir}/${subdir}/${testfile} | |
| 29 | 23 |
| 30 if { [get_compiler_info $binfile "c++"] } { | 24 if { [get_compiler_info "c++"] } { |
| 31 return -1 | 25 return -1 |
| 32 } | 26 } |
| 33 | 27 |
| 34 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug c++}] != "" } { | 28 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
| 35 untested cplusfuncs.exp | 29 return -1 |
| 36 return -1 | |
| 37 } | 30 } |
| 38 | 31 |
| 39 # | 32 # |
| 40 # g++ changed its ABI between 2.95 and 3.0. gdb has two demanglers | 33 # g++ changed its ABI between 2.95 and 3.0. gdb has two demanglers |
| 41 # for the two different styles. The two demanglers have some subtle | 34 # for the two different styles. The two demanglers have some subtle |
| 42 # discrepancies in their output. | 35 # discrepancies in their output. |
| 43 # | 36 # |
| 44 # old demangler new demangler | 37 # old demangler new demangler |
| 45 # --- --------- --- --------- | 38 # --- --------- --- --------- |
| 46 # "operator, " "operator," | 39 # "operator, " "operator," |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 574 |
| 582 # gdb-gnats bug gdb/19: | 575 # gdb-gnats bug gdb/19: |
| 583 # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7" | 576 # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7" |
| 584 print_addr_2 "hairyfunc5" "hairyfunc5(PFPc_PFl_i)" | 577 print_addr_2 "hairyfunc5" "hairyfunc5(PFPc_PFl_i)" |
| 585 print_addr_2 "hairyfunc6" "hairyfunc6(PFPi_PFl_i)" | 578 print_addr_2 "hairyfunc6" "hairyfunc6(PFPi_PFl_i)" |
| 586 print_addr_2 "hairyfunc7" "hairyfunc7(PFPFPc_i_PFl_i)" | 579 print_addr_2 "hairyfunc7" "hairyfunc7(PFPFPc_i_PFl_i)" |
| 587 } | 580 } |
| 588 } | 581 } |
| 589 | 582 |
| 590 proc do_tests {} { | 583 proc do_tests {} { |
| 591 global subdir | |
| 592 global objdir | |
| 593 global srcdir | |
| 594 global binfile | 584 global binfile |
| 595 global gdb_prompt | |
| 596 global dm_type_int_star | 585 global dm_type_int_star |
| 597 | 586 |
| 598 | 587 clean_restart $binfile |
| 599 # Start with a fresh gdb. | |
| 600 | |
| 601 gdb_exit | |
| 602 gdb_start | |
| 603 gdb_reinitialize_dir $srcdir/$subdir | |
| 604 gdb_load $binfile | |
| 605 | 588 |
| 606 gdb_test_no_output "set width 0" | 589 gdb_test_no_output "set width 0" |
| 607 | 590 |
| 608 runto_main | 591 runto_main |
| 609 | 592 |
| 610 gdb_test_no_output "set language c++" | 593 gdb_test_no_output "set language c++" |
| 611 probe_demangler | 594 probe_demangler |
| 612 test_paddr_overloaded_functions | 595 test_paddr_overloaded_functions |
| 613 test_paddr_operator_functions | 596 test_paddr_operator_functions |
| 614 test_paddr_hairy_functions | 597 test_paddr_hairy_functions |
| 615 test_lookup_operator_functions | 598 test_lookup_operator_functions |
| 616 | 599 |
| 617 # A regression test on errors involving operators | 600 # A regression test on errors involving operators |
| 618 gdb_test "list foo::operator $dm_type_int_star" \ | 601 gdb_test "list foo::operator $dm_type_int_star" \ |
| 619 "Function \"foo::operator [string_to_regexp $dm_type_int_star]\" not def
ined\\." | 602 "Function \"foo::operator [string_to_regexp $dm_type_int_star]\" not def
ined\\." |
| 620 } | 603 } |
| 621 | 604 |
| 622 do_tests | 605 do_tests |
| OLD | NEW |