"ptype" from calls to cp_test_ptype_class.
(test_enums): Likewise.
* gdb.cp/derivation.exp: Remove "ptype" from calls to
cp_test_ptype_class.
* gdb.cp/inherit.exp (test_ptype_si): Remove "ptype" from
calls to cp_test_ptype_class.
(test_ptype_mi, test_ptype_vi, test_ptype_mvi): Likewise.
* gdb.cp/virtfunc.exp (test_ptype_of_classes): Remove "ptype"
from calls to cp_test_ptype_class.
* lib/cp-support.exp (cp_test_ptype_class): Supply "ptype"
command here. Change "in_command" argument to "in_exp".
+2012-11-12 Tom Tromey <tromey@redhat.com>
+
+ * gdb.cp/classes.exp (test_ptype_class_objects): Remove
+ "ptype" from calls to cp_test_ptype_class.
+ (test_enums): Likewise.
+ * gdb.cp/derivation.exp: Remove "ptype" from calls to
+ cp_test_ptype_class.
+ * gdb.cp/inherit.exp (test_ptype_si): Remove "ptype" from
+ calls to cp_test_ptype_class.
+ (test_ptype_mi, test_ptype_vi, test_ptype_mvi): Likewise.
+ * gdb.cp/virtfunc.exp (test_ptype_of_classes): Remove "ptype"
+ from calls to cp_test_ptype_class.
+ * lib/cp-support.exp (cp_test_ptype_class): Supply "ptype"
+ command here. Change "in_command" argument to "in_exp".
+
2012-11-10 Keith Seitz <keiths@redhat.com>
PR gdb/14288
# Simple type.
cp_test_ptype_class \
- "ptype struct default_public_struct" "" "struct" "default_public_struct" \
+ "struct default_public_struct" "" "struct" "default_public_struct" \
{
{ field public "int a;" }
{ field public "int b;" }
# Another simple type.
cp_test_ptype_class \
- "ptype struct explicit_public_struct" "" "struct" "explicit_public_struct" \
+ "struct explicit_public_struct" "" "struct" "explicit_public_struct" \
{
{ field public "int a;" }
{ field public "int b;" }
# Another simple type.
cp_test_ptype_class \
- "ptype struct protected_struct" "" "struct" "protected_struct" \
+ "struct protected_struct" "" "struct" "protected_struct" \
{
{ field protected "int a;" }
{ field protected "int b;" }
# Another simple type.
cp_test_ptype_class \
- "ptype struct private_struct" "" "struct" "private_struct" \
+ "struct private_struct" "" "struct" "private_struct" \
{
{ field private "int a;" }
{ field private "int b;" }
# A bigger type.
cp_test_ptype_class \
- "ptype struct mixed_protection_struct" "" "struct" "mixed_protection_struct" \
+ "struct mixed_protection_struct" "" "struct" "mixed_protection_struct" \
{
{ field public "int a;" }
{ field public "int b;" }
# gdb does not care about the difference anyways.
cp_test_ptype_class \
- "ptype class public_class" "" "class" "public_class" \
+ "class public_class" "" "class" "public_class" \
{
{ field public "int a;" }
{ field public "int b;" }
# Another simple type.
cp_test_ptype_class \
- "ptype class protected_class" "" "class" "protected_class" \
+ "class protected_class" "" "class" "protected_class" \
{
{ field protected "int a;" }
{ field protected "int b;" }
# Another simple type.
cp_test_ptype_class \
- "ptype class default_private_class" "" "class" "default_private_class" \
+ "class default_private_class" "" "class" "default_private_class" \
{
{ field private "int a;" }
{ field private "int b;" }
# Another simple type.
cp_test_ptype_class \
- "ptype class explicit_private_class" "" "class" "explicit_private_class" \
+ "class explicit_private_class" "" "class" "explicit_private_class" \
{
{ field private "int a;" }
{ field private "int b;" }
# A bigger type.
cp_test_ptype_class \
- "ptype class mixed_protection_class" "" "class" "mixed_protection_class" \
+ "class mixed_protection_class" "" "class" "mixed_protection_class" \
{
{ field public "int a;" }
# Base class.
cp_test_ptype_class \
- "ptype class A" "" "class" "A" \
+ "class A" "" "class" "A" \
{
{ field public "int a;" }
{ field public "int x;" }
# Derived class.
cp_test_ptype_class \
- "ptype class B" "" "class" "B" \
+ "class B" "" "class" "B" \
{
{ base "public A" }
{ field public "int b;" }
# Derived class.
cp_test_ptype_class \
- "ptype class C" "" "class" "C" \
+ "class C" "" "class" "C" \
{
{ base "public A" }
{ field public "int c;" }
# Derived class, multiple inheritance.
cp_test_ptype_class \
- "ptype class D" "" "class" "D" \
+ "class D" "" "class" "D" \
{
{ base "public B" }
{ base "public C" }
# Derived class.
cp_test_ptype_class \
- "ptype class E" "" "class" "E" \
+ "class E" "" "class" "E" \
{
{ base "public D" }
{ field public "int e;" }
# static methods whose name is the same as their argument mangling.
cp_test_ptype_class \
- "ptype class Static" "" "class" "Static" \
+ "class Static" "" "class" "Static" \
{
{ method public "static void ii(int, int);" }
}
# A virtual base class.
cp_test_ptype_class \
- "ptype class vA" "" "class" "vA" \
+ "class vA" "" "class" "vA" \
{
{ field public "int va;" }
{ field public "int vx;" }
# A derived class with a virtual base.
cp_test_ptype_class \
- "ptype class vB" "" "class" "vB" \
+ "class vB" "" "class" "vB" \
{
{ base "public virtual vA" }
{ vbase "vA" }
# Another derived class with a virtual base.
cp_test_ptype_class \
- "ptype class vC" "" "class" "vC" \
+ "class vC" "" "class" "vC" \
{
{ base "public virtual vA" }
{ vbase "vA" }
# A classic diamond class.
cp_test_ptype_class \
- "ptype class vD" "" "class" "vD" \
+ "class vD" "" "class" "vD" \
{
{ base "public virtual vB" }
{ base "public virtual vC" }
# A class derived from a diamond class.
cp_test_ptype_class \
- "ptype class vE" "" "class" "vE" \
+ "class vE" "" "class" "vE" \
{
{ base "public virtual vD" }
{ vbase "vD" }
# A base class.
cp_test_ptype_class \
- "ptype class Base1" "" "class" "Base1" \
+ "class Base1" "" "class" "Base1" \
{
{ field public "int x;" }
{ method public "Base1(int);" }
# Another base class.
cp_test_ptype_class \
- "ptype class Foo" "" "class" "Foo" \
+ "class Foo" "" "class" "Foo" \
{
{ field public "int x;" }
{ field public "int y;" }
# A multiple inheritance derived class.
cp_test_ptype_class \
- "ptype class Bar" "" "class" "Bar" \
+ "class Bar" "" "class" "Bar" \
{
{ base "public Base1" }
{ base "public Foo" }
# stabs, we probably can't get this right; under DWARF-2, we can.
cp_test_ptype_class \
- "ptype obj_with_enum" "" "class" "ClassWithEnum" \
+ "obj_with_enum" "" "class" "ClassWithEnum" \
{
{ field public "ClassWithEnum::PrivEnum priv_enum;" }
{ field public "int x;" }
gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance"
cp_test_ptype_class \
- "ptype a_instance" "" "class" "A" \
+ "a_instance" "" "class" "A" \
{
{ field public "int a;" }
{ field public "int aa;" }
}
cp_test_ptype_class \
- "ptype d_instance" "" "class" "D" \
+ "d_instance" "" "class" "D" \
{
{ base "private A" }
{ base "public B" }
}
cp_test_ptype_class \
- "ptype e_instance" "" "class" "E" \
+ "e_instance" "" "class" "E" \
{
{ base "public A" }
{ base "private B" }
}
cp_test_ptype_class \
- "ptype f_instance" "" "class" "F" \
+ "f_instance" "" "class" "F" \
{
{ base "private A" }
{ base "public B" }
# class G
cp_test_ptype_class \
- "ptype g_instance" "" "class" "G" \
+ "g_instance" "" "class" "G" \
{
{ base "private A" }
{ base "public B" }
# A simple class.
cp_test_ptype_class \
- "ptype A" "ptype A (FIXME)" "class" "A" \
+ "A" "ptype A (FIXME)" "class" "A" \
{
{ field public "int a;" }
{ field public "int x;" }
}
- cp_test_ptype_class "ptype class A" "ptype class A (FIXME)" "class" "A" ibid
- cp_test_ptype_class "ptype g_A" "ptype g_A (FIXME)" "class" "A" ibid
+ cp_test_ptype_class "class A" "ptype class A (FIXME)" "class" "A" ibid
+ cp_test_ptype_class "g_A" "ptype g_A (FIXME)" "class" "A" ibid
# A derived class.
cp_test_ptype_class \
- "ptype B" "" "class" "B" \
+ "B" "" "class" "B" \
{
{ base "public A" }
{ field public "int b;" }
{ field public "int x;" }
}
- cp_test_ptype_class "ptype class B" "" "class" "B" ibid
- cp_test_ptype_class "ptype g_B" "" "class" "B" ibid
+ cp_test_ptype_class "class B" "" "class" "B" ibid
+ cp_test_ptype_class "g_B" "" "class" "B" ibid
# Another derived class.
cp_test_ptype_class \
- "ptype C" "" "class" "C" \
+ "C" "" "class" "C" \
{
{ base "public A" }
{ field public "int c;" }
{ field public "int x;" }
}
- cp_test_ptype_class "ptype class C" "" "class" "C" ibid
- cp_test_ptype_class "ptype g_C" "" "class" "C" ibid
+ cp_test_ptype_class "class C" "" "class" "C" ibid
+ cp_test_ptype_class "g_C" "" "class" "C" ibid
# A structure with no tag.
# TODO: move this mess into a separate file, and re-specify
# A class with two bases.
cp_test_ptype_class \
- "ptype D" "" "class" "D" \
+ "D" "" "class" "D" \
{
{ base "public B" }
{ base "public C" }
{ field public "int d;" }
{ field public "int x;" }
}
- cp_test_ptype_class "ptype class D" "" "class" "D" ibid
- cp_test_ptype_class "ptype g_D" "" "class" "D" ibid
+ cp_test_ptype_class "class D" "" "class" "D" ibid
+ cp_test_ptype_class "g_D" "" "class" "D" ibid
# A class derived from the previous class.
cp_test_ptype_class \
- "ptype E" "" "class" "E" \
+ "E" "" "class" "E" \
{
{ base "public D" }
{ field public "int e;" }
{ field public "int x;" }
}
- cp_test_ptype_class "ptype class E" "" "class" "E" ibid
- cp_test_ptype_class "ptype g_E" "" "class" "E" ibid
+ cp_test_ptype_class "class E" "" "class" "E" ibid
+ cp_test_ptype_class "g_E" "" "class" "E" ibid
}
# Single virtual inheritance, print type definitions.
# class vA
cp_test_ptype_class \
- "ptype vA" "" "class" "vA" \
+ "vA" "" "class" "vA" \
{
{ field public "int va;" }
{ field public "int vx;" }
}
- cp_test_ptype_class "ptype class vA" "" "class" "vA" ibid
- cp_test_ptype_class "ptype g_vA" "" "class" "vA" ibid
+ cp_test_ptype_class "class vA" "" "class" "vA" ibid
+ cp_test_ptype_class "g_vA" "" "class" "vA" ibid
# class vB
cp_test_ptype_class \
- "ptype vB" "" "class" "vB" \
+ "vB" "" "class" "vB" \
{
{ base "public virtual vA" }
{ vbase "vA" }
{ field public "int vb;" }
{ field public "int vx;" }
}
- cp_test_ptype_class "ptype class vB" "" "class" "vB" ibid
- cp_test_ptype_class "ptype g_vB" "" "class" "vB" ibid
+ cp_test_ptype_class "class vB" "" "class" "vB" ibid
+ cp_test_ptype_class "g_vB" "" "class" "vB" ibid
# class vC
cp_test_ptype_class \
- "ptype vC" "" "class" "vC" \
+ "vC" "" "class" "vC" \
{
{ base "public virtual vA" }
{ vbase "vA" }
{ field public "int vc;" }
{ field public "int vx;" }
}
- cp_test_ptype_class "ptype class vC" "" "class" "vC" ibid
- cp_test_ptype_class "ptype g_vC" "" "class" "vC" ibid
+ cp_test_ptype_class "class vC" "" "class" "vC" ibid
+ cp_test_ptype_class "g_vC" "" "class" "vC" ibid
}
# class vD
cp_test_ptype_class \
- "ptype vD" "" "class" "vD" \
+ "vD" "" "class" "vD" \
{
{ base "public virtual vB" }
{ base "public virtual vC" }
{ field public "int vd;" }
{ field public "int vx;" }
}
- cp_test_ptype_class "ptype class vD" "" "class" "vD" ibid
- cp_test_ptype_class "ptype g_vD" "" "class" "vD" ibid
+ cp_test_ptype_class "class vD" "" "class" "vD" ibid
+ cp_test_ptype_class "g_vD" "" "class" "vD" ibid
# class vE
cp_test_ptype_class \
- "ptype vE" "" "class" "vE" \
+ "vE" "" "class" "vE" \
{
{ base "public virtual vD" }
{ vbase "vD" }
{ field public "int ve;" }
{ field public "int vx;" }
}
- cp_test_ptype_class "ptype class vE" "" "class" "vE" ibid
- cp_test_ptype_class "ptype g_vE" "" "class" "vE" ibid
+ cp_test_ptype_class "class vE" "" "class" "vE" ibid
+ cp_test_ptype_class "g_vE" "" "class" "vE" ibid
}
# class VA
cp_test_ptype_class \
- "ptype VA" "" "class" "VA" \
+ "VA" "" "class" "VA" \
{
{ field public "int va;" }
}
# class VB
cp_test_ptype_class \
- "ptype VB" "" "class" "VB" \
+ "VB" "" "class" "VB" \
{
{ field public "int vb;" }
{ method public "int fvb();" }
# class V
cp_test_ptype_class \
- "ptype V" "" "class" "V" \
+ "V" "" "class" "V" \
{
{ base "public VA" }
{ base "public VB" }
# class A
cp_test_ptype_class \
- "ptype A" "" "class" "A" \
+ "A" "" "class" "A" \
{
{ base "public virtual V" }
{ vbase "V" }
# class B
cp_test_ptype_class \
- "ptype B" "" "class" "B" \
+ "B" "" "class" "B" \
{
{ base "public A" }
{ field private "int b;" }
# class C
cp_test_ptype_class \
- "ptype C" "" "class" "C" \
+ "C" "" "class" "C" \
{
{ base "public virtual V" }
{ vbase "V" }
# class AD
cp_test_ptype_class \
- "ptype AD" "" "class" "AD" \
+ "AD" "" "class" "AD" \
{
{ method public "virtual int vg();" }
}
# class D
cp_test_ptype_class \
- "ptype D" "" "class" "D" \
+ "D" "" "class" "D" \
{
{ base "public AD" }
{ base "public virtual V" }
# class E
cp_test_ptype_class \
- "ptype E" "" "class" "E" \
+ "E" "" "class" "E" \
{
{ base "public B" }
{ base "public virtual V" }
# An instance of D
- cp_test_ptype_class "ptype dd" "" "class" "D" ibid
+ cp_test_ptype_class "dd" "" "class" "D" ibid
# An instance of D *
- cp_test_ptype_class "ptype ppd" "" "class" "D" ibid "*"
+ cp_test_ptype_class "ppd" "" "class" "D" ibid "*"
# An instance of AD *
# TODO: this should be named pADd, not pAd.
- cp_test_ptype_class "ptype pAd" "" "class" "AD" ibid "*"
+ cp_test_ptype_class "pAd" "" "class" "AD" ibid "*"
# Instances of these classes.
- cp_test_ptype_class "ptype a" "" "class" "A" ibid
- cp_test_ptype_class "ptype b" "" "class" "B" ibid
- cp_test_ptype_class "ptype c" "" "class" "C" ibid
- cp_test_ptype_class "ptype d" "" "class" "D" ibid
- cp_test_ptype_class "ptype e" "" "class" "E" ibid
- cp_test_ptype_class "ptype v" "" "class" "V" ibid
- cp_test_ptype_class "ptype vb" "" "class" "VB" ibid
+ cp_test_ptype_class "a" "" "class" "A" ibid
+ cp_test_ptype_class "b" "" "class" "B" ibid
+ cp_test_ptype_class "c" "" "class" "C" ibid
+ cp_test_ptype_class "d" "" "class" "D" ibid
+ cp_test_ptype_class "e" "" "class" "E" ibid
+ cp_test_ptype_class "v" "" "class" "V" ibid
+ cp_test_ptype_class "vb" "" "class" "VB" ibid
# Instances of pointers to these classes.
- cp_test_ptype_class "ptype pAa" "" "class" "A" ibid "*"
- cp_test_ptype_class "ptype pAe" "" "class" "A" ibid "*"
- cp_test_ptype_class "ptype pBe" "" "class" "B" ibid "*"
- cp_test_ptype_class "ptype pDd" "" "class" "D" ibid "*"
- cp_test_ptype_class "ptype pDe" "" "class" "D" ibid "*"
- cp_test_ptype_class "ptype pVa" "" "class" "V" ibid "*"
- cp_test_ptype_class "ptype pVv" "" "class" "V" ibid "*"
- cp_test_ptype_class "ptype pVe" "" "class" "V" ibid "*"
- cp_test_ptype_class "ptype pVd" "" "class" "V" ibid "*"
- cp_test_ptype_class "ptype pADe" "" "class" "AD" ibid "*"
- cp_test_ptype_class "ptype pEe" "" "class" "E" ibid "*"
- cp_test_ptype_class "ptype pVB" "" "class" "VB" ibid "*"
+ cp_test_ptype_class "pAa" "" "class" "A" ibid "*"
+ cp_test_ptype_class "pAe" "" "class" "A" ibid "*"
+ cp_test_ptype_class "pBe" "" "class" "B" ibid "*"
+ cp_test_ptype_class "pDd" "" "class" "D" ibid "*"
+ cp_test_ptype_class "pDe" "" "class" "D" ibid "*"
+ cp_test_ptype_class "pVa" "" "class" "V" ibid "*"
+ cp_test_ptype_class "pVv" "" "class" "V" ibid "*"
+ cp_test_ptype_class "pVe" "" "class" "V" ibid "*"
+ cp_test_ptype_class "pVd" "" "class" "V" ibid "*"
+ cp_test_ptype_class "pADe" "" "class" "AD" ibid "*"
+ cp_test_ptype_class "pEe" "" "class" "E" ibid "*"
+ cp_test_ptype_class "pVB" "" "class" "VB" ibid "*"
}
# each line, matching it to the class description given in the
# parameters.
#
-# IN_COMMAND and IN_TESTNAME are the command and testname for
+# IN_EXP is the expression to use; the appropriate "ptype" invocation
+# is prepended to it. IN_TESTNAME is the testname for
# gdb_test_multiple. If IN_TESTNAME is the empty string, then it
-# defaults to IN_COMMAND.
+# defaults to "ptype IN_EXP".
#
# IN_KEY is "class" or "struct". For now, I ignore it, and allow either
# "class" or "struct" in the output, as long as the access specifiers all
#
# -- chastain 2004-08-07
-proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table { in_tail "" } { in_errata_table { } } } {
+proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table { in_tail "" } { in_errata_table { } } } {
global gdb_prompt
set wsopt "\[\r\n\t \]*"
# The test name defaults to the command.
- if { "$in_testname" == "" } then { set in_testname "$in_command" }
+ if { "$in_testname" == "" } then { set in_testname "ptype $in_exp" }
+
+ set in_command "ptype $in_exp"
# Save class tables in a history array for reuse.