diff options
author | Fred Fish <fnf@specifix.com> | 2006-02-18 20:01:17 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 2006-02-18 20:01:17 +0000 |
commit | f8261448b0d358daa49883a5c4b91a876010a3b1 (patch) | |
tree | adc71bd6050acceba6cc5717c761a17b7724213b /gdb | |
parent | ad490fd1195e4ffd71e7189e2a2175dd70483e28 (diff) | |
download | gdb-f8261448b0d358daa49883a5c4b91a876010a3b1.zip gdb-f8261448b0d358daa49883a5c4b91a876010a3b1.tar.gz gdb-f8261448b0d358daa49883a5c4b91a876010a3b1.tar.bz2 |
2006-02-16 Fred Fish <fnf@specifix.com>
* gdb.base/whatis.c: Define variables using typedefs char_addr,
ushort_addr, and slong_addr, so the typedefs are not optimized
away.
* gdb.base/whatis.exp: Add tests using type name for struct type,
union type, enum type, and typedef.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/whatis.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/whatis.exp | 22 |
3 files changed, 33 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index dfcae49..ea33a48 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2006-02-16 Fred Fish <fnf@specifix.com> + + * gdb.base/whatis.c: Define variables using typedefs char_addr, + ushort_addr, and slong_addr, so the typedefs are not optimized + away. + * gdb.base/whatis.exp: Add tests using type name for struct type, + union type, enum type, and typedef. + 2006-02-13 Mark Kettenis <kettenis@gnu.org> * gdb.arch/i386-prologue.exp: Add testcase for PR breakpoints/2080. diff --git a/gdb/testsuite/gdb.base/whatis.c b/gdb/testsuite/gdb.base/whatis.c index 7d4a647..5b1319f 100644 --- a/gdb/testsuite/gdb.base/whatis.c +++ b/gdb/testsuite/gdb.base/whatis.c @@ -79,8 +79,11 @@ double v_double_array[2]; a special case kludge in GDB (Unix system include files like to define caddr_t), but for a variety of types. */ typedef char *char_addr; +static char_addr a_char_addr; typedef unsigned short *ushort_addr; +static ushort_addr a_ushort_addr; typedef signed long *slong_addr; +static slong_addr a_slong_addr; char *v_char_pointer; signed char *v_signed_char_pointer; diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp index 9b41d6a..fdc86f9 100644 --- a/gdb/testsuite/gdb.base/whatis.exp +++ b/gdb/testsuite/gdb.base/whatis.exp @@ -273,6 +273,10 @@ gdb_test "whatis v_struct1" \ "type = struct t_struct" \ "whatis named structure" +gdb_test "whatis struct t_struct" \ + "type = struct t_struct" \ + "whatis named structure using type name" + gdb_test "whatis v_struct2" \ "type = struct \{$unstruct\}" \ "whatis unnamed structure" @@ -283,6 +287,10 @@ gdb_test "whatis v_union" \ "type = union t_union" \ "whatis named union" +gdb_test "whatis union t_union" \ + "type = union t_union" \ + "whatis named union using type name" + gdb_test "whatis v_union2" \ "type = union \{$ununion\}" \ "whatis unnamed union" @@ -371,6 +379,10 @@ gdb_test "whatis clunker" \ "type = enum cars" \ "whatis enumeration" +gdb_test "whatis enum cars" \ + "type = enum cars" \ + "whatis enumeration using type name" + # test whatis command with nested struct and union gdb_test "whatis nested_su" \ @@ -402,3 +414,13 @@ gdb_test "whatis nested_su.inner_union_instance" \ gdb_test "whatis nested_su.inner_union_instance.inner_union_int" \ "type = int" \ "whatis inner union member" + +# test whatis command with typedefs + +gdb_test "whatis char_addr" \ + "type = char \\*" \ + "whatis using typedef type name" + +gdb_test "whatis a_char_addr" \ + "type = char_addr" \ + "whatis applied to variable defined by typedef" |