Skip to content
Commit bf2977b5 authored by Weimin Pan's avatar Weimin Pan
Browse files

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.
parent c4eb05ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment