[Lldb-commits] [lldb] r264762 - When creating typedefs, don't call Type::GetName() since that might recursively call "lldb_private::Type::ResolveClangType(lldb_private::Type::ResolveStateTag)" and cause a crash. A lldb_private::Type should have a valid name if it is created without a backing CompilerType. Also provide a name that we can recognize so if we see it in a as the typename of a variable, we will know to check it out. This crash is happening quite a bit and we need to determine if this is due to incorrect debu...

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 29 11:22:08 PDT 2016


Author: gclayton
Date: Tue Mar 29 13:22:07 2016
New Revision: 264762

URL: http://llvm.org/viewvc/llvm-project?rev=264762&view=rev
Log:
When creating typedefs, don't call Type::GetName() since that might recursively call "lldb_private::Type::ResolveClangType(lldb_private::Type::ResolveStateTag)" and cause a crash. A lldb_private::Type should have a valid name if it is created without a backing CompilerType. Also provide a name that we can recognize so if we see it in a as the typename of a variable, we will know to check it out. This crash is happening quite a bit and we need to determine if this is due to incorrect debug info, or just due to some bug in LLDBD.

<rdar://problem/25192037>

Modified:
    lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=264762&r1=264761&r2=264762&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Tue Mar 29 13:22:07 2016
@@ -559,8 +559,8 @@ Type::ResolveClangType (ResolveState com
                 break;
 
             case eEncodingIsTypedefUID:
-                m_compiler_type = encoding_type->GetForwardCompilerType ().CreateTypedef(GetName().AsCString(),
-                                                                                      GetSymbolFile()->GetDeclContextContainingUID(GetID()));
+                m_compiler_type = encoding_type->GetForwardCompilerType ().CreateTypedef(m_name.AsCString("__lldb_invalid_typedef_name"),
+                                                                                         GetSymbolFile()->GetDeclContextContainingUID(GetID()));
                 m_name.Clear();
                 break;
 
@@ -605,8 +605,8 @@ Type::ResolveClangType (ResolveState com
                 break;
 
             case eEncodingIsTypedefUID:
-                m_compiler_type = void_compiler_type.CreateTypedef(GetName().AsCString(),
-                                                             GetSymbolFile()->GetDeclContextContainingUID(GetID()));
+                m_compiler_type = void_compiler_type.CreateTypedef(m_name.AsCString("__lldb_invalid_typedef_name"),
+                                                                   GetSymbolFile()->GetDeclContextContainingUID(GetID()));
                 break;
 
             case eEncodingIsPointerUID:




More information about the lldb-commits mailing list