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

Malea, Daniel daniel.malea at intel.com
Tue Apr 16 14:58:45 PDT 2013

Are you on the trunk revision? I'm unable to reproduce your crash
(although I do recall seeing a crash like that a few months ago). Here's
what I see:

(lldb) p *((type_z*)0)
error: Couldn't dematerialize struct : Couldn't read a composite type from
the target: Input/output error
Errored out in Execute: Couldn't FinalizeJITExpression

Which makes sense, although the error message is not too user friendly,
the phrase 'couldn't read a composite type from the target' implies the
pointer was not dereferenced properly.

BTW, I am using GCC 4.7.2 (from Ubuntu 12.10)


On 2013-04-16 5:33 PM, "Samuel Jacob" <samueldotj at gmail.com> wrote:

>lldb asserts when inspecting a simple structure.
>Here is the simple test case. I already filed a bug
>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;
>typedef struct {
>    type_y y;
>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
>clang::FieldDecl *, uint64_t): Assertion
>`ExternalFieldOffsets.find(Field) != ExternalFieldOffsets.end() &&
>"Field does not have an external offset"' failed.
>lldb-dev mailing list
>lldb-dev at cs.uiuc.edu

More information about the lldb-dev mailing list