[lldb-dev] [Bug 20486] New: recursive types with typedefs do not resolve properly when printing type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 29 15:23:46 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20486

            Bug ID: 20486
           Summary: recursive types with typedefs do not resolve properly
                    when printing type
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: compnerd at compnerd.org
    Classification: Unclassified

When attempting to print a recursive structure type in lldb built with
assertions, the following assertion is triggered in clang:

Assertion `ExternalFieldOffsets.find(Field) != ExternalFieldOffsets.end() &&
"Field does not have an external offset"' failed

Its unclear whether the assertion in clang is overly aggressive or if the lldb
construction of the type is at fault.

A reproduction for this issue is inlined below.  Note that the separation of
the TUs is required for the reproduction:


#if defined(TU_ONE)
typedef struct t *tp;
typedef tp (*get_tp)();

struct s {
  get_tp_p get_tp;
};

struct t {
  struct s *s;
};

struct t t;
#elif defined(TU_TWO)
typedef struct t *tp;
extern struct t t;
int main() {
  tp tpi = &t;
  return 0;
}
#else
#error there are 2 tus
#endif

To reproduce, set a temporary breakpoint on main; run; next; p tpi; p *tpi

Immediately printing the structure recursively (p *tpi) will actually resolve
the structure layout and cache it, preventing the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140729/e6b8acd2/attachment.html>


More information about the lldb-dev mailing list