[lldb-dev] ASSERT when building record layout for anonymous structures.

Samuel Jacob samueldotj at gmail.com
Tue Apr 16 14:33:47 PDT 2013


Hi,

lldb asserts when inspecting a simple structure.

Here is the simple test case. I already filed a bug
report(http://llvm.org/bugs/show_bug.cgi?id=15591).

In my project a main base structure has anonymous field which makes
lldb unusable(since it asserts for any structure access). Can somebody
please take a look at this bug?

$ cat test.c

typedef struct {
    int dummy;
}type_y;

typedef struct {
    type_y y;
}type_z;

int main(int argc, char *argv[])
{
    type_z *z = 0;
    return 0;
}

$ gcc -O0 -g3 ./test.c

$ lldb a.out
Current executable set to 'a.out' (x86_64).
(lldb) p *((type_z *)0)
lldb: llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:2271: uint64_t
<anonymous namespace>::RecordLayoutBuilder::updateExternalFieldOffset(const
clang::FieldDecl *, uint64_t): Assertion
`ExternalFieldOffsets.find(Field) != ExternalFieldOffsets.end() &&
"Field does not have an external offset"' failed.

Thanks
Samuel



More information about the lldb-dev mailing list