From f6b47be484b30121c0d162eafd6c4a64dbd8d59f Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 10 Nov 2011 19:15:10 +0000 Subject: * python/py-type.c (typy_fields_items): Call check_typedef. testsuite/ * gdb.python/py-type.c (TS): New typedef. (ts): New global. * gdb.python/py-type.exp: Test field list of typedef. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.python/py-type.c | 3 +++ gdb/testsuite/gdb.python/py-type.exp | 4 ++++ 3 files changed, 13 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8b0abc3..a12be84 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-11-10 Doug Evans + + * gdb.python/py-type.c (TS): New typedef. + (ts): New global. + * gdb.python/py-type.exp: Test field list of typedef. + 2011-11-10 Joel Brobecker * gdb.ada/small_reg_param: New testcase. diff --git a/gdb/testsuite/gdb.python/py-type.c b/gdb/testsuite/gdb.python/py-type.c index b0dcc9d..2d49ff8 100644 --- a/gdb/testsuite/gdb.python/py-type.c +++ b/gdb/testsuite/gdb.python/py-type.c @@ -21,6 +21,9 @@ struct s int b; }; +typedef struct s TS; +TS ts; + #ifdef __cplusplus struct C { diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp index ec86586..3578a7e 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -64,6 +64,10 @@ proc runto_bp {bp} { proc test_fields {lang} { global gdb_prompt + # .fields() of a typedef should still return the underlying field list + gdb_test "python print len(gdb.parse_and_eval('ts').type.fields())" "2" \ + "$lang typedef field list" + if {$lang == "c++"} { # Test usage with a class gdb_py_test_silent_cmd "print c" "print value" 1 -- cgit v1.1