From fee32cd9e29ad9437db49533e2f8b28ee9808c4a Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 29 Mar 2016 18:22:07 +0000 Subject: [PATCH] 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. llvm-svn: 264762 --- lldb/source/Symbol/Type.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 8061e016ca59..8b51d99ece38 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -559,8 +559,8 @@ Type::ResolveClangType (ResolveState compiler_type_resolve_state) 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 compiler_type_resolve_state) 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: