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@cs.uiuc.edu
          Reporter: compn...@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.
_______________________________________________
lldb-dev mailing list
lldb-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to