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/testsuite/cp] local.exp: accept gcc v3 -gstabs+


This patch updates one test in local.exp:

  (db) ptype InnerLocal::NestedInnerLocal

gdb improved recently with gcc v3 stabs+.  gdb used to print
"There is no field names NestedInnerLocal", and the test gave a result
of KFAIL.  Now, gdb prints the desired structure.

I tested this on native i686-pc-linux-gnu with gcc 2.95.3, gcc 3.3.2,
and gcc HEAD, with dwarf-2 and stabs+.  The results improved from
KFAIL to PASS on the two v3 stabs+ configurations.  The results are the
same as before with the other four configurations.

I would like to rewrite all of local.exp in the new style,
which I think is easier to read, and handles all the possibilities of
synthetic operations more gracefully.  But not right now.

IACTN,

Michael C

2004-01-18  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.cp/local.exp: Accept correct output for gcc v3 -gstabs+.

Index: local.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/local.exp,v
retrieving revision 1.2
diff -c -3 -p -r1.2 local.exp
*** local.exp	3 Jan 2004 01:46:09 -0000	1.2
--- local.exp	19 Jan 2004 03:58:55 -0000
***************
*** 25,30 ****
--- 25,33 ----
  
  # This file is part of the gdb testsuite
  
+ set ws "\[\r\n\t \]+"
+ set nl "\[\r\n\]+"
+ 
  if $tracelevel then {
          strace $tracelevel
          }
*************** gdb_expect {
*** 220,249 ****
    timeout             { fail "(timeout) ptype NestedInnerLocal" }
  }
  
! # gdb incorrectly interprets the NestedInnerLocal in
! # InnerLocal::NestedInnerLocal as field name instead of a type name;
! # See CLLbs14784.
! 
! #---
! # Pattern 3:
! # FAIL
! # The comment above, about CLLbs14784, is still correct.
! #   dwarf-2
! #     gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
! #   stabs+
! #     gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
! #
! # chastain 2002-04-08
! 
! send_gdb "ptype InnerLocal::NestedInnerLocal\n"
! gdb_expect {
!   -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
!   -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
!   -re "There is no field named NestedInnerLocal.*$gdb_prompt $" {
!     setup_kfail "gdb/482" *-*-*
!     fail "ptype InnerLocal::NestedInnerLocal"
!   }
!   -re "No symbol .*NestedInnerLocal.* in current context.*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal (bogus symbol lookup)" }
!   -re ".*$gdb_prompt $"   {  fail "ptype InnerLocal::NestedInnerLocal" }
!   timeout             { fail "(timeout) ptype InnerLocal::NestedInnerLocal" }
  }
--- 223,250 ----
    timeout             { fail "(timeout) ptype NestedInnerLocal" }
  }
  
! set re_class		"((struct|class) InnerLocal::NestedInnerLocal \{${ws}public:|struct InnerLocal::NestedInnerLocal \{)"
! set re_fields		"int nil;"
! set re_methods		"int nil_foo\\(int\\);"
! set re_synth_gcc_23	"InnerLocal::NestedInnerLocal & operator=\\(InnerLocal::NestedInnerLocal const ?&\\);${ws}NestedInnerLocal\\(InnerLocal::NestedInnerLocal const ?&\\);${ws}NestedInnerLocal\\(\\);"
! 
! set name "ptype InnerLocal::NestedInnerLocal"
! gdb_test_multiple "ptype InnerLocal::NestedInnerLocal" $name {
!     -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! 	# gcc -gdwarf-2 should produce this but does not yet
! 	pass $name
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods${ws}$nl\}$nl$gdb_prompt $" {
! 	# gcc 2.95.3 -gstabs+
! 	# gcc v3 -gstabs+, abi 1
! 	pass $name
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" {
! 	# gcc v3 -gstabs+, abi 2
! 	pass $name
!     }
!     -re "There is no field named NestedInnerLocal.*$gdb_prompt $" {
! 	# gcc v3 -gdwarf-2
! 	kfail "gdb/482" $name
!     }
  }


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