diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-09-22 03:28:34 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-09-22 03:28:34 +0000 |
commit | c2c6d25f0d5eea4f834420870021a8c52db24018 (patch) | |
tree | f4b3d5e9e3207fa8118db4085f9c6a0cbc2bdaf6 /gdb/testsuite | |
parent | 54af6ff67571ba569b94e26d558d02f9955e6844 (diff) | |
download | gdb-c2c6d25f0d5eea4f834420870021a8c52db24018.zip gdb-c2c6d25f0d5eea4f834420870021a8c52db24018.tar.gz gdb-c2c6d25f0d5eea4f834420870021a8c52db24018.tar.bz2 |
import gdb-1999-09-21
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 21 | ||||
-rw-r--r-- | gdb/testsuite/config/monitor.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/break.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/condbreak.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/overload.cc | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/overload.exp | 22 |
6 files changed, 64 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7198d6e..5d162ae 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,24 @@ +1999-09-18 Jim Blandy <jimb@cris.red-bean.com> + + * gdb.base/break.exp: Code locations are in hex, don't forget! + (For HP-UX.) + +1999-09-17 Stan Shebs <shebs@andros.cygnus.com> + + * condbreak.exp: Use break.c as test program. + * condbreak.c: Remove, redundant with break.c. + +1999-09-15 Stan Shebs <shebs@andros.cygnus.com> + + * config/monitor.exp (gdb_target_monitor): Disable X- and + Z-packets if the target needs it. + +1999-09-13 James Ingham <jingham@leda.cygnus.com> + + * gdb.c++/overload.exp: Added tests for listing overloaded + functions with function pointers in the arg, explicitly calling + out the version you want. + 1999-09-09 Stan Shebs <shebs@andros.cygnus.com> * long_long.exp: Add variations of test cases that work for diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp index 727ef53..b482480 100644 --- a/gdb/testsuite/config/monitor.exp +++ b/gdb/testsuite/config/monitor.exp @@ -38,6 +38,12 @@ proc gdb_target_monitor { exec_file } { if [target_info exists binarydownload] { gdb_test "set remotebinarydownload [target_info binarydownload]" "" "" } + if { [ target_info exists disable_x_packet ] } { + gdb_test "set remote X-packet disable" "" + } + if { [ target_info exists disable_z_packet ] } { + gdb_test "set remote Z-packet disable" "" + } if [target_info exists gdb_serial] { set serialport "[target_info gdb_serial]"; } elseif [target_info exists netport] { diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 454d08b..bfd3c41 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -556,12 +556,13 @@ gdb_expect { # As long as we're stopped (breakpointed) in a called function, # verify that we can successfully backtrace & such from here. # + if [istarget "hppa*-*-hpux*"] then { send_gdb "bt\n" gdb_expect { - -re "#0\[ \t\]*0x\[0-9\]* in marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\ + -re "#0\[ \t\]*$hex in marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\ {pass "backtrace while in called function"} - -re "#0\[ \t\]*0x\[0-9\]* in marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\ + -re "#0\[ \t\]*$hex in marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\ {pass "backtrace while in called function"} -re "$gdb_prompt $"\ diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp index 8ec8536..ae0858b 100644 --- a/gdb/testsuite/gdb.base/condbreak.exp +++ b/gdb/testsuite/gdb.base/condbreak.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1997, 1998 Free Software Foundation, Inc. +# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,8 +21,6 @@ # Purpose is to test conditional breakpoints. # Modeled after "break.exp". - - if $tracelevel then { strace $tracelevel } @@ -35,7 +33,7 @@ global usestubs set prms_id 0 set bug_id 0 -set testfile "condbreak" +set testfile "break" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/overload.cc b/gdb/testsuite/gdb.c++/overload.cc index 58d07de..97083c5 100644 --- a/gdb/testsuite/gdb.c++/overload.cc +++ b/gdb/testsuite/gdb.c++/overload.cc @@ -24,6 +24,10 @@ int overload1arg (unsigned long); int overload1arg (float); int overload1arg (double); +int overloadfnarg (void); +int overloadfnarg (int); +int overloadfnarg (int, int (*) (int)); + int overloadargs (int a1); int overloadargs (int a1, int a2); int overloadargs (int a1, int a2, int a3); @@ -94,6 +98,12 @@ int foo::overload1arg (unsigned long arg) { arg = 0; return 10;} int foo::overload1arg (float arg) { arg = 0; return 11;} int foo::overload1arg (double arg) { arg = 0; return 12;} +/* Test to see that we can explicitly request overloaded functions + with function pointers in the prototype. */ + +int foo::overloadfnarg (void) { return ifoo * 20; } +int foo::overloadfnarg (int arg) { arg = 0; return 13;} +int foo::overloadfnarg (int arg, int (*foo) (int)) { return foo(arg); } /* Some functions to test overloading by varying argument count. */ diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp index fa12bff..e889273 100644 --- a/gdb/testsuite/gdb.c++/overload.exp +++ b/gdb/testsuite/gdb.c++/overload.exp @@ -397,3 +397,25 @@ gdb_expect { -re ".*$gdb_prompt $" { fail "print call overloaded func double arg" } timeout { fail "(timeout) print call overloaded func double arg" } } + +# Now some tests to see if we can list overloaded functions properly: + +send_gdb "set listsize 1\n" +gdb_expect -re ".*$gdb_prompt $" + +gdb_test "list foo::overloadfnarg(void)"\ + ".*int foo::overloadfnarg.*\\(void\\).*" \ + "print overloaded function with no args" + +gdb_test "list foo::overloadfnarg(int)"\ + "int foo::overloadfnarg.*\\(int arg\\).*" \ + "print overloaded function with int arg" + +gdb_test "list foo::overloadfnarg(int, int (*)(int))" \ + "int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \ + "print overloaded function with function ptr args" + +# This one crashes GDB. Don't know why yet. +gdb_test "list \"foo::overloadfnarg(int, int (*)(int))\"" \ + "int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \ + "print overloaded function with function ptr args - quotes around argument" |