[RFC] const qualifiers in gdb.c++/method.exp

Fred Fish fnf@fred.ninemoons.com
Tue Jan 8 09:47:00 GMT 2002


The current testsuite has some C++ failures that are due simply to not
accepting const in some cases.  I'm not familiar enough with C++ to
know whether or not the const qualifiers are correct or not, so it
would be great if a more C++ literate developer could review these
changes and see if they are reasonable or not.  Thanks!

-Fred

2002-01-08  Fred Fish  <fnf@redhat.com>

	* gdb.c++/method.exp:  Optionally accept some const qualifiers for:
	"print this (in foo)"
	"print this (in bar)"
        "print this in getFunky"
        "ptype A"


Index: gdb.c++/method.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/method.exp,v
retrieving revision 1.3
diff -u -p -r1.3 method.exp
--- method.exp	2001/12/07 22:02:23	1.3
+++ method.exp	2002/01/08 17:40:38
@@ -103,7 +103,7 @@ gdb_expect {
 
 send_gdb "print this\n"
 gdb_expect {
-   -re "\\$\[0-9\]* = \\(A \\*\\) $hex\r\n$gdb_prompt $" {
+   -re "\\$\[0-9\]* = \\(A \\*( const)?\\) $hex\r\n$gdb_prompt $" {
        pass "print this (in foo)"
    }
    -re ".*$gdb_prompt $" { fail "print this (in foo)" }
@@ -154,7 +154,7 @@ gdb_expect {
        pass "print this (in bar)"
      }
    }
-   -re "\\$\[0-9\]* = \\(A \\*\\) $hex\r\n$gdb_prompt $" {
+   -re "\\$\[0-9\]* = \\((const )?A \\*( const)?\\) $hex\r\n$gdb_prompt $" {
      global gcc_compiled
      if {$gcc_compiled} {
        pass "print this (in bar)"
@@ -203,7 +203,7 @@ gdb_expect {
 
 send_gdb "print this\n"
 gdb_expect {
-   -re "\\$\[0-9\]* = \\(funk \\*\\) $hex\r\n$gdb_prompt $" {
+   -re "\\$\[0-9\]* = \\(funk \\*( const)?\\) $hex\r\n$gdb_prompt $" {
        pass "print this in getFunky"
    }
    -re ".*$gdb_prompt $" { fail "print this in getfunky" }
@@ -226,7 +226,7 @@ gdb_expect {
 
 send_gdb "ptype A\n"
 gdb_expect {
-   -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*A & operator=\\(A const ?&\\);\r\n\[ \]*A\\(A const ?&\\);\r\n\[ \]*A\\((void|)\\);\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) (const volatile|volatile const);\r\n\}\r\n$gdb_prompt $" {
+   -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*A & operator=\\(A const ?&\\);\r\n\[ \]*A\\((A const|const A) ?&\\);\r\n\[ \]*A\\((void|)\\);\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) (const volatile|volatile const);\r\n\}\r\n$gdb_prompt $" {
       pass "ptype A"
    }
    -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\);\r\n\[ \]*int qux\\(int, float\\) const;\r\n\}\r\n$gdb_prompt $" {



More information about the Gdb-patches mailing list