This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] gdb.c++/method.exp: improve "const this" test


Here is an update to method.exp.  This improves the test report in
some XFAIL and FAIL situations when gdb drops the "const" from a
"const this" pointer.

Shout out to Daniel J.

Michael C

2002-04-08  Michael Chastain  <mec@shout.net>

	* gdb.c++/method.exp: Require "const ... A * ..." for "ptype this"
	in a const method.  Add some xfail and fail cases for configurations
	that do not emit the "const ...".

Index: gdb.c++/method.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/method.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 method.exp
*** gdb.c++/method.exp	8 Apr 2002 07:23:19 -0000	1.6
--- gdb.c++/method.exp	8 Apr 2002 22:31:42 -0000
*************** gdb_test "print x" \
*** 107,115 ****
  
  # Check access to this pointer       
  
! gdb_test "print this" \
!   "\\$\[0-9\]* = \\((const |)(class |)A *\\* *(const|)\\) $hex" \
!   "print this in A::bar"
  
  # Check again with funk::getFunky (this is the original test case
  # for CHFts23426); sometimes having a constructor with no arguments
--- 107,135 ----
  
  # Check access to this pointer       
  
! get_debug_format
! 
! send_gdb "print this\n"
! gdb_expect {
!   -re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
!     pass "print this in A::bar"
!   }
!   -re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
!     # gcc versions up to 3.0.4 with -gstabs+ do not emit "const" indicators,
!     # so the output is "A *".  It should be "const A *" or "const A * const".
!     setup_xfail_format "stabs"
!     fail "print this in A::bar (missing const)"
!   }
!   -re "\\$\[0-9\]* = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
!     # gcc versions gcc-3_1-branch%20020404 and HEAD%20020404 with -gstabs+
!     # produce good stabs, but gdb prints "const class {...} *" const.
!     # This is PR gdb/277.
!     # setup_kfail "gnats:gdb/277"
!     fail "print this in A::bar (gnats:gdb/277)"
!   }
!   -re ".*$gdb_prompt $" { fail "print this in A::bar" }
!   timeout { fail "(timeout) print this in A::bar" }
! }
  
  # Check again with funk::getFunky (this is the original test case
  # for CHFts23426); sometimes having a constructor with no arguments


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]