aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-11-12 17:37:38 +0000
committerTom Tromey <tromey@redhat.com>2012-11-12 17:37:38 +0000
commitbd69fc683f383772bb8fab43c5d4af8d0cd4a8b4 (patch)
tree9749d8fbee083798c2657964bd816fd1795a6300 /gdb/testsuite
parent2621e0fd5c40e316dfac2a492972a1344c6a0583 (diff)
downloadgdb-bd69fc683f383772bb8fab43c5d4af8d0cd4a8b4.zip
gdb-bd69fc683f383772bb8fab43c5d4af8d0cd4a8b4.tar.gz
gdb-bd69fc683f383772bb8fab43c5d4af8d0cd4a8b4.tar.bz2
* c-typeprint.c (find_typedef_for_canonicalize,
print_name_maybe_canonical): New functions. (c_print_type): Look up type name. (cp_type_print_derivation_info): Add flags argument. Use print_name_maybe_canonical. (cp_type_print_method_args): Add wrapping. (c_type_print_varspec_prefix): Use print_name_maybe_canonical. (c_type_print_template_args): New function. (c_type_print_base): Change wrapping. Use print_name_maybe_canonical. <TYPE_CODE_STRUCT>: Possibly create a typedef hash, and do type name lookups. * gdbtypes.c (types_equal): No longer static. * gdbtypes.h (types_equal): Declare. * typeprint.c (type_print_raw_options, default_ptype_flags): Update. (struct typedef_hash_table): New. (hash_typedef_field, eq_typedef_field, recursively_update_typedef_hash, add_template_parameters, create_typedef_hash, free_typedef_hash, do_free_typedef_hash, make_cleanup_free_typedef_hash, copy_typedef_hash_element, copy_typedef_hash, find_typedef_in_hash): New functions. * typeprint.h (struct type_print_options) <local_typedefs>: New field. (recursively_update_typedef_hash, add_template_parameters, create_typedef_hash, free_typedef_hash, make_cleanup_free_typedef_hash, copy_typedef_hash, find_typedef_in_hash): Declare. testsuite * gdb.base/call-sc.exp: Use "ptype/r". * gdb.base/volatile.exp: Don't expect "int". * gdb.cp/ptype-flags.cc: New file. * gdb.cp/ptype-flags.exp: New file. * gdb.cp/templates.exp: Use ptype/r. (test_ptype_of_templates, test_template_typedef): Likewise. * lib/cp-support.exp (cp_test_ptype_class): Add in_ptype_arg argument. Handle template names and template parameters. * gdb.mi/mi-var-cmd.exp: Accept "long". * gdb.mi/mi-var-child.exp: Accept "long". * gdb.mi/mi-var-display.exp: Accept "long". * gdb.mi/mi2-var-child.exp: Accept "long".
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog15
-rw-r--r--gdb/testsuite/gdb.base/call-sc.exp4
-rw-r--r--gdb/testsuite/gdb.base/volatile.exp2
-rw-r--r--gdb/testsuite/gdb.cp/ptype-flags.cc47
-rw-r--r--gdb/testsuite/gdb.cp/ptype-flags.exp85
-rw-r--r--gdb/testsuite/gdb.cp/templates.exp46
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.exp75
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cmd.exp6
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-display.exp12
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-child.exp42
-rw-r--r--gdb/testsuite/lib/cp-support.exp17
11 files changed, 252 insertions, 99 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2b9f905..9e04326 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,20 @@
2012-11-12 Tom Tromey <tromey@redhat.com>
+ * gdb.base/call-sc.exp: Use "ptype/r".
+ * gdb.base/volatile.exp: Don't expect "int".
+ * gdb.cp/ptype-flags.cc: New file.
+ * gdb.cp/ptype-flags.exp: New file.
+ * gdb.cp/templates.exp: Use ptype/r.
+ (test_ptype_of_templates, test_template_typedef): Likewise.
+ * lib/cp-support.exp (cp_test_ptype_class): Add in_ptype_arg
+ argument. Handle template names and template parameters.
+ * gdb.mi/mi-var-cmd.exp: Accept "long".
+ * gdb.mi/mi-var-child.exp: Accept "long".
+ * gdb.mi/mi-var-display.exp: Accept "long".
+ * gdb.mi/mi2-var-child.exp: Accept "long".
+
+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.
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index 1b2a495..703b37f 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -89,13 +89,13 @@ proc start_scalars_test { type } {
# check that type matches what was passed in
set test "ptype; ${testfile}"
set foo_t "xxx"
- gdb_test_multiple "ptype ${type}" "${test}" {
+ gdb_test_multiple "ptype/r ${type}" "${test}" {
-re "type = (\[^\r\n\]*)\r\n$gdb_prompt $" {
set foo_t "$expect_out(1,string)"
pass "$test (${foo_t})"
}
}
- gdb_test "ptype foo" "type = ${foo_t}" "ptype foo; ${testfile} $expect_out(1,string)"
+ gdb_test "ptype/r foo" "type = ${foo_t}" "ptype foo; ${testfile} $expect_out(1,string)"
}
diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp
index ade9d66..1f34b83 100644
--- a/gdb/testsuite/gdb.base/volatile.exp
+++ b/gdb/testsuite/gdb.base/volatile.exp
@@ -156,7 +156,7 @@ local_compiler_xfail_check
gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*"
local_compiler_xfail_check
-gdb_test "ptype video" "type = volatile (unsigned short|short unsigned)( int) \\* volatile.*"
+gdb_test "ptype video" "type = volatile (unsigned short|short unsigned) \\* volatile.*"
local_compiler_xfail_check
gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*"
diff --git a/gdb/testsuite/gdb.cp/ptype-flags.cc b/gdb/testsuite/gdb.cp/ptype-flags.cc
new file mode 100644
index 0000000..3077f73
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/ptype-flags.cc
@@ -0,0 +1,47 @@
+/* Copyright 2012 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 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, see <http://www.gnu.org/licenses/>.
+ */
+
+template<typename S>
+class Simple
+{
+ S val;
+};
+
+template<typename T>
+class Base
+{
+};
+
+template<typename T>
+class Holder : public Base<T>
+{
+public:
+ Simple<T> t;
+ Simple<T*> tstar;
+
+ typedef Simple< Simple<T> > Z;
+
+ Z z;
+
+ double method(void) { return 23.0; }
+};
+
+Holder<int> value;
+
+int main()
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.cp/ptype-flags.exp b/gdb/testsuite/gdb.cp/ptype-flags.exp
new file mode 100644
index 0000000..f544807
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/ptype-flags.exp
@@ -0,0 +1,85 @@
+# Copyright 2012 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 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, see <http://www.gnu.org/licenses/>.
+
+set nl "\[\r\n\]+"
+
+if { [skip_cplus_tests] } { continue }
+
+load_lib "cp-support.exp"
+
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+ return -1
+}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ return
+}
+
+gdb_test_no_output "set language c++" ""
+gdb_test_no_output "set width 0" ""
+
+proc do_check {name {flags ""} {show_typedefs 1} {show_methods 1} {raw 0}} {
+ set contents {
+ { base "public Base<T>" }
+ { field public "Simple<T> t;" }
+ { field public "Simple<T*> tstar;" }
+ }
+
+ if {$raw} {
+ lappend contents { field public "Holder<int>::Z z;" }
+ } else {
+ lappend contents { field public "Z z;" }
+ }
+
+ if {$show_typedefs} {
+ lappend contents { typedef public "typedef Simple<Simple<T> > Z;" }
+ }
+
+ if {$show_methods} {
+ lappend contents { method public "double method();" }
+ }
+
+ if {$raw} {
+ regsub -all -- "T" $contents "int" contents
+ }
+
+ cp_test_ptype_class value $name "class" "Holder<int>" $contents \
+ "" {} $flags
+}
+
+do_check "basic test"
+do_check "no methods" "/m" 1 0
+do_check "no typedefs" "/t" 0 1
+do_check "no methods or typedefs" "/mt" 0 0
+
+do_check "raw" "/r" 1 1 1
+do_check "raw no methods" "/rm" 1 0 1
+do_check "raw no typedefs" "/rt" 0 1 1
+do_check "raw no methods or typedefs" "/rmt" 0 0 1
+
+gdb_test_no_output "set print type methods off"
+do_check "basic test, default methods off" "" 1 0
+do_check "methods, default methods off" "/M" 1 1
+do_check "no typedefs, default methods off" "/t" 0 0
+do_check "methods, no typedefs, default methods off" "/Mt" 0 1
+
+gdb_test_no_output "set print type typedefs off"
+do_check "basic test, default methods+typedefs off" "" 0 0
+do_check "methods, default methods+typedefs off" "/M" 0 1
+do_check "typedefs, default methods+typedefs off" "/T" 1 0
+do_check "methods typedefs, default methods+typedefs off" "/MT" 1 1
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 47915b1..9ebb3bd 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -40,7 +40,7 @@ proc test_ptype_of_templates {} {
global gdb_prompt
global ws
- gdb_test_multiple "ptype T5<int>" "ptype T5<int>" {
+ gdb_test_multiple "ptype/r T5<int>" "ptype T5<int>" {
-re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
xfail "ptype T5<int> -- new without size_t"
}
@@ -63,7 +63,7 @@ proc test_ptype_of_templates {} {
}
}
- gdb_test_multiple "ptype t5i" "ptype t5i" {
+ gdb_test_multiple "ptype/r t5i" "ptype t5i" {
-re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" {
xfail "ptype T5<int> -- with several fixes from 4.17 -- without size_t"
}
@@ -226,11 +226,13 @@ proc test_template_typedef {} {
proc test_template_args {} {
set empty_re "Empty *<void *\\(FunctionArg *<int>\\)>"
- gdb_test "ptype empty" \
- "type = (struct|class) $empty_re {.*<no data fields>.*}"
+ gdb_test "ptype/r empty" \
+ "type = (struct|class) $empty_re {.*<no data fields>.*}" \
+ "ptype empty"
- gdb_test "ptype arg" \
- "type = (struct|class) FunctionArg<int> {.*int method\\($empty_re \\&\\);.*}"
+ gdb_test "ptype/r arg" \
+ "type = (struct|class) FunctionArg<int> {.*int method\\($empty_re \\&\\);.*}" \
+ "ptype arg"
}
proc do_tests {} {
@@ -291,7 +293,7 @@ gdb_test "print fvpchar" \
# NOTE: carlton/2003-02-26: However, because of a bug in the way GDB
# handles nested types, we don't get this right in the DWARF-2 case.
-gdb_test_multiple "ptype Foo" "ptype Foo" {
+gdb_test_multiple "ptype/r Foo" "ptype Foo" {
-re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" {
pass "ptype Foo"
}
@@ -312,7 +314,7 @@ gdb_test_multiple "ptype Foo" "ptype Foo" {
# ptype Foo<int>
-gdb_test_multiple "ptype fint" "ptype fint" {
+gdb_test_multiple "ptype/r fint" "ptype fint" {
-re "type = (class |)Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype fint"
}
@@ -323,7 +325,7 @@ gdb_test_multiple "ptype fint" "ptype fint" {
# ptype Foo<char>
-gdb_test_multiple "ptype fchar" "ptype fchar" {
+gdb_test_multiple "ptype/r fchar" "ptype fchar" {
-re "type = (class |)Foo<char> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char foo\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype fchar"
}
@@ -334,7 +336,7 @@ gdb_test_multiple "ptype fchar" "ptype fchar" {
# ptype Foo<volatile char *>
-gdb_test_multiple "ptype fvpchar" "ptype fvpchar" {
+gdb_test_multiple "ptype/r fvpchar" "ptype fvpchar" {
-re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype fvpchar"
}
@@ -374,7 +376,7 @@ gdb_test_multiple "print Foo<volatile char*>::foo" "print Foo<volatile char*>::f
# Template Bar<T, int>
# same as Foo for g++
-gdb_test_multiple "ptype Bar" "ptype Bar" {
+gdb_test_multiple "ptype/r Bar" "ptype Bar" {
-re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" {
pass "ptype Bar"
}
@@ -394,7 +396,7 @@ gdb_test_multiple "ptype Bar" "ptype Bar" {
# ptype Bar<int,33>
-gdb_test_multiple "ptype bint" "ptype bint" {
+gdb_test_multiple "ptype/r bint" "ptype bint" {
-re "type = (class |)Bar<int, ?(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype bint"
}
@@ -405,7 +407,7 @@ gdb_test_multiple "ptype bint" "ptype bint" {
# ptype Bar<int, (4>3)>
-gdb_test_multiple "ptype bint2" "ptype bint2" {
+gdb_test_multiple "ptype/r bint2" "ptype bint2" {
-re "type = (class |)Bar<int, ?(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype bint2"
}
@@ -417,7 +419,7 @@ gdb_test_multiple "ptype bint2" "ptype bint2" {
# Template Baz<T, char>
# Same as Foo, for g++
-gdb_test_multiple "ptype Baz" "ptype Baz" {
+gdb_test_multiple "ptype/r Baz" "ptype Baz" {
-re "type = template <(class |)T, ?(class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" {
pass "ptype Baz"
}
@@ -441,7 +443,7 @@ gdb_test_multiple "ptype Baz" "ptype Baz" {
# ptype Baz<int, 's'>
-gdb_test_multiple "ptype bazint" "ptype bazint" {
+gdb_test_multiple "ptype/r bazint" "ptype bazint" {
-re "type = (class |)Baz<int, ?(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int baz\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype bazint"
}
@@ -452,7 +454,7 @@ gdb_test_multiple "ptype bazint" "ptype bazint" {
# ptype Baz<char, 'a'>
-gdb_test_multiple "ptype bazint2" "ptype bazint2" {
+gdb_test_multiple "ptype/r bazint2" "ptype bazint2" {
-re "type = (class |)Baz<char, ?(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype bazint2"
}
@@ -463,7 +465,7 @@ gdb_test_multiple "ptype bazint2" "ptype bazint2" {
# Template Qux<T, int (*f)(int) >
# Same as Foo for g++
-gdb_test_multiple "ptype Qux" "ptype Qux" {
+gdb_test_multiple "ptype/r Qux" "ptype Qux" {
-re "type = template <(class |)T, ?(class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" {
pass "ptype Qux"
}
@@ -486,7 +488,7 @@ gdb_test_multiple "ptype Qux" "ptype Qux" {
# pt Qux<int,&string>
-gdb_test_multiple "ptype quxint" "ptype quxint" {
+gdb_test_multiple "ptype/r quxint" "ptype quxint" {
-re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype quxint"
}
@@ -505,7 +507,7 @@ gdb_test_multiple "ptype quxint" "ptype quxint" {
# Template Spec<T1, T2>
# Same as Foo for g++
-gdb_test_multiple "ptype Spec" "ptype Spec" {
+gdb_test_multiple "ptype/r Spec" "ptype Spec" {
-re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" {
pass "ptype Spec"
}
@@ -524,7 +526,7 @@ gdb_test_multiple "ptype Spec" "ptype Spec" {
# pt Spec<char,0>
-gdb_test_multiple "ptype siip" "ptype siip" {
+gdb_test_multiple "ptype/r siip" "ptype siip" {
-re "type = class Spec<int, ?int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype siip"
}
@@ -535,7 +537,7 @@ gdb_test_multiple "ptype siip" "ptype siip" {
# pt Garply<int>
-gdb_test_multiple "ptype Garply<int>" "ptype Garply<int>" {
+gdb_test_multiple "ptype/r Garply<int>" "ptype Garply<int>" {
-re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype Garply<int>"
}
@@ -546,7 +548,7 @@ gdb_test_multiple "ptype Garply<int>" "ptype Garply<int>" {
# ptype of nested template name
-gdb_test_multiple "ptype Garply<Garply<char> >" "ptype Garply<Garply<char> >" {
+gdb_test_multiple "ptype/r Garply<Garply<char> >" "ptype Garply<Garply<char> >" {
-re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply<char> t;\r\n\r\n\[ \t\]*.*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);\r\n\\}\r\n$gdb_prompt $" {
pass "ptype Garply<Garply<char> >"
}
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index 1d72311..7e61684 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -64,14 +64,14 @@ mi_list_varobj_children "struct_declarations" {
{struct_declarations.integer integer 0 int}
{struct_declarations.character character 0 char}
{struct_declarations.char_ptr char_ptr 1 "char \\*"}
- {struct_declarations.long_int long_int 0 "long int"}
+ {struct_declarations.long_int long_int 0 "long"}
{struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
- {struct_declarations.long_array long_array 12 "long int \\[12\\]"}
+ {struct_declarations.long_array long_array 12 "long \\[12\\]"}
{struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{struct_declarations.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of struct_declarations"
@@ -150,7 +150,8 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
# Test: c_variable-4.15
# Desc: children of struct_declarations.long_array
-mi_list_array_varobj_children "struct_declarations.long_array" 12 "long int" \
+mi_list_array_varobj_children "struct_declarations.long_array" 12 \
+ "long" \
"get children of struct_declarations.long_array"
# Test: c_variable-4.16
@@ -199,7 +200,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
mi_list_varobj_children "struct_declarations.u1" {
{struct_declarations.u1.a a 0 int}
{struct_declarations.u1.b b 1 {char \*}}
- {struct_declarations.u1.c c 0 {long int}}
+ {struct_declarations.u1.c c 0 {long}}
{struct_declarations.u1.d d 0 {enum foo}}
} "get children of struct_declarations.u1"
@@ -215,7 +216,7 @@ mi_list_varobj_children "struct_declarations.s2" {
{struct_declarations.s2.u2 u2 3 {union \{\.\.\.\}}}
{struct_declarations.s2.g g 0 int}
{struct_declarations.s2.h h 0 char}
- {struct_declarations.s2.i i 10 {long int \[10\]}}
+ {struct_declarations.s2.i i 10 {long \[10\]}}
} "get children of struct_declarations.s2"
#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
@@ -289,7 +290,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
# Desc: children of struct_declarations.s2.u2
mi_list_varobj_children "struct_declarations.s2.u2" {
{"struct_declarations.s2.u2.u1s1" "u1s1" 4 {struct \{\.\.\.\}}}
- {struct_declarations.s2.u2.f f 0 "long int"}
+ {struct_declarations.s2.u2.f f 0 "long"}
{struct_declarations.s2.u2.u1s2 u1s2 2 {struct \{\.\.\.\}}}
} "get children of struct_declarations.s2.u2"
@@ -327,7 +328,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
# Desc: children of struct_declarations.s2.i
set t {}
for {set i 0} {$i < 10} {incr i} {
- lappend t [list struct_declarations.s2.i.$i $i 0 "long int"]
+ lappend t [list struct_declarations.s2.i.$i $i 0 "long"]
}
mi_list_varobj_children struct_declarations.s2.i $t \
"get children of struct_declarations.s2.i"
@@ -481,14 +482,14 @@ mi_list_varobj_children "weird" {
{weird.integer integer 0 int}
{weird.character character 0 char}
{weird.char_ptr char_ptr 1 "char \\*"}
- {weird.long_int long_int 0 "long int"}
+ {weird.long_int long_int 0 "long"}
{weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
- {weird.long_array long_array 12 "long int \\[12\\]"}
+ {weird.long_array long_array 12 "long \\[12\\]"}
{weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{weird.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{weird.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of weird"
@@ -502,7 +503,7 @@ mi_gdb_test "-var-info-num-children weird" \
# Test: c_variable-4.84
# Desc: children of weird->long_array
-mi_list_array_varobj_children weird.long_array 12 "long int" \
+mi_list_array_varobj_children weird.long_array 12 "long" \
"get children of weird.long_array"
#gdbtk_test c_variable-4.84 {children of weird->long_array} {
# get_children weird.long_array
@@ -783,18 +784,18 @@ mi_gdb_test "-var-update --all-values *" \
"update all vars struct_declarations.long_array.11 changed, print values."
mi_list_varobj_children {struct_declarations.long_array --all-values} {
- {struct_declarations.long_array.0 0 0 "long int" 1234}
- {struct_declarations.long_array.1 1 0 "long int" 2345}
- {struct_declarations.long_array.2 2 0 "long int" 3456}
- {struct_declarations.long_array.3 3 0 "long int" 4567}
- {struct_declarations.long_array.4 4 0 "long int" 5678}
- {struct_declarations.long_array.5 5 0 "long int" 6789}
- {struct_declarations.long_array.6 6 0 "long int" 7890}
- {struct_declarations.long_array.7 7 0 "long int" 8901}
- {struct_declarations.long_array.8 8 0 "long int" 9012}
- {struct_declarations.long_array.9 9 0 "long int" 1234}
- {struct_declarations.long_array.10 10 0 "long int" 3456}
- {struct_declarations.long_array.11 11 0 "long int" 5678}
+ {struct_declarations.long_array.0 0 0 "long" 1234}
+ {struct_declarations.long_array.1 1 0 "long" 2345}
+ {struct_declarations.long_array.2 2 0 "long" 3456}
+ {struct_declarations.long_array.3 3 0 "long" 4567}
+ {struct_declarations.long_array.4 4 0 "long" 5678}
+ {struct_declarations.long_array.5 5 0 "long" 6789}
+ {struct_declarations.long_array.6 6 0 "long" 7890}
+ {struct_declarations.long_array.7 7 0 "long" 8901}
+ {struct_declarations.long_array.8 8 0 "long" 9012}
+ {struct_declarations.long_array.9 9 0 "long" 1234}
+ {struct_declarations.long_array.10 10 0 "long" 3456}
+ {struct_declarations.long_array.11 11 0 "long" 5678}
} "listing of names and values of children"
mi_list_varobj_children {struct_declarations --simple-values} \
@@ -802,14 +803,14 @@ mi_list_varobj_children {struct_declarations --simple-values} \
{struct_declarations.integer integer 0 int 123} \
{struct_declarations.character character 0 char {0 '\\\\000'}} \
[list struct_declarations.char_ptr char_ptr 1 "char \\*" "$hex \\\\\"hello\\\\\""] \
- {struct_declarations.long_int long_int 0 "long int" 0} \
+ {struct_declarations.long_int long_int 0 "long" 0} \
[list struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*" "$hex"] \
- {struct_declarations.long_array long_array 12 "long int \\[12\\]"} \
+ {struct_declarations.long_array long_array 12 "long \\[12\\]"} \
[list struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)" "(@$hex: |)$hex <nothing>"] \
{struct_declarations.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?" 0x0} \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?" 0x0} \
{struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)" 0x0} \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)" 0x0} \
{struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} \
{struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} \
] "listing of children, simple types: names, type and values, complex types: names and types"
@@ -913,7 +914,7 @@ mi_create_varobj "psnp->long_ptr" "psnp->long_ptr" \
# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
mi_list_varobj_children "psnp->long_ptr" {
- {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long int \*\*\*}}
+ {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long \*\*\*}}
} "get children of psnp->long_ptr"
# Test: c_variable-5.21
@@ -925,7 +926,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr" \
# Test: c_variable-5.22
# Desc: children of *(psnp->long_ptr)
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr" {
- {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long int \*\*}}
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long \*\*}}
} "get children of psnp->long_ptr.*psnp->long_ptr"
@@ -939,7 +940,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
# Desc: children of *(*(psnp->long_ptr))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \
- {\*\*\*psnp->long_ptr} 1 {long int \*}}
+ {\*\*\*psnp->long_ptr} 1 {long \*}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
# Test: c_variable-5.25
@@ -952,7 +953,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# Desc: children of *(*(*(psnp->long_ptr)))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr}
- {\*\*\*\*psnp->long_ptr} 0 {long int}}
+ {\*\*\*\*psnp->long_ptr} 0 {long}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
# Test: c_variable-5.27
@@ -995,7 +996,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs" \
# Desc: children of psnp->ptrs[0]
mi_list_varobj_children "psnp->ptrs.0" {
{psnp->ptrs.0.char_ptr char_ptr 1 {char \*\*\*\*}}
- {psnp->ptrs.0.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.long_ptr long_ptr 1 {long \*\*\*\*}}
{psnp->ptrs.0.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
{psnp->ptrs.0.next next 4 {struct _struct_n_pointer \*}}
} "get children of psnp->ptrs.0"
@@ -1010,7 +1011,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
# Desc: children of psnp->ptrs[0]->next
mi_list_varobj_children "psnp->ptrs.0.next" {
{psnp->ptrs.0.next.char_ptr char_ptr 1 {char \*\*\*\*}}
- {psnp->ptrs.0.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.long_ptr long_ptr 1 {long \*\*\*\*}}
{psnp->ptrs.0.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
{psnp->ptrs.0.next.next next 4 {struct _struct_n_pointer \*}}
} "get children of psnp->ptrs.0.next"
@@ -1100,7 +1101,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Desc: children of psnp->ptrs[0]->next->next
mi_list_varobj_children "psnp->ptrs.0.next.next" {
{psnp->ptrs.0.next.next.char_ptr char_ptr 1 {char \*\*\*\*}}
- {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long \*\*\*\*}}
{psnp->ptrs.0.next.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
{psnp->ptrs.0.next.next.next next 4 {struct _struct_n_pointer \*}}
} "get children of psnp->ptrs.0.next.next"
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
index 4c560a7..345e94b 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -83,9 +83,9 @@ mi_create_varobj_checked lcharacter lcharacter\[0\] char "create local variable
mi_create_varobj_checked lpcharacter lpcharacter {char \*} "create local variable lpcharacter"
-mi_create_varobj_checked llong llong "long int" "create local variable llong"
+mi_create_varobj_checked llong llong "long" "create local variable llong"
-mi_create_varobj_checked lplong lplong {long int \*} "create local variable lplong"
+mi_create_varobj_checked lplong lplong {long \*} "create local variable lplong"
mi_create_varobj_checked lfloat lfloat float "create local variable lfloat"
@@ -408,7 +408,7 @@ mi_continue_to subroutine1
# Desc: create variable for locals i,l in subroutine1
mi_create_varobj_checked i i int "create i"
-mi_create_varobj_checked l l {long int \*} "create l"
+mi_create_varobj_checked l l {long \*} "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
index 5cb5f26..251f948 100644
--- a/gdb/testsuite/gdb.mi/mi-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -215,14 +215,14 @@ mi_list_varobj_children weird {
{weird.integer integer 0 int}
{weird.character character 0 char}
{weird.char_ptr char_ptr 1 "char \\*"}
- {weird.long_int long_int 0 "long int"}
+ {weird.long_int long_int 0 "long"}
{weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
- {weird.long_array long_array 10 "long int \\[10\\]"}
+ {weird.long_array long_array 10 "long \\[10\\]"}
{weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{weird.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{weird.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children local variable weird"
@@ -443,7 +443,7 @@ mi_gdb_test "-var-info-num-children anonu" \
mi_list_varobj_children "anonu" {
{anonu.a a 0 int}
{anonu.b b 0 char}
- {anonu.c c 0 "long int"}
+ {anonu.c c 0 "long"}
} "get children of anonu"
# Test: c_variable-7.30
@@ -520,7 +520,7 @@ mi_gdb_test "-var-info-num-children anons" \
mi_list_varobj_children anons {
{anons.a a 0 int}
{anons.b b 0 char}
- {anons.c c 0 "long int"}
+ {anons.c c 0 "long"}
} "get children of anons"
# Test: c_variable-7.50
diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp
index fdf12f7..6a3823f 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp
@@ -63,14 +63,14 @@ mi_list_varobj_children "struct_declarations" {
{struct_declarations.integer integer 0 int}
{struct_declarations.character character 0 char}
{struct_declarations.char_ptr char_ptr 1 "char \\*"}
- {struct_declarations.long_int long_int 0 "long int"}
+ {struct_declarations.long_int long_int 0 "long"}
{struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
- {struct_declarations.long_array long_array 10 "long int \\[10\\]"}
+ {struct_declarations.long_array long_array 10 "long \\[10\\]"}
{struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{struct_declarations.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of struct_declarations"
@@ -150,7 +150,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
# Test: c_variable-4.15
# Desc: children of struct_declarations.long_array
-mi_list_array_varobj_children "struct_declarations.long_array" 10 "long int" \
+mi_list_array_varobj_children "struct_declarations.long_array" 10 "long" \
"get children of struct_declarations.long_array"
# Test: c_variable-4.16
@@ -199,7 +199,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
mi_list_varobj_children "struct_declarations.u1" {
{struct_declarations.u1.a a 0 int}
{struct_declarations.u1.b b 1 {char \*}}
- {struct_declarations.u1.c c 0 {long int}}
+ {struct_declarations.u1.c c 0 {long}}
{struct_declarations.u1.d d 0 {enum foo}}
} "get children of struct_declarations.u1"
@@ -215,7 +215,7 @@ mi_list_varobj_children "struct_declarations.s2" {
{struct_declarations.s2.u2 u2 3 {union \{\.\.\.\}}}
{struct_declarations.s2.g g 0 int}
{struct_declarations.s2.h h 0 char}
- {struct_declarations.s2.i i 10 {long int \[10\]}}
+ {struct_declarations.s2.i i 10 {long \[10\]}}
} "get children of struct_declarations.s2"
#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
@@ -289,7 +289,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
# Desc: children of struct_declarations.s2.u2
mi_list_varobj_children "struct_declarations.s2.u2" {
{"struct_declarations.s2.u2.u1s1" "u1s1" 4 {struct \{\.\.\.\}}}
- {struct_declarations.s2.u2.f f 0 "long int"}
+ {struct_declarations.s2.u2.f f 0 "long"}
{struct_declarations.s2.u2.u1s2 u1s2 2 {struct \{\.\.\.\}}}
} "get children of struct_declarations.s2.u2"
@@ -327,7 +327,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
# Desc: children of struct_declarations.s2.i
set t {}
for {set i 0} {$i < 10} {incr i} {
- lappend t [list struct_declarations.s2.i.$i $i 0 "long int"]
+ lappend t [list struct_declarations.s2.i.$i $i 0 "long"]
}
mi_list_varobj_children struct_declarations.s2.i $t \
"get children of struct_declarations.s2.i"
@@ -481,14 +481,14 @@ mi_list_varobj_children "weird" {
{weird.integer integer 0 int}
{weird.character character 0 char}
{weird.char_ptr char_ptr 1 "char \\*"}
- {weird.long_int long_int 0 "long int"}
+ {weird.long_int long_int 0 "long"}
{weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
- {weird.long_array long_array 10 "long int \\[10\\]"}
+ {weird.long_array long_array 10 "long \\[10\\]"}
{weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
{weird.func_ptr_struct func_ptr_struct 0 \
- "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long\\))?"}
{weird.func_ptr_ptr func_ptr_ptr 0 \
- "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long)?\\)"}
{weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
{weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
} "get children of weird"
@@ -502,7 +502,7 @@ mi_gdb_test "-var-info-num-children weird" \
# Test: c_variable-4.84
# Desc: children of weird->long_array
-mi_list_array_varobj_children weird.long_array 10 "long int" \
+mi_list_array_varobj_children weird.long_array 10 "long" \
"get children of weird.long_array"
#gdbtk_test c_variable-4.84 {children of weird->long_array} {
# get_children weird.long_array
@@ -865,7 +865,7 @@ mi_create_varobj "psnp->long_ptr" "psnp->long_ptr" \
# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
mi_list_varobj_children "psnp->long_ptr" {
- {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long int \*\*\*}}
+ {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long \*\*\*}}
} "get children of psnp->long_ptr"
# Test: c_variable-5.21
@@ -877,7 +877,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr" \
# Test: c_variable-5.22
# Desc: children of *(psnp->long_ptr)
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr" {
- {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long int \*\*}}
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long \*\*}}
} "get children of psnp->long_ptr.*psnp->long_ptr"
@@ -891,7 +891,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
# Desc: children of *(*(psnp->long_ptr))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \
- {\*\*\*psnp->long_ptr} 1 {long int \*}}
+ {\*\*\*psnp->long_ptr} 1 {long \*}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
# Test: c_variable-5.25
@@ -904,7 +904,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# Desc: children of *(*(*(psnp->long_ptr)))
mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" {
{{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr}
- {\*\*\*\*psnp->long_ptr} 0 {long int}}
+ {\*\*\*\*psnp->long_ptr} 0 {long}}
} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
# Test: c_variable-5.27
@@ -948,7 +948,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs" \
# Desc: children of psnp->ptrs[0]
mi_list_varobj_children "psnp->ptrs.0" {
{psnp->ptrs.0.char_ptr char_ptr 1 {char \*\*\*\*}}
- {psnp->ptrs.0.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.long_ptr long_ptr 1 {long \*\*\*\*}}
{psnp->ptrs.0.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
{psnp->ptrs.0.next next 4 {struct _struct_n_pointer \*}}
} "get children of psnp->ptrs.0"
@@ -963,7 +963,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
# Desc: children of psnp->ptrs[0]->next
mi_list_varobj_children "psnp->ptrs.0.next" {
{psnp->ptrs.0.next.char_ptr char_ptr 1 {char \*\*\*\*}}
- {psnp->ptrs.0.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.long_ptr long_ptr 1 {long \*\*\*\*}}
{psnp->ptrs.0.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
{psnp->ptrs.0.next.next next 4 {struct _struct_n_pointer \*}}
} "get children of psnp->ptrs.0.next"
@@ -1053,7 +1053,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Desc: children of psnp->ptrs[0]->next->next
mi_list_varobj_children "psnp->ptrs.0.next.next" {
{psnp->ptrs.0.next.next.char_ptr char_ptr 1 {char \*\*\*\*}}
- {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long \*\*\*\*}}
{psnp->ptrs.0.next.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
{psnp->ptrs.0.next.next.next next 4 {struct _struct_n_pointer \*}}
} "get children of psnp->ptrs.0.next.next"
diff --git a/gdb/testsuite/lib/cp-support.exp b/gdb/testsuite/lib/cp-support.exp
index 1414ffc..173fc08 100644
--- a/gdb/testsuite/lib/cp-support.exp
+++ b/gdb/testsuite/lib/cp-support.exp
@@ -100,6 +100,8 @@ proc cp_check_errata { expected_string actual_string errata_table } {
# demangler syntax adjustment, so you have to make a bigger table
# with lines for each output variation.
#
+# IN_PTYPE_ARG are arguments to pass to ptype. The default is "/r".
+#
# gdb can vary the output of ptype in several ways:
#
# . CLASS/STRUCT
@@ -178,15 +180,16 @@ proc cp_check_errata { expected_string actual_string errata_table } {
#
# -- chastain 2004-08-07
-proc cp_test_ptype_class { in_exp 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 { } } { in_ptype_arg /r } } {
global gdb_prompt
set wsopt "\[\r\n\t \]*"
- # The test name defaults to the command.
+ # The test name defaults to the command, but without the
+ # arguments, for historical reasons.
if { "$in_testname" == "" } then { set in_testname "ptype $in_exp" }
- set in_command "ptype $in_exp"
+ set in_command "ptype${in_ptype_arg} $in_exp"
# Save class tables in a history array for reuse.
@@ -232,13 +235,13 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table { in_
set parse_okay 0
gdb_test_multiple "$in_command" "$in_testname // parse failed" {
- -re "type = (struct|class)${wsopt}(\[A-Za-z0-9_\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
+ -re "type = (struct|class)${wsopt}(\[^ \t\]*)${wsopt}(\\\[with .*\\\]${wsopt})?((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
set parse_okay 1
set actual_key $expect_out(1,string)
set actual_tag $expect_out(2,string)
- set actual_base_string $expect_out(3,string)
- set actual_body $expect_out(5,string)
- set actual_tail $expect_out(6,string)
+ set actual_base_string $expect_out(4,string)
+ set actual_body $expect_out(6,string)
+ set actual_tail $expect_out(7,string)
}
}
if { ! $parse_okay } then { return }