[lldb-dev] [BUG?] Confusion between translation units?
Greg Clayton via lldb-dev
lldb-dev at lists.llvm.org
Tue Oct 20 17:22:33 PDT 2015
>> Are you pulling in data from two different copies of LLVM in your project? Or is something in here symlink to the other somewhere?
> Excellent find. Yes, 3p_mirror is a symlink to the 3p-tmw-osx location.
>> So to sum up: LLDB uniques types by decl file + decl line + byte size + fully qualified typename and that is failing because the decl files are different for these two types from the debug infos point of view. And these types could actually differ since they come from different files and we need to allow this so that we can display these types.
> I'm slightly confused: can't we ask Clang to tell us if the two types
> are structurally equivalent? Is this some short-cut? We need to
> account for symlinks then, it seems.
Yep. Try replacing Declaration::Compare() in lldb/source/Symbol/Declaration.cpp. You will need to include:
Then replace Declaration::Compare() with this:
Declaration::Compare(const Declaration& a, const Declaration& b)
int result = FileSpec::Compare(a.m_file, b.m_file, true);
int symlink_result = result;
if (a.m_file.GetFilename() == b.m_file.GetFilename())
// Check if the directories in a and b are symlinks to each other
if (FileSystem::ResolveSymbolicLink(a.m_file, resolved_a).Success() &&
symlink_result = FileSpec::Compare(resolved_a, resolved_b, true);
if (symlink_result != 0)
if (a.m_line < b.m_line)
else if (a.m_line > b.m_line)
if (a.m_column < b.m_column)
else if (a.m_column > b.m_column)
Then try running and let me know what your results are!
More information about the lldb-dev