diff options
author | Doug Evans <dje@google.com> | 2011-11-10 19:15:10 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2011-11-10 19:15:10 +0000 |
commit | f6b47be484b30121c0d162eafd6c4a64dbd8d59f (patch) | |
tree | 57edd4b9d22beaeba5f4403846ed67b513904b02 /gdb/testsuite | |
parent | bd119cf1520d4fc5b6733f7d035461dd277c951e (diff) | |
download | gdb-f6b47be484b30121c0d162eafd6c4a64dbd8d59f.zip gdb-f6b47be484b30121c0d162eafd6c4a64dbd8d59f.tar.gz gdb-f6b47be484b30121c0d162eafd6c4a64dbd8d59f.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-type.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-type.exp | 4 |
3 files changed, 13 insertions, 0 deletions
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 <dje@google.com> + + * 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 <brobecker@adacore.com> * 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 |