* 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.
This commit is contained in:
parent
bd119cf152
commit
f6b47be484
5 changed files with 43 additions and 7 deletions
|
@ -21,6 +21,9 @@ struct s
|
|||
int b;
|
||||
};
|
||||
|
||||
typedef struct s TS;
|
||||
TS ts;
|
||||
|
||||
#ifdef __cplusplus
|
||||
struct C
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue