This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/testsuite/cp] inherit.exp: accept new gcc output
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: gdb-patches at sources dot redhat dot com, carlton at bactrian dot org
- Date: Sat, 31 Jul 2004 05:49:35 -0400
- Subject: [patch/testsuite/cp] inherit.exp: accept new gcc output
This patch updates inherit.exp to work with gcc HEAD 2004-07-31.
As before, this is mostly enhancing "class ... { public:"
to accept "struct ... {". And with stabs+, some classes no longer
show a synthetic operator=.
Also, the vtbl pointer with multiple inheritance now prints
"$hex = <typeinfo for foo>", not just "$hex". And I removed some
"obsolete gcc or gdb" messages because they were just plain wrong.
Tested on native i686-pc-linux-gnu with gcc 2.95.3, gcc 3.3.4,
gcc 3.4.1, and gcc HEAD 2004-07-31, dwarf-2 and stabs+.
I am committing this now.
Michael C
2004-07-31 Michael Chastain <mec.gnu@mindspring.com>
* gdb.cp/inherit.exp: Accept more varieties of ptype output.
Accept more values of vtbl pointer. Remove some messages
about "obsolete gcc or gdb".
Index: inherit.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/inherit.exp,v
retrieving revision 1.5
diff -c -3 -p -r1.5 inherit.exp
*** inherit.exp 11 Feb 2004 14:01:25 -0000 1.5
--- inherit.exp 31 Jul 2004 09:40:02 -0000
*************** proc test_ptype_si { } {
*** 45,51 ****
# Print class A as a type.
! set re_class "class A \{${ws}public:"
set re_fields "int a;${ws}int x;"
set re_synth_gcc_23 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);"
--- 45,51 ----
# Print class A as a type.
! set re_class "((class|struct) A \{${ws}public:|struct A \{)"
set re_fields "int a;${ws}int x;"
set re_synth_gcc_23 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\((void|)\\);"
*************** proc test_ptype_si { } {
*** 85,91 ****
# Print class B as a type.
! set re_class "class B : public A \{${ws}public:"
set re_fields "int b;${ws}int x;"
set re_synth_gcc_23 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);"
--- 85,91 ----
# Print class B as a type.
! set re_class "((class|struct) B : public A \{${ws}public:|struct B : public A \{)"
set re_fields "int b;${ws}int x;"
set re_synth_gcc_23 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);"
*************** proc test_ptype_si { } {
*** 125,131 ****
# Print class C as a type.
! set re_class "class C : public A \{${ws}public:"
set re_fields "int c;${ws}int x;"
set re_synth_gcc_23 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);"
--- 125,131 ----
# Print class C as a type.
! set re_class "((class|struct) C : public A \{${ws}public:|struct C : public A \{)"
set re_fields "int c;${ws}int x;"
set re_synth_gcc_23 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);"
*************** proc test_ptype_si { } {
*** 177,196 ****
gdb_test_multiple "ptype tagless_struct" $name {
-re "type = $XX_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gdwarf-2
! pass "$name (obsolete gcc or gdb)"
}
-re "type = $re_class${ws}$re_fields${ws}$XX_synth_gcc_23$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gstabs+
! pass "$name (obsolete gcc or gdb)"
}
-re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gdwarf-2
! # gcc HEAD 2004-01-21 -gdwarf-2
! pass "$name (obsolete gcc or gdb)"
}
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gstabs+
! # gcc HEAD 2004-01-21 -gstabs+
pass "$name"
}
}
--- 177,198 ----
gdb_test_multiple "ptype tagless_struct" $name {
-re "type = $XX_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gdwarf-2
! pass "$name"
}
-re "type = $re_class${ws}$re_fields${ws}$XX_synth_gcc_23$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gstabs+
! pass "$name"
}
-re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gdwarf-2
! # gcc 3.4.1 -gdwarf-2
! # gcc HEAD 2004-07-31 -gdwarf-2
! # gcc HEAD 2004-07-31 -gstabs+
! pass "$name"
}
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gstabs+
! # gcc 3.4.1 -gstabs+
pass "$name"
}
}
*************** proc test_ptype_si { } {
*** 199,218 ****
gdb_test_multiple "ptype v_tagless" $name {
-re "type = $XX_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gdwarf-2
! pass "$name (obsolete gcc or gdb)"
}
-re "type = $re_class${ws}$re_fields${ws}$XX_synth_gcc_23$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gstabs+
! pass "$name (obsolete gcc or gdb)"
}
-re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gdwarf-2
! # gcc HEAD 2004-01-21 -gdwarf-2
! pass "$name (obsolete gcc or gdb)"
}
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gstabs+
! # gcc HEAD 2004-01-21 -gstabs+
pass "$name"
}
}
--- 201,222 ----
gdb_test_multiple "ptype v_tagless" $name {
-re "type = $XX_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gdwarf-2
! pass "$name"
}
-re "type = $re_class${ws}$re_fields${ws}$XX_synth_gcc_23$nl\}$nl$gdb_prompt $" {
# gcc 2.95.3 -gstabs+
! pass "$name"
}
-re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gdwarf-2
! # gcc 3.4.1 -gdwarf-2
! # gcc HEAD 2004-07-31 -gdwarf-2
! # gcc HEAD 2004-07-31 -gstabs+
! pass "$name"
}
-re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gstabs+
! # gcc 3.4.1 -gstabs+
pass "$name"
}
}
*************** proc test_ptype_vi { } {
*** 307,313 ****
# ptype vA: type, class, object.
! set re_class "class vA \{${ws}public:"
set re_fields "int va;${ws}int vx;"
set re_synth_gcc_23 "vA & operator=\\(vA const ?&\\);${ws}vA\\(vA const ?&\\);${ws}vA\\((void|)\\);"
--- 311,317 ----
# ptype vA: type, class, object.
! set re_class "((class|struct) vA \{${ws}public:|struct vA \{)"
set re_fields "int va;${ws}int vx;"
set re_synth_gcc_23 "vA & operator=\\(vA const ?&\\);${ws}vA\\(vA const ?&\\);${ws}vA\\((void|)\\);"
*************** proc test_ptype_vi { } {
*** 348,354 ****
set re_access "public:"
set re_fields "int vb;${ws}int vx;"
set re_synth_gcc_2 "vB & operator=\\(vB const ?&\\);${ws}vB\\(int, vB const ?&\\);${ws}vB\\(int\\);"
! set re_synth_gcc_3 "vB & operator=\\(vB const ?&\\);${ws}vB\\(vB const ?&\\);${ws}vB\\((void|)\\);"
set name "ptype vB"
gdb_test_multiple "ptype vB" $name {
--- 352,358 ----
set re_access "public:"
set re_fields "int vb;${ws}int vx;"
set re_synth_gcc_2 "vB & operator=\\(vB const ?&\\);${ws}vB\\(int, vB const ?&\\);${ws}vB\\(int\\);"
! set re_synth_gcc_3 "(vB & operator=\\(vB const ?&\\);${ws}|)vB\\(vB const ?&\\);${ws}vB\\((void|)\\);"
set name "ptype vB"
gdb_test_multiple "ptype vB" $name {
*************** proc test_ptype_vi { } {
*** 423,429 ****
set re_access "public:"
set re_fields "int vc;${ws}int vx;"
set re_synth_gcc_2 "vC & operator=\\(vC const ?&\\);${ws}vC\\(int, vC const ?&\\);${ws}vC\\(int\\);"
! set re_synth_gcc_3 "vC & operator=\\(vC const ?&\\);${ws}vC\\(vC const ?&\\);${ws}vC\\((void|)\\);"
set name "ptype vC"
gdb_test_multiple "ptype vC" $name {
--- 427,433 ----
set re_access "public:"
set re_fields "int vc;${ws}int vx;"
set re_synth_gcc_2 "vC & operator=\\(vC const ?&\\);${ws}vC\\(int, vC const ?&\\);${ws}vC\\(int\\);"
! set re_synth_gcc_3 "(vC & operator=\\(vC const ?&\\);${ws}|)vC\\(vC const ?&\\);${ws}vC\\((void|)\\);"
set name "ptype vC"
gdb_test_multiple "ptype vC" $name {
*************** proc test_ptype_mvi { } {
*** 506,512 ****
set re_access "public:"
set re_fields "int vd;${ws}int vx;"
set re_synth_gcc_2 "vD & operator=\\(vD const ?&\\);${ws}vD\\(int, vD const ?&\\);${ws}vD\\(int\\);"
! set re_synth_gcc_3 "vD & operator=\\(vD const ?&\\);${ws}vD\\(vD const ?&\\);${ws}vD\\((void|)\\);"
set name "ptype vD"
gdb_test_multiple "ptype vD" $name {
--- 510,516 ----
set re_access "public:"
set re_fields "int vd;${ws}int vx;"
set re_synth_gcc_2 "vD & operator=\\(vD const ?&\\);${ws}vD\\(int, vD const ?&\\);${ws}vD\\(int\\);"
! set re_synth_gcc_3 "(vD & operator=\\(vD const ?&\\);${ws}|)vD\\(vD const ?&\\);${ws}vD\\((void|)\\);"
set name "ptype vD"
gdb_test_multiple "ptype vD" $name {
*************** proc test_ptype_mvi { } {
*** 581,587 ****
set re_access "public:"
set re_fields "int ve;${ws}int vx;"
set re_synth_gcc_2 "vE & operator=\\(vE const ?&\\);${ws}vE\\(int, vE const ?&\\);${ws}vE\\(int\\);"
! set re_synth_gcc_3 "vE & operator=\\(vE const ?&\\);${ws}vE\\(vE const ?&\\);${ws}vE\\((void|)\\);"
set name "ptype vE"
gdb_test_multiple "ptype vE" $name {
--- 585,591 ----
set re_access "public:"
set re_fields "int ve;${ws}int vx;"
set re_synth_gcc_2 "vE & operator=\\(vE const ?&\\);${ws}vE\\(int, vE const ?&\\);${ws}vE\\(int\\);"
! set re_synth_gcc_3 "(vE & operator=\\(vE const ?&\\);${ws}|)vE\\(vE const ?&\\);${ws}vE\\((void|)\\);"
set name "ptype vE"
gdb_test_multiple "ptype vE" $name {
*************** proc test_print_anon_union {} {
*** 812,818 ****
}
}
! set re_class "class class_with_anon_union \{${ws}public:"
set re_fields "int one;${ws}"
set re_anon_union "union \{${ws}int a;${ws}long int b;${ws}\};"
set re_synth_gcc_23 "class_with_anon_union & operator=\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\((void|)\\);"
--- 816,822 ----
}
}
! set re_class "((struct|class) class_with_anon_union \{${ws}public:|struct class_with_anon_union \{)"
set re_fields "int one;${ws}"
set re_anon_union "union \{${ws}int a;${ws}long int b;${ws}\};"
set re_synth_gcc_23 "class_with_anon_union & operator=\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\((void|)\\);"
*************** proc test_print_svi_classes { } {
*** 888,900 ****
pass $name
}
-re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gdwarf-2
! # gcc HEAD 2004-01-21 -gdwarf-2
! # gcc HEAD 2004-01-21 -gstabs+
pass "$name (FIXME v3 vtbl ptr)"
}
-re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex <VTT for vB>, vb = 5, vx = 6\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gstabs+
pass $name
}
}
--- 892,909 ----
pass $name
}
-re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gdwarf-2
! # gcc 3.4.1 -gdwarf-2
! # gcc 3.4.1 -gstabs+
! # gcc HEAD 2004-07-31 -gdwarf-2
pass "$name (FIXME v3 vtbl ptr)"
}
-re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex <VTT for vB>, vb = 5, vx = 6\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gstabs+
! pass $name
! }
! -re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = $hex <typeinfo for vB>, vb = 5, vx = 6\}$nl$gdb_prompt $" {
! # gcc HEAD 2004-07-31 -gstabs+
pass $name
}
}
*************** proc test_print_svi_classes { } {
*** 911,923 ****
pass $name
}
-re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gdwarf-2
! # gcc HEAD 2004-01-21 -gdwarf-2
! # gcc HEAD 2004-01-21 -gstabs+
pass "$name (FIXME v3 vtbl ptr)"
}
-re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex <VTT for vC>, vc = 9, vx = 10\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gstabs+
pass $name
}
}
--- 920,937 ----
pass $name
}
-re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gdwarf-2
! # gcc 3.4.1 -gdwarf-2
! # gcc 3.4.1 -gstabs+
! # gcc HEAD 2004-07-31 -gdwarf-2
pass "$name (FIXME v3 vtbl ptr)"
}
-re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex <VTT for vC>, vc = 9, vx = 10\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gstabs+
! pass $name
! }
! -re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = $hex <typeinfo for vC>, vc = 9, vx = 10\}$nl$gdb_prompt $" {
! # gcc HEAD 2004-07-31 -gstabs+
pass $name
}
}
*************** proc test_print_mvi_classes { } {
*** 1003,1017 ****
pass $name
}
-re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
! # gcc 3.3.2 -gdwarf-2
! # gcc 3.3.2 -gstabs+
! # gcc HEAD 2004-01-21 -gdwarf-2
! # gcc HEAD 2004-01-21 -gstabs+
pass "$name (FIXME v3 vtbl ptr)"
}
-re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex <VTT for vD>, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
# gcc 3.2.7-rh -gstabs+
! pass "$name (FIXME v3 vtbl ptr)"
}
}
}
--- 1017,1036 ----
pass $name
}
-re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
! # gcc 3.3.4 -gdwarf-2
! # gcc 3.3.4 -gstabs+
! # gcc 3.4.1 -gdwarf-2
! # gcc 3.4.1 -gstabs+
! # gcc HEAD 2004-07-31 -gdwarf-2
pass "$name (FIXME v3 vtbl ptr)"
}
-re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex <VTT for vD>, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
# gcc 3.2.7-rh -gstabs+
! pass $name
! }
! -re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = $hex, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = $hex <typeinfo for vE>, vc = 0, vx = 0\}, $re_vbptr_3_vD = $hex, vd = 0, vx = 0\}, $re_vbptr_3_vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
! # gcc HEAD 2004-07-31 -gstabs+
! pass $name
}
}
}