[Lldb-commits] [PATCH] D13066: Make DWARFASTParserClang::ParseChildMembers return a bool.

Siva Chandra via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 22 13:18:16 PDT 2015


sivachandra created this revision.
sivachandra added a reviewer: clayborg.
sivachandra added a subscriber: lldb-commits.

The return value is false if any of the child members have incomplete
type info. This helps in cases like these:

class Foo
{
public:
  std::string str;
};

...

Foo f;

If a file with the above code is compiled with a modern clang but without
the -fno-limit-debug-info (or similar) option, then the DWARF has only
a forward declration for std::string. In which case, the type for
"class Foo" cannot be completed. If LLDB does not detect that a child
member has incomplete type, then it wrongly conveys to clang (the LLDB
compiler) that "class Foo" is complete, and consequently crashes due to
an assertion failure in clang when running commands like "p f" or
"frame var f".

After the change to DWARFASTParserClang::ParseChildMember,
DWARFASTParserClang::CompleteTypeFromDWARF returns false if
DWARFASTParserClang::ParseChildMember returns false.

http://reviews.llvm.org/D13066

Files:
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  test/lang/cpp/incomplete-types/Makefile
  test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
  test/lang/cpp/incomplete-types/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13066.35405.patch
Type: text/x-patch
Size: 6752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150922/0c9b469a/attachment.bin>


More information about the lldb-commits mailing list