diff options
author | Keith Seitz <keiths@redhat.com> | 2012-03-01 20:34:13 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2012-03-01 20:34:13 +0000 |
commit | d3dc44a619a1f52ace35f3cccb16b6096e13b5da (patch) | |
tree | 01a8715e9a9b305c41ca2371174cbbbfa1c862dc /gdb/testsuite/gdb.cp/method2.exp | |
parent | e0a4d1083e0845e8e402b75b32b0e81b1a3f4e10 (diff) | |
download | gdb-d3dc44a619a1f52ace35f3cccb16b6096e13b5da.zip gdb-d3dc44a619a1f52ace35f3cccb16b6096e13b5da.tar.gz gdb-d3dc44a619a1f52ace35f3cccb16b6096e13b5da.tar.bz2 |
* gdb.cp/method2.exp: Output of overload menu is now
alphabetized. Update tests for "break A::method".
* gdb.cp/ovldbreak.exp: Use gdb_get_line_number instead
of hard-coding them.
Overload menu is alphabetized: rewrite to accommodate.
Unset variables LINE and TYPES which are used in other tests.
Compute the output of "info break".
Update the breakpoint table after all breakpoints are deleted.
(continue_to_bp_overloaded): Rename ACTUALS to ARGUMENT and
compute ACTUALS and the method body based on parameters.
Update expected output accordingly.
* gdb.cp/ovldbreak.cc (foo::overload1arg): Reformat and add
unique comments to allow the use of gdb_get_line_number.
* gdb.cp/method2.exp: Use prepare_for_testing and cleanup
some Tcl syntax.
* gdb.cp/ovldbreak.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.cp/method2.exp')
-rw-r--r-- | gdb/testsuite/gdb.cp/method2.exp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp index f44381f..2aa035e 100644 --- a/gdb/testsuite/gdb.cp/method2.exp +++ b/gdb/testsuite/gdb.cp/method2.exp @@ -21,24 +21,15 @@ if { [skip_cplus_tests] } { continue } set testfile "method2" -set srcfile ${testfile}.cc -set binfile ${objdir}/${subdir}/${testfile} +set srcfile $testfile.cc +set binfile $objdir/$subdir/$testfile -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { +if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { untested method2.exp return -1 } -if [get_compiler_info $binfile "c++"] { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -if ![runto_main] then { +if {![runto_main]} { perror "couldn't run to breakpoint" continue } @@ -50,8 +41,21 @@ proc test_break { lang } { "" \ "setting language $lang" + # Menu items should be alphabetical + set ovlds [lsort {"" "int" "A*"}] + set items {"cancel" "all"} + foreach ovld $ovlds { + lappend items "A::method($ovld)" + } + set menu_items {} + set idx 0 + foreach item $items { + lappend menu_items ".$idx. .*[string_to_regexp $item]" + incr idx + } + set expect [join $menu_items {.*[\r\n]*}] gdb_test_multiple "break A::method" "breaking in method ($lang)" { - -re ".0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. .*:A::method\\(A\\*\\)\[\r\n\]*.3. .*:A::method\\(int\\)\[\r\n\]*.4. .*:A::method\\(\\)\[\r\n\]*> $" { + -re $expect { gdb_test "0" \ "canceled" \ "breaking in method ($lang)" |