diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1995-03-14 21:25:19 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1995-03-14 21:25:19 +0000 |
commit | 4081daa1ed1c7370d33dded34bf716600e1b349f (patch) | |
tree | e798f311e52ecea37e3a820052e1332defce68a2 /gdb/testsuite/gdb.base/whatis.exp | |
parent | 35f37e1e6698cddd6f60e6a67f598700e9937d18 (diff) | |
download | gdb-4081daa1ed1c7370d33dded34bf716600e1b349f.zip gdb-4081daa1ed1c7370d33dded34bf716600e1b349f.tar.gz gdb-4081daa1ed1c7370d33dded34bf716600e1b349f.tar.bz2 |
* lib/gdb.exp (gdb_test): Between $pattern and $prompt, expect
only \r\n, not .*. The test can pass .* as the last thing in
$pattern if that is what it wants. In addition to providing this
flexibility, this change should speed up pattern matching in cases
where the pattern already ended with .* (there were a number of
them). This change also helps catch bad patterns--in the old
scheme the typo "char \*" instead of "char \\*" would pass. Now
it is caught.
* Many .exp files: Update callers.
Diffstat (limited to 'gdb/testsuite/gdb.base/whatis.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/whatis.exp | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp index 36cc86e..56d9073 100644 --- a/gdb/testsuite/gdb.base/whatis.exp +++ b/gdb/testsuite/gdb.base/whatis.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc. +# Copyright (C) 1988, 1990, 1991, 1992, 1995 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 @@ -36,6 +36,10 @@ if ![file exists $objdir/$subdir/$binfile] then { return 0 } +# Start with a fresh gdb. + +gdb_exit +gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load $objdir/$subdir/$binfile @@ -90,11 +94,11 @@ gdb_test "whatis v_unsigned_char" \ "whatis unsigned char" gdb_test "whatis v_short" \ - "type = short" \ + "type = (short|short int)" \ "whatis short" gdb_test "whatis v_signed_short" \ - "type = short" \ + "type = (short|short int|signed short|signed short int)" \ "whatis signed short" gdb_test "whatis v_unsigned_short" \ @@ -117,14 +121,14 @@ setup_xfail_on_long_vs_int # AIX xlc gets this wrong and unsigned long right. Go figure. if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"} gdb_test "whatis v_long" \ - "type = long" \ + "type = (long|long int)" \ "whatis long" setup_xfail_on_long_vs_int # AIX xlc gets this wrong and unsigned long right. Go figure. if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"} gdb_test "whatis v_signed_long" \ - "type = long" \ + "type = (long|long int)" \ "whatis signed long" setup_xfail_on_long_vs_int @@ -163,7 +167,7 @@ gdb_test "whatis v_short_array" \ pass "whatis short array" gdb_test "whatis v_signed_short_array" \ - "type = (short|shirt int) \\\[2\\\]" \ + "type = (short|short int) \\\[2\\\]" \ "whatis signed short array" gdb_test "whatis v_unsigned_short_array" \ @@ -211,60 +215,60 @@ gdb_test "whatis v_double_array" \ # here. We especially want to make sure we test that it doesn't print as # caddr_t. gdb_test "whatis v_char_pointer" \ - "type = (unsigned |signed |)char \*" \ + "type = (unsigned |signed |)char \\*" \ "whatis char pointer" gdb_test "whatis v_signed_char_pointer" \ - "type = (unsigned |signed |)char \*" \ + "type = (unsigned |signed |)char \\*" \ "whatis signed char pointer" gdb_test "whatis v_unsigned_char_pointer" \ - "type = unsigned char \*" \ + "type = unsigned char \\*" \ "whatis unsigned char pointer" gdb_test "whatis v_short_pointer" \ - "type = (short|short int) \*" \ + "type = (short|short int) \\*" \ pass "whatis short pointer" gdb_test "whatis v_signed_short_pointer" \ - "type = (short|short int) \*" \ + "type = (short|short int) \\*" \ "whatis signed short pointer" gdb_test "whatis v_unsigned_short_pointer" \ - "type = (unsigned short|short unsigned int) \*" \ + "type = (unsigned short|short unsigned int) \\*" \ "whatis unsigned short pointer" gdb_test "whatis v_int_pointer" \ - "type = int \*" \ + "type = int \\*" \ "whatis int pointer" gdb_test "whatis v_signed_int_pointer" \ - "type = int \*" \ + "type = int \\*" \ "whatis signed int pointer" gdb_test "whatis v_unsigned_int_pointer" \ - "type = unsigned int \*" \ + "type = unsigned int \\*" \ "whatis unsigned int pointer" # We already tested whether long prints as long, so here we accept int gdb_test "whatis v_long_pointer" \ - "type = (long|int|long int) \*" \ + "type = (long|int|long int) \\*" \ "whatis long pointer" gdb_test "whatis v_signed_long_pointer" \ - "type = (signed |)(long|int|long int) \*" \ + "type = (signed |)(long|int|long int) \\*" \ "whatis signed long pointer" gdb_test "whatis v_unsigned_long_pointer" \ - "type = (unsigned (int|long|long int)|long unsigned int) \*" \ + "type = (unsigned (int|long|long int)|long unsigned int) \\*" \ "whatis unsigned long pointer" gdb_test "whatis v_float_pointer" \ - "type = float \*" \ + "type = float \\*" \ "whatis float pointer" gdb_test "whatis v_double_pointer" \ - "type = double \*" \ + "type = double \\*" \ "whatis double pointer" @@ -291,67 +295,67 @@ gdb_test "whatis v_union2" \ # test whatis command with functions return type gdb_test "whatis v_char_func" \ - "type = (signed |unsigned |)char \(\)" \ + "type = (signed |unsigned |)char \\(\\)" \ "whatis char function" gdb_test "whatis v_signed_char_func" \ - "type = (signed |unsigned |)char \(\)" \ + "type = (signed |unsigned |)char \\(\\)" \ "whatis signed char function" gdb_test "whatis v_unsigned_char_func" \ - "type = unsigned char \(\)" \ + "type = unsigned char \\(\\)" \ "whatis unsigned char function" gdb_test "whatis v_short_func" \ - "type = short (int |)\(\)" \ + "type = short (int |)\\(\\)" \ "whatis short function" gdb_test "whatis v_signed_short_func" \ - "type = short (int |)\(\)" \ + "type = short (int |)\\(\\)" \ "whatis signed short function" gdb_test "whatis v_unsigned_short_func" \ - "type = (unsigned short|short unsigned int) \(\)" \ + "type = (unsigned short|short unsigned int) \\(\\)" \ "whatis unsigned short function" gdb_test "whatis v_int_func" \ - "type = int \(\)" \ + "type = int \\(\\)" \ "whatis int function" gdb_test "whatis v_signed_int_func" \ - "type = int \(\)" \ + "type = int \\(\\)" \ "whatis signed int function" gdb_test "whatis v_unsigned_int_func" \ - "type = unsigned int \(\)" \ + "type = unsigned int \\(\\)" \ "whatis unsigned int function" gdb_test "whatis v_long_func" \ - "type = (long|int|long int) \(\)" \ + "type = (long|int|long int) \\(\\)" \ "whatis long function" gdb_test "whatis v_signed_long_func" \ - "type = (int|long|long int) \(\)" \ + "type = (int|long|long int) \\(\\)" \ "whatis signed long function" gdb_test "whatis v_unsigned_long_func" \ - "type = (unsigned (int|long|long int)|long unsigned int) \(\)" \ + "type = (unsigned (int|long|long int)|long unsigned int) \\(\\)" \ "whatis unsigned long function" # Sun /bin/cc calls this a function returning double. if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"} gdb_test "whatis v_float_func" \ - "type = float \(\)" \ + "type = float \\(\\)" \ "whatis float function" gdb_test "whatis v_double_func" \ - "type = double \(\)" \ + "type = double \\(\\)" \ "whatis double function" \ # test whatis command with some misc complicated types gdb_test "whatis s_link" \ - "type = struct link" \ + "type = struct link \\*" \ "whatis complicated structure" gdb_test "whatis u_link" \ |