aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/printcmds.exp
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-03-14 17:01:05 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-03-14 17:01:05 +0000
commit751a959bb828352de7d12339268c363a0773af5f (patch)
tree89bf929b3fcceefb301376aae1b63096746e733e /gdb/testsuite/gdb.base/printcmds.exp
parentee4dd2c9756db42e1cdc8dd526875420143a3963 (diff)
downloadgdb-751a959bb828352de7d12339268c363a0773af5f.zip
gdb-751a959bb828352de7d12339268c363a0773af5f.tar.gz
gdb-751a959bb828352de7d12339268c363a0773af5f.tar.bz2
2000-03-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* eval.c (evaluate_subexp_with_coercion): Add call to check_typedef, to handle typedeffed vars correctly. * gdb.base/printcmds.c: Add typedeffed arrays. * gdb.base/printcmds.exp (test_print_typedef_arrays): New procedure to test arrays that are typedef'd.
Diffstat (limited to 'gdb/testsuite/gdb.base/printcmds.exp')
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 79c6bc6..3ea3b90 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -552,6 +552,22 @@ proc test_print_int_arrays {} {
" = {{{{0, 1}, {2, 3}, {4, 5}}, {{6, 7}, {8, 9}, {10, 11}}}}"
}
+proc test_print_typedef_arrays {} {
+ global gdb_prompt
+
+ gdb_test "set print elements 24" ""
+
+ gdb_test "p a1" \
+ " = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}"
+ gdb_test "p a1\[0\]" " = 2"
+ gdb_test "p a1\[9\]" " = 20"
+
+ gdb_test "p a2" \
+ " = \"abcd\""
+ gdb_test "p a2\[0\]" " = 97 'a'"
+ gdb_test "p a2\[3\]" " = 100 'd'"
+}
+
proc test_artificial_arrays {} {
# Send \026@ instead of just @ in case the kill character is @.
gdb_test "p int1dim\[0\]\026@2" " = {0, 1}" {p int1dim[0]@2}
@@ -691,6 +707,7 @@ if [set_lang_c] then {
test_print_repeats_10
test_print_strings
test_print_int_arrays
+ test_print_typedef_arrays
test_artificial_arrays
test_print_char_arrays
# We used to do the runto main here.