LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 19676 - Assertion failure when debugging application built w/o -fstandalone-debug
Summary: Assertion failure when debugging application built w/o -fstandalone-debug
Status: NEW
Alias: None
Product: lldb
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC FreeBSD
: P normal
Assignee: LLDB commit list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-07 12:08 PDT by emaste
Modified: 2014-07-13 04:22 PDT (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description emaste 2014-05-07 12:08:39 PDT
See the thread at http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-April/003800.html for background.  Clang defaults to -fno-standalone-debug on Linux and FreeBSD.  This causes debug info to contain forward declarations where possible, instead of definitions, and omits debug info for dynamic classes in modules other than where the vtable is found.

Ideally we would search the rest of the debug info for the required definition.  In any case we should return an error to the user if the debug info is missing instead of tripping the assert.

Example assertion, from debugging Clang's CGDebugInfo:


 * thread #1: tid = 104525, 0x000000081191ff6e
libclangCodeGen.so`clang::CodeGen::CGDebugInfo::CreateType(this=0x0000000815c0a000,
BT=0x0000000815c3d400) + 30 at CGDebugInfo.cpp:391, stop reason =
breakpoint 1.1
    frame #0: 0x000000081191ff6e
libclangCodeGen.so`clang::CodeGen::CGDebugInfo::CreateType(this=0x0000000815c0a000,
BT=0x0000000815c3d400) + 30 at CGDebugInfo.cpp:391
   388  /// CreateType - Get the Basic type from the cache or create a new
   389  /// one if necessary.
   390  llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
-> 391    unsigned Encoding = 0;
   392    StringRef BTName;
   393    switch (BT->getKind()) {
   394  #define BUILTIN_TYPE(Id, SingletonId)
(lldb) p BT
Assertion failed: (D && "Cannot get layout of forward declarations!"),
function getASTRecordLayout, file
../tools/clang/lib/AST/RecordLayoutBuilder.cpp, line 2783.
Comment 1 emaste 2014-07-13 04:22:20 PDT
Additional thread at http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-July/004402.html