diff options
author | Michael Snyder <msnyder@vmware.com> | 2001-11-05 23:31:26 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2001-11-05 23:31:26 +0000 |
commit | 3f08ced966f9f8e992998b24eab8435db97532ab (patch) | |
tree | 830a60cbf511832a1b154aa4cfd413979f863d70 /gdb/testsuite | |
parent | 53e8ad3d81c2d599493f764b5b85f3495a131f37 (diff) | |
download | gdb-3f08ced966f9f8e992998b24eab8435db97532ab.zip gdb-3f08ced966f9f8e992998b24eab8435db97532ab.tar.gz gdb-3f08ced966f9f8e992998b24eab8435db97532ab.tar.bz2 |
2001-11-01 Michael Snyder <msnyder@redhat.com>
* gdb.c++/cplusfuncs.exp: Fix conflicts between operator names
and regular expression operators by using quoting.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/cplusfuncs.exp | 21 |
2 files changed, 20 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6f518e9..f487325 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2001-11-01 Michael Snyder <msnyder@redhat.com> + + * gdb.c++/cplusfuncs.exp: Fix conflicts between operator names + and regular expression operators by using quoting. + 2001-10-31 Michael Snyder <msnyder@redhat.com> * gdb.c++/overload.exp: Select overloadfnarg(void) or overloadfnarg(), diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp index c2ed85c..80595e3 100644 --- a/gdb/testsuite/gdb.c++/cplusfuncs.exp +++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp @@ -60,6 +60,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb set dm_operator_comma "," set dm_type_char_star "char*" +set dm_type_char_star_quoted "char\\*" set dm_type_foo_ref "foo&" set dm_type_int_star "int*" set dm_type_long_star "long*" @@ -71,6 +72,7 @@ proc probe_demangler { } { global gdb_prompt global dm_operator_comma global dm_type_char_star + global dm_type_char_star_quoted global dm_type_foo_ref global dm_type_int_star global dm_type_long_star @@ -102,6 +104,7 @@ proc probe_demangler { } { -re ".*dm_type_char_star\\(char \\*\\).*\r\n$gdb_prompt $" { # v2 demangler set dm_type_char_star "char *" + set dm_type_char_star_quoted "char \\*" pass "detect dm_type_char_star" } -re ".*dm_type_char_star\\(char\\*\\).*\r\n$gdb_prompt $" { @@ -312,6 +315,7 @@ proc print_addr { name } { proc test_lookup_operator_functions {} { global dm_operator_comma global dm_type_char_star + global dm_type_char_star_quoted global dm_type_foo_ref global dm_type_void global dm_type_void_star @@ -323,7 +327,8 @@ proc test_lookup_operator_functions {} { return } - info_func "operator*(" "void foo::operator*($dm_type_foo_ref);" + # operator* requires quoting so that GDB does not treat it as a regexp. + info_func "operator\\*(" "void foo::operator*($dm_type_foo_ref);" info_func "operator%(" "void foo::operator%($dm_type_foo_ref);" info_func "operator-(" "void foo::operator-($dm_type_foo_ref);" info_func "operator>>(" "void foo::operator>>($dm_type_foo_ref);" @@ -336,7 +341,8 @@ proc test_lookup_operator_functions {} { info_func "operator++(" "void foo::operator++(int);" info_func "operator=(" "void foo::operator=($dm_type_foo_ref);" info_func "operator+=(" "void foo::operator+=($dm_type_foo_ref);" - info_func "operator*=(" "void foo::operator*=($dm_type_foo_ref);" + # operator*= requires quoting so that GDB does not treat it as a regexp. + info_func "operator\\*=(" "void foo::operator*=($dm_type_foo_ref);" info_func "operator%=(" "void foo::operator%=($dm_type_foo_ref);" info_func "operator>>=(" "void foo::operator>>=($dm_type_foo_ref);" info_func "operator|=(" "void foo::operator|=($dm_type_foo_ref);" @@ -359,10 +365,13 @@ proc test_lookup_operator_functions {} { info_func "operator<<=(" "void foo::operator<<=($dm_type_foo_ref);" info_func "operator&=(" "void foo::operator&=($dm_type_foo_ref);" info_func "operator^=(" "void foo::operator^=($dm_type_foo_ref);" - info_func "operator->*(" "void foo::operator->*($dm_type_foo_ref);" + # operator->* requires quoting so that GDB does not treat it as a regexp. + info_func "operator->\\*(" "void foo::operator->*($dm_type_foo_ref);" - # operator[] needs backslashes to protect against TCL evaluation. - info_func "operator\[\](" "void foo::operator\[\]($dm_type_foo_ref);" + # operator[] needs double backslashes, so that a single backslash + # will be sent to GDB, preventing the square brackets from being + # evaluated as a regular expression. + info_func "operator\\\[\\\](" "void foo::operator\[\]($dm_type_foo_ref);" # These are gnarly because they might end with 'static'. set dm_type_void_star_regexp [string_to_regexp $dm_type_void_star] @@ -371,7 +380,7 @@ proc test_lookup_operator_functions {} { info_func "operator int(" "int foo::operator int($dm_type_void);" info_func "operator()(" "void foo::operator()($dm_type_foo_ref);" - info_func "operator $dm_type_char_star\(" \ + info_func "operator $dm_type_char_star_quoted\(" \ "char *foo::operator $dm_type_char_star\($dm_type_void);" } |