-# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
-# 2004 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file was written by Fred Fish. (fnf@cygnus.com)
# And rewritten by Michael Chastain. (mec.gnu@mindspring.com)
set nl "\[\r\n\]+"
set vhn "\\$\[0-9\]+"
-if $tracelevel then {
- strace $tracelevel
-}
-
if { [skip_cplus_tests] } { continue }
-set testfile "inherit"
-set srcfile misc.cc
-set binfile ${objdir}/${subdir}/${testfile}
+load_lib "cp-support.exp"
+
+standard_testfile misc.cc
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+ return -1
}
# Single inheritance, print type definitions.
global ws
global nl
- # 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|)\\);"
-
- set name "ptype A (FIXME)"
- gdb_test_multiple "ptype A" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- # Print class A as an explicit class.
-
- set name "ptype class A (FIXME)"
- gdb_test_multiple "ptype class A" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- # Print type of an object of type A.
-
- set name "ptype g_A (FIXME)"
- gdb_test_multiple "ptype g_A" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- # 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|)\\);"
-
- set name "ptype B"
- gdb_test_multiple "ptype B" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- # Print class B as an explicit class.
-
- set name "ptype class B"
- gdb_test_multiple "ptype class B" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- # Print type of an object of type B.
+ # A simple class.
- set name "ptype g_B"
- gdb_test_multiple "ptype g_B" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- # 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|)\\);"
-
- set name "ptype C"
- gdb_test_multiple "ptype C" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "A" "ptype A (FIXME)" "class" "A" \
+ {
+ { field public "int a;" }
+ { field public "int x;" }
}
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
+ 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
- # Print class C as an explicit class.
+ # A derived class.
- set name "ptype class C"
- gdb_test_multiple "ptype class C" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "B" "" "class" "B" \
+ {
+ { base "public A" }
+ { field public "int b;" }
+ { field public "int x;" }
}
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
+ cp_test_ptype_class "class B" "" "class" "B" ibid
+ cp_test_ptype_class "g_B" "" "class" "B" ibid
- # Print type of an object of type g_C.
+ # Another derived class.
- set name "ptype g_C"
- gdb_test_multiple "ptype g_C" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "C" "" "class" "C" \
+ {
+ { base "public A" }
+ { field public "int c;" }
+ { field public "int x;" }
}
- }
+ cp_test_ptype_class "class C" "" "class" "C" ibid
+ cp_test_ptype_class "g_C" "" "class" "C" ibid
- # Print a structure with no tag.
+ # A structure with no tag.
+ # TODO: move this mess into a separate file, and re-specify
+ # which results are PASS, KFAIL, XFAIL, and FAIL.
set re_tag "tagless_struct"
set XX_tag "\\._1"
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)"
+ 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 (obsolete gcc or gdb)"
+ pass "$name"
}
-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)"
+ # 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.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
+ # gcc 3.3.4 -gstabs+
+ # gcc 3.4.1 -gstabs+
pass "$name"
}
+ -re "No symbol \"tagless_struct\" in current context.$nl$gdb_prompt $" {
+ # Several GCC 4.x versions provide neither a DW_TAG_typedef DIE
+ # nor use the typedef name as struct tag name.
+ xfail "$name"
+ }
}
set name "ptype variable of type tagless struct"
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)"
+ 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 (obsolete gcc or gdb)"
+ pass "$name"
}
-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)"
+ # 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.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
+ # gcc 3.3.4 -gstabs+
+ # gcc 3.4.1 -gstabs+
pass "$name"
}
}
# Multiple inheritance, print type definitions.
proc test_ptype_mi { } {
- global gdb_prompt
- global ws
- global nl
-
- set re_class "class D : public B, public C \{${ws}public:"
- set re_fields "int d;${ws}int x;"
- set re_synth_gcc_23 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);"
-
- # ptype D: type, class, object.
-
- set name "ptype D"
- gdb_test_multiple "ptype D" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
-
- set name "ptype class D"
- gdb_test_multiple "ptype class D" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
- set name "ptype g_D"
- gdb_test_multiple "ptype g_D" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
+ # A class with two bases.
- set re_class "class E : public D \{${ws}public:"
- set re_fields "int e;${ws}int x;"
- set re_synth_gcc_23 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\((void|)\\);"
-
- # ptype E: type, class, object.
-
- set name "ptype E"
- gdb_test_multiple "ptype E" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "D" "" "class" "D" \
+ {
+ { base "public B" }
+ { base "public C" }
+ { field public "int d;" }
+ { field public "int x;" }
}
- }
+ cp_test_ptype_class "class D" "" "class" "D" ibid
+ cp_test_ptype_class "g_D" "" "class" "D" ibid
- set name "ptype class E"
- gdb_test_multiple "ptype class E" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
+ # A class derived from the previous class.
- set name "ptype g_E"
- gdb_test_multiple "ptype g_E" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "E" "" "class" "E" \
+ {
+ { base "public D" }
+ { field public "int e;" }
+ { field public "int x;" }
}
- }
+ cp_test_ptype_class "class E" "" "class" "E" ibid
+ cp_test_ptype_class "g_E" "" "class" "E" ibid
}
# Single virtual inheritance, print type definitions.
proc test_ptype_vi { } {
- global gdb_prompt
- global ws
- global nl
-
- # 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|)\\);"
+ # class vA
- set name "ptype vA"
- gdb_test_multiple "ptype vA" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "vA" "" "class" "vA" \
+ {
+ { field public "int va;" }
+ { field public "int vx;" }
}
- }
+ cp_test_ptype_class "class vA" "" "class" "vA" ibid
+ cp_test_ptype_class "g_vA" "" "class" "vA" ibid
- set name "ptype class vA"
- gdb_test_multiple "ptype class vA" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- }
+ # class vB
- set name "ptype g_vA"
- gdb_test_multiple "ptype g_vA" $name {
- -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
- pass $name
+ cp_test_ptype_class \
+ "vB" "" "class" "vB" \
+ {
+ { base "public virtual vA" }
+ { vbase "vA" }
+ { field public "int vb;" }
+ { field public "int vx;" }
}
- }
-
- # ptype vB: type, class, object.
+ cp_test_ptype_class "class vB" "" "class" "vB" ibid
+ cp_test_ptype_class "g_vB" "" "class" "vB" ibid
- set re_class "class vB : public virtual vA \{(${ws}private:|)"
- set re_vbptr "vA \\*(_vb.2vA|_vb.vA);${ws}"
- 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\\(\\);"
-
- set name "ptype vB"
- gdb_test_multiple "ptype vB" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name (aCC)"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name (aCC)"
- }
- }
+ # class vC
- set name "ptype class vB"
- gdb_test_multiple "ptype class vB" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
+ cp_test_ptype_class \
+ "vC" "" "class" "vC" \
+ {
+ { base "public virtual vA" }
+ { vbase "vA" }
+ { field public "int vc;" }
+ { field public "int vx;" }
}
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name (aCC)"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name (aCC)"
- }
- }
+ cp_test_ptype_class "class vC" "" "class" "vC" ibid
+ cp_test_ptype_class "g_vC" "" "class" "vC" ibid
- set name "ptype g_vB"
- gdb_test_multiple "ptype g_vB" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name (aCC)"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name (aCC)"
- }
- }
-
- # ptype vC: type, class, object.
-
- set re_class "class vC : public virtual vA \{(${ws}private:|)"
- set re_vbptr "vA \\*(_vb.2vA|_vb.vA);${ws}"
- 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\\(\\);"
-
- set name "ptype vC"
- gdb_test_multiple "ptype vC" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name (aCC)"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name (aCC)"
- }
- }
-
- set name "ptype class vC"
- gdb_test_multiple "ptype class vC" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name (aCC)"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name (aCC)"
- }
- }
-
- set name "ptype g_vC"
- gdb_test_multiple "ptype g_vC" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name (aCC)"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name (aCC)"
- }
- }
}
# Multiple virtual inheritance, print type definitions.
proc test_ptype_mvi { } {
- global gdb_prompt
- global ws
- global nl
-
- # ptype vD: type, class, object.
- set re_class "class vD : public virtual vB, public virtual vC \{(${ws}private:|)"
- set re_vbptr "vC \\*(_vb.2vC|_vb.vC);${ws}vB \\*(_vb.2vB|_vb.vB);"
- 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\\(\\);"
+ # class vD
- set name "ptype vD"
- gdb_test_multiple "ptype vD" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
+ cp_test_ptype_class \
+ "vD" "" "class" "vD" \
+ {
+ { base "public virtual vB" }
+ { base "public virtual vC" }
+ { vbase "vC" }
+ { vbase "vB" }
+ { field public "int vd;" }
+ { field public "int vx;" }
}
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name"
- }
- }
+ cp_test_ptype_class "class vD" "" "class" "vD" ibid
+ cp_test_ptype_class "g_vD" "" "class" "vD" ibid
- set name "ptype class vD"
- gdb_test_multiple "ptype class vD" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name"
- }
- }
+ # class vE
- set name "ptype g_vD"
- gdb_test_multiple "ptype g_vD" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
+ cp_test_ptype_class \
+ "vE" "" "class" "vE" \
+ {
+ { base "public virtual vD" }
+ { vbase "vD" }
+ { field public "int ve;" }
+ { field public "int vx;" }
}
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name"
- }
- }
+ cp_test_ptype_class "class vE" "" "class" "vE" ibid
+ cp_test_ptype_class "g_vE" "" "class" "vE" ibid
- # ptype vE: type, class, object.
-
- set re_class "class vE : public virtual vD \{(${ws}private:|)"
- set re_vbptr "vD \\*(_vb.2vD|_vb.vD);"
- 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\\(\\);"
-
- set name "ptype vE"
- gdb_test_multiple "ptype vE" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name"
- }
- }
-
- set name "ptype class vE"
- gdb_test_multiple "ptype class vE" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name"
- }
- }
-
- set name "ptype g_vE"
- gdb_test_multiple "ptype g_vE" $name {
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gdwarf-2
- pass $name
- }
- -re "type = $re_class${ws}$re_vbptr${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_2$nl\}$nl$gdb_prompt $" {
- # gcc 2.95.3 -gstabs+
- pass $name
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gdwarf-2
- # gcc HEAD 2004-01-21 -gdwarf-2
- pass "$name"
- }
- -re "type = $re_class${ws}$re_access${ws}$re_fields${ws}$re_synth_gcc_3$nl\}$nl$gdb_prompt $" {
- # gcc 3.3.2 -gstabs+
- # gcc HEAD 2004-01-21 -gstabs+
- pass "$name"
- }
- }
}
# Single inheritance, print individual members.
# Print all members of g_D.
#
- # g_D.A::a and g_D.A::x are ambiguous member accesses, and gdb
- # should detect these. There are no ways to PASS these tests
- # because I don't know what the gdb message will be. -- chastain
- # 2004-01-27.
-
- set name "print g_D.A::a"
- gdb_test_multiple "print g_D.A::a" $name {
- -re "$vhn = (15|11)$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_D.A::a"
- }
- }
-
- set name "print g_D.A::x"
- gdb_test_multiple "print g_D.A::x" $name {
- -re "$vhn = (16|12)$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_D.A::x"
- }
- }
-
+ # g_D.A::a and g_D.A::x are ambiguous member accesses.
+ gdb_test "print g_D.A::a" "base class 'A' is ambiguous in type 'D'"
+ gdb_test "print g_D.C::a" "$vhn = 15"
+ gdb_test "print g_D.B::a" "$vhn = 11"
+ gdb_test "print g_D.A::x" "base class 'A' is ambiguous in type 'D'"
gdb_test "print g_D.B::b" "$vhn = 13"
gdb_test "print g_D.B::x" "$vhn = 14"
gdb_test "print g_D.C::c" "$vhn = 17"
# Print all members of g_E.
# g_E.A::a and g_E.A::x are ambiguous.
- set name "print g_E.A::a"
- gdb_test_multiple "print g_E.A::a" $name {
- -re "$vhn = (21|25)$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_E.A::a"
- }
- }
-
- set name "print g_E.A::x"
- gdb_test_multiple "print g_E.A::x" $name {
- -re "$vhn = (26|22)$nl$gdb_prompt $" {
- kfail "gdb/68" "print g_E.A::x"
- }
- }
-
+ gdb_test "print g_E.A::a" "base class 'A' is ambiguous in type 'E'"
+ gdb_test "print g_E.A::x" "base class 'A' is ambiguous in type 'E'"
gdb_test "print g_E.B::b" "$vhn = 23"
gdb_test "print g_E.B::x" "$vhn = 24"
gdb_test "print g_E.C::c" "$vhn = 27"
gdb_test "print g_E.E::x" "$vhn = 32"
}
+# Multiple inheritance, print individual member types.
+
+proc test_print_mi_member_types {} {
+ global gdb_prompt
+ global nl
+ global vhn
+
+ # Print the types of some members of g_D without qualifying them.
+ gdb_test "ptype g_D.b" "type = int"
+ gdb_test "ptype g_D.c" "type = int"
+ gdb_test "ptype g_D.d" "type = int"
+
+ # Print the types of qualified members; none of these tests pass today.
+
+ # Print all members of g_A.
+ gdb_test "ptype g_A.A::a" "type = int"
+ gdb_test "ptype g_A.A::x" "type = int"
+
+ # Print all members of g_B.
+ gdb_test "ptype g_B.A::a" "type = int"
+ gdb_test "ptype g_B.A::x" "type = int"
+ gdb_test "ptype g_B.B::b" "type = int"
+ gdb_test "ptype g_B.B::x" "type = int"
+
+ # Print all members of g_C.
+ gdb_test "ptype g_C.A::a" "type = int"
+ gdb_test "ptype g_C.A::x" "type = int"
+ gdb_test "ptype g_C.C::c" "type = int"
+ gdb_test "ptype g_C.C::x" "type = int"
+
+ # Print all members of g_D.
+ #
+ # g_D.A::a and g_D.A::x are ambiguous member accesses.
+
+ gdb_test "ptype g_D.A::a" "base class 'A' is ambiguous in type 'D'"
+ gdb_test "ptype g_D.A::x" "base class 'A' is ambiguous in type 'D'"
+ gdb_test "ptype g_D.B::b" "type = int"
+ gdb_test "ptype g_D.B::x" "type = int"
+ gdb_test "ptype g_D.C::c" "type = int"
+ gdb_test "ptype g_D.C::x" "type = int"
+ gdb_test "ptype g_D.D::d" "type = int"
+ gdb_test "ptype g_D.D::x" "type = int"
+
+ # Print all members of g_E.
+ # g_E.A::a and g_E.A::x are ambiguous.
+
+ gdb_test "ptype g_E.A::a" "base class 'A' is ambiguous in type 'E'"
+ gdb_test "ptype g_E.A::x" "base class 'A' is ambiguous in type 'E'"
+ gdb_test "ptype g_E.B::b" "type = int"
+ gdb_test "ptype g_E.B::x" "type = int"
+ gdb_test "ptype g_E.C::c" "type = int"
+ gdb_test "ptype g_E.C::x" "type = int"
+ gdb_test "ptype g_E.D::d" "type = int"
+ gdb_test "ptype g_E.D::x" "type = int"
+ gdb_test "ptype g_E.E::e" "type = int"
+ gdb_test "ptype g_E.E::x" "type = int"
+}
+
# Multiple inheritance, print complete classes.
proc test_print_mi_classes { } {
# incapable of printing the member of an anonymous union.
# We test the printing of the member first, and perform the other tests
# only if the test succeeds, to avoid the infinite loop.
-#
-# GDB HEAD 2004-01-27 with hp aCC A.03.45 crashes on the first test.
-# -- chastain 2004-01-27
proc test_print_anon_union {} {
global gdb_prompt
set name "print variable of type anonymous union"
gdb_test_multiple "print g_anon_union" $name {
- -re "$vhn = \{one = 1, \{a = 2, b = 2\}\}$nl$gdb_prompt $" {
+ -re "$vhn = \{one = 1, \{a = 2, b = \[0-9\]+\}\}$nl$gdb_prompt $" {
pass $name
}
}
- 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|)\\);"
-
set name "print type of anonymous union"
+ set re_tag "class_with_anon_union"
+ set re_class "(class $re_tag \{${ws}public:|struct $re_tag \{)"
+ set re_fields "int one;${ws}union \{${ws}int a;${ws}long( int)? b;${ws}\};"
gdb_test_multiple "ptype g_anon_union" $name {
- -re "type = $re_class${ws}$re_fields${ws}$re_anon_union$nl\}$nl$gdb_prompt $" {
- pass $name
- }
- -re "type = $re_class${ws}$re_fields${ws}$re_anon_union${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ -re "type = $re_class${ws}$re_fields$nl\}$nl$gdb_prompt $" {
pass $name
}
}
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+
+ # 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.2 -gstabs+
+ # 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
}
+ -re "$vhn = \{<vA> = \{va = 3, vx = 4\}, $re_vbptr_3 = ${hex}( <\[^>]*>)?, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+ # gcc HEAD 2015?+
+ # the vptr is set to the address *after* the vtable,
+ # so the # symbol shown is unpredictable.
+ pass "$name (symbols ignored)"
+ }
}
# Print all members of g_vC.
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+
+ # 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.2 -gstabs+
+ # 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
}
+ -re "$vhn = \{<vA> = \{va = 7, vx = 8\}, $re_vbptr_3 = ${hex}( <\[^>]*>)?, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ # gcc HEAD 2015?+
+ # the vptr is set to the address *after* the vtable,
+ # so the symbol shown is unpredictable.
+ pass "$name (symbols ignored)"
+ }
}
}
# gcc 2.95.3 -gstabs+
pass $name
}
- -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_3_vB = $hex, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_3_vC = $hex, vc = 23, vx = 24\}, $re_vbptr_3_vD = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_3_vB = ${hex}( <vtable for vD.*>)?, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_3_vC = ${hex}( <vtable for vC.*>)?, vc = 23, vx = 24\}, $re_vbptr_3_vD = ${hex}( <vtable for vD.*>)?, vd = 25, vx = 26\}$nl$gdb_prompt $" {
# gcc 3.3.2 -gdwarf-2
# gcc HEAD 2004-01-21 -gdwarf-2
# gcc HEAD 2004-01-21 -gstabs+
# gcc 3.3.2 -gstabs+
pass "$name"
}
+ -re "$vhn = \{<vB> = \{<vA> = \{va = 19, vx = 20\}, $re_vbptr_3_vB = ${hex}( <\[^>]*>)?, vb = 21, vx = 22\}, <vC> = \{$re_vbptr_3_vC = ${hex}( <\[^>]*>)?, vc = 23, vx = 24\}, $re_vbptr_3_vD = ${hex}( <\[^>]*>)?, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ # gcc HEAD 2015?+
+ # the vptr is set to the address *after* the vtable,
+ # so the symbol shown is unpredictable.
+ pass "$name (symbols ignored)"
+ }
}
# Print all members of g_vE.
# gcc 2.95.3 -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, 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+
+ -re "$vhn = \{<vD> = \{<vB> = \{<vA> = \{va = 0, vx = 0\}, $re_vbptr_3_vB = ${hex}( <vtable for vE.*>)?, vb = 0, vx = 0\}, <vC> = \{$re_vbptr_3_vC = ${hex}( <vtable for vE.*>)?, vc = 0, vx = 0\}, $re_vbptr_3_vD = ${hex}( <vtable for vE.*>)?, vd = 0, vx = 0\}, $re_vbptr_3_vE = ${hex}( <vtable for vE.*>)?, 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
+ }
+ -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 HEAD 2015?+
+ # the vptr is set to the address *after* the vtable,
+ # so the symbol shown is unpredictable.
+ pass "$name (symbols ignored)"
+ }
}
}
proc do_tests { } {
- global prms_id
- global bug_id
- global subdir
- global objdir
- global srcdir
- global binfile
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language c++" ""
- gdb_test "set width 0" ""
+ gdb_test_no_output "set width 0"
if { ![runto_main] } then {
perror "couldn't run to main"
return
}
+ gdb_test_no_output "set language c++"
test_ptype_si
test_ptype_mi
test_ptype_vi
test_print_si_members
test_print_si_classes
test_print_mi_members
+ test_print_mi_member_types
test_print_mi_classes
test_print_anon_union