diff options
author | Weimin Pan <weimin.pan@oracle.com> | 2018-06-18 21:15:13 +0000 |
---|---|---|
committer | Weimin Pan <weimin.pan@oracle.com> | 2018-06-18 21:31:55 +0000 |
commit | bf2977b5f3d25779cdc06ba79c05244d70bd8b59 (patch) | |
tree | 2df84ac75e329116c9438e67178b160785f36f9c /gdb/valops.c | |
parent | c4eb05ff9a3739378f8a846751da4d0e221b4c8c (diff) | |
download | gdb-bf2977b5f3d25779cdc06ba79c05244d70bd8b59.zip gdb-bf2977b5f3d25779cdc06ba79c05244d70bd8b59.tar.gz gdb-bf2977b5f3d25779cdc06ba79c05244d70bd8b59.tar.bz2 |
Fix failure to find member of a typedef base class
The test case below demonstrates the problem, as described in this PR's Comment 5:
typedef struct {
int x;
} A;
struct C : A {
int y;
};
int main()
{
C c;
return 55;
}
$ gdb a.out
(gdb) ptype C::x
Internal error: non-aggregate type to value_struct_elt_for_reference
In value_struct_elt_for_reference(), need to call check_typedef() on
the aggregate type to handle the case of *curtype being ptr->typedef.
Tested on x86_64-linux. No regressions.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 9337457..9bdbf22 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3343,7 +3343,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, int want_address, enum noside noside) { - struct type *t = curtype; + struct type *t = check_typedef (curtype); int i; struct value *v, *result; |