[Lldb-commits] [lldb] r241751 - Make many mangled functions that might demangle a name be allowed to specify a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so.

Greg Clayton gclayton at apple.com
Wed Jul 8 15:32:24 PDT 2015


Author: gclayton
Date: Wed Jul  8 17:32:23 2015
New Revision: 241751

URL: http://llvm.org/viewvc/llvm-project?rev=241751&view=rev
Log:
Make many mangled functions that might demangle a name be allowed to specify a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so.


Modified:
    lldb/trunk/include/lldb/Core/Mangled.h
    lldb/trunk/include/lldb/Symbol/Function.h
    lldb/trunk/include/lldb/Symbol/Symbol.h
    lldb/trunk/include/lldb/Symbol/Variable.h
    lldb/trunk/source/API/SBBlock.cpp
    lldb/trunk/source/API/SBFrame.cpp
    lldb/trunk/source/API/SBFunction.cpp
    lldb/trunk/source/API/SBSymbol.cpp
    lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
    lldb/trunk/source/Core/FormatEntity.cpp
    lldb/trunk/source/Core/Mangled.cpp
    lldb/trunk/source/Expression/IRExecutionUnit.cpp
    lldb/trunk/source/Expression/IRForTarget.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
    lldb/trunk/source/Symbol/Function.cpp
    lldb/trunk/source/Symbol/Symbol.cpp
    lldb/trunk/source/Symbol/SymbolContext.cpp
    lldb/trunk/source/Symbol/Symtab.cpp
    lldb/trunk/source/Symbol/Variable.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp

Modified: lldb/trunk/include/lldb/Core/Mangled.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Mangled.h?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Mangled.h (original)
+++ lldb/trunk/include/lldb/Core/Mangled.h Wed Jul  8 17:32:23 2015
@@ -182,7 +182,7 @@ public:
     ///     A const reference to the demangled name string object.
     //----------------------------------------------------------------------
     const ConstString&
-    GetDemangledName () const;
+    GetDemangledName (lldb::LanguageType language) const;
 
     //----------------------------------------------------------------------
     /// Display demangled name get accessor.
@@ -191,7 +191,7 @@ public:
     ///     A const reference to the display demangled name string object.
     //----------------------------------------------------------------------
     ConstString
-    GetDisplayDemangledName () const;
+    GetDisplayDemangledName (lldb::LanguageType language) const;
     
     void
     SetDemangledName (const ConstString &name)
@@ -240,8 +240,8 @@ public:
     ///     object has a valid name of that kind, else a const reference to the
     ///     other name is returned.
     //----------------------------------------------------------------------
-    const ConstString&
-    GetName (NamePreference preference = ePreferDemangled) const;
+    ConstString
+    GetName (lldb::LanguageType language, NamePreference preference = ePreferDemangled) const;
 
     //----------------------------------------------------------------------
     /// Check if "name" matches either the mangled or demangled name.
@@ -253,15 +253,15 @@ public:
     ///     \b True if \a name matches either name, \b false otherwise.
     //----------------------------------------------------------------------
     bool
-    NameMatches (const ConstString &name) const
+    NameMatches (const ConstString &name, lldb::LanguageType language) const
     {
         if (m_mangled == name)
             return true;
-        return GetDemangledName () == name;
+        return GetDemangledName (language) == name;
     }
     
     bool
-    NameMatches (const RegularExpression& regex) const;
+    NameMatches (const RegularExpression& regex, lldb::LanguageType language) const;
 
     //----------------------------------------------------------------------
     /// Get the memory cost of this object.

Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Wed Jul  8 17:32:23 2015
@@ -123,7 +123,7 @@ public:
     /// @return
     ///     A const reference to the method name object.
     //------------------------------------------------------------------
-    const ConstString&
+    ConstString
     GetName () const;
 
     //------------------------------------------------------------------
@@ -240,13 +240,13 @@ public:
     Dump(Stream *s, bool show_fullpaths) const;
 
     void
-    DumpStopContext (Stream *s) const;
+    DumpStopContext (Stream *s, lldb::LanguageType language) const;
 
-    const ConstString &
-    GetName () const;
+    ConstString
+    GetName (lldb::LanguageType language) const;
 
     ConstString
-    GetDisplayName () const;
+    GetDisplayName (lldb::LanguageType language) const;
     
     //------------------------------------------------------------------
     /// Get accessor for the call site declaration information.
@@ -440,6 +440,8 @@ public:
         return m_range;
     }
 
+    lldb::LanguageType
+    GetLanguage() const;
     //------------------------------------------------------------------
     /// Find the file and line number of the source location of the start
     /// of the function.  This will use the declaration if present and fall
@@ -527,11 +529,11 @@ public:
         return m_frame_base;
     }
 
-    const ConstString &
-    GetName() const
-    {
-        return m_mangled.GetName();
-    }
+    ConstString
+    GetName() const;
+
+    ConstString
+    GetNameNoArguments () const;
     
     ConstString
     GetDisplayName () const;

Modified: lldb/trunk/include/lldb/Symbol/Symbol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symbol.h?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Symbol.h (original)
+++ lldb/trunk/include/lldb/Symbol/Symbol.h Wed Jul  8 17:32:23 2015
@@ -152,11 +152,11 @@ public:
     lldb::addr_t
     ResolveCallableAddress(Target &target) const;
 
-    const ConstString &
-    GetName () const
-    {
-        return m_mangled.GetName();
-    }
+    ConstString
+    GetName () const;
+
+    ConstString
+    GetNameNoArguments () const;
 
     ConstString
     GetDisplayName () const;
@@ -167,6 +167,13 @@ public:
         return m_uid;
     }
 
+    lldb::LanguageType
+    GetLanguage() const
+    {
+        // TODO: See if there is a way to determine the language for a symbol somehow, for now just return our best guess
+        return m_mangled.GuessLanguage();
+    }
+
     void
     SetID(uint32_t uid)
     {

Modified: lldb/trunk/include/lldb/Symbol/Variable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Variable.h?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Variable.h (original)
+++ lldb/trunk/include/lldb/Symbol/Variable.h Wed Jul  8 17:32:23 2015
@@ -55,7 +55,7 @@ public:
         return m_declaration;
     }
 
-    const ConstString&
+    ConstString
     GetName() const;
 
     SymbolContextScope *
@@ -70,12 +70,7 @@ public:
     // function that can be called by commands and expression parsers to make
     // sure we match anything we come across.
     bool
-    NameMatches (const ConstString &name) const
-    {
-        if (m_name == name)
-            return true;
-        return m_mangled.NameMatches (name);
-    }
+    NameMatches (const ConstString &name) const;
 
     bool
     NameMatches (const RegularExpression& regex) const;
@@ -83,6 +78,9 @@ public:
     Type *
     GetType();
 
+    lldb::LanguageType
+    GetLanguage () const;
+
     lldb::ValueType
     GetScope() const
     {

Modified: lldb/trunk/source/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBlock.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBlock.cpp (original)
+++ lldb/trunk/source/API/SBBlock.cpp Wed Jul  8 17:32:23 2015
@@ -75,7 +75,15 @@ SBBlock::GetInlinedName () const
     {
         const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
         if (inlined_info)
-            return inlined_info->GetName().AsCString (NULL);
+        {
+            Function *function = m_opaque_ptr->CalculateSymbolContextFunction();
+            LanguageType language;
+            if (function)
+                language = function->GetLanguage();
+            else
+                language = lldb::eLanguageTypeUnknown;
+            return inlined_info->GetName(language).AsCString (NULL);
+        }
     }
     return NULL;
 }

Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Wed Jul  8 17:32:23 2015
@@ -1571,7 +1571,7 @@ SBFrame::GetFunctionName() const
                     if (inlined_block)
                     {
                         const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
-                        name = inlined_info->GetName().AsCString();
+                        name = inlined_info->GetName(sc.function->GetLanguage()).AsCString();
                     }
                 }
                 
@@ -1627,7 +1627,7 @@ SBFrame::GetDisplayFunctionName()
                     if (inlined_block)
                     {
                         const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
-                        name = inlined_info->GetDisplayName().AsCString();
+                        name = inlined_info->GetDisplayName(sc.function->GetLanguage()).AsCString();
                     }
                 }
                 

Modified: lldb/trunk/source/API/SBFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFunction.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFunction.cpp (original)
+++ lldb/trunk/source/API/SBFunction.cpp Wed Jul  8 17:32:23 2015
@@ -60,7 +60,7 @@ SBFunction::GetName() const
 {
     const char *cstr = NULL;
     if (m_opaque_ptr)
-        cstr = m_opaque_ptr->GetMangled().GetName().AsCString();
+        cstr = m_opaque_ptr->GetName().AsCString();
 
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
@@ -80,7 +80,7 @@ SBFunction::GetDisplayName() const
 {
     const char *cstr = NULL;
     if (m_opaque_ptr)
-    cstr = m_opaque_ptr->GetMangled().GetDisplayDemangledName().AsCString();
+        cstr = m_opaque_ptr->GetMangled().GetDisplayDemangledName(m_opaque_ptr->GetLanguage()).AsCString();
     
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)

Modified: lldb/trunk/source/API/SBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbol.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbol.cpp (original)
+++ lldb/trunk/source/API/SBSymbol.cpp Wed Jul  8 17:32:23 2015
@@ -63,7 +63,7 @@ SBSymbol::GetName() const
 {
     const char *name = NULL;
     if (m_opaque_ptr)
-        name = m_opaque_ptr->GetMangled().GetName().AsCString();
+        name = m_opaque_ptr->GetName().AsCString();
 
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
@@ -77,7 +77,7 @@ SBSymbol::GetDisplayName() const
 {
     const char *name = NULL;
     if (m_opaque_ptr)
-    name = m_opaque_ptr->GetMangled().GetDisplayDemangledName().AsCString();
+        name = m_opaque_ptr->GetMangled().GetDisplayDemangledName(m_opaque_ptr->GetLanguage()).AsCString();
     
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)

Modified: lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointLocation.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointLocation.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointLocation.cpp Wed Jul  8 17:32:23 2015
@@ -611,7 +611,7 @@ BreakpointLocation::GetDescription (Stre
                 {
                     s->EOL();
                     s->Indent("function = ");
-                    s->PutCString (sc.function->GetMangled().GetName().AsCString("<unknown>"));
+                    s->PutCString (sc.function->GetName().AsCString("<unknown>"));
                 }
 
                 if (sc.line_entry.line > 0)
@@ -632,7 +632,7 @@ BreakpointLocation::GetDescription (Stre
                         s->Indent ("re-exported target = ");
                     else
                         s->Indent("symbol = ");
-                    s->PutCString(sc.symbol->GetMangled().GetName().AsCString("<unknown>"));
+                    s->PutCString(sc.symbol->GetName().AsCString("<unknown>"));
                 }
             }
         }

Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Wed Jul  8 17:32:23 2015
@@ -1666,7 +1666,7 @@ FormatEntity::Format (const Entry &entry
                             if (inline_info)
                             {
                                 s.PutCString(" [inlined] ");
-                                inline_info->GetName().Dump(&s);
+                                inline_info->GetName(sc->function->GetLanguage()).Dump(&s);
                             }
                         }
                     }
@@ -1679,9 +1679,9 @@ FormatEntity::Format (const Entry &entry
             {
                 ConstString name;
                 if (sc->function)
-                    name = sc->function->GetMangled().GetName (Mangled::ePreferDemangledWithoutArguments);
+                    name = sc->function->GetNameNoArguments();
                 else if (sc->symbol)
-                    name = sc->symbol->GetMangled().GetName (Mangled::ePreferDemangledWithoutArguments);
+                    name = sc->symbol->GetNameNoArguments();
                 if (name)
                 {
                     s.PutCString(name.GetCString());
@@ -1724,7 +1724,7 @@ FormatEntity::Format (const Entry &entry
                         {
                             s.PutCString (cstr);
                             s.PutCString (" [inlined] ");
-                            cstr = inline_info->GetName().GetCString();
+                            cstr = inline_info->GetName(sc->function->GetLanguage()).GetCString();
                         }
 
                         VariableList args;

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Wed Jul  8 17:32:23 2015
@@ -66,7 +66,7 @@ cstring_is_mangled(const char *s)
 }
 
 static const ConstString &
-get_demangled_name_without_arguments (const Mangled *obj)
+get_demangled_name_without_arguments (ConstString mangled, ConstString demangled)
 {
     // This pair is <mangled name, demangled name without function arguments>
     static std::pair<ConstString, ConstString> g_most_recent_mangled_to_name_sans_args;
@@ -77,9 +77,6 @@ get_demangled_name_without_arguments (co
     static ConstString g_last_mangled;
     static ConstString g_last_demangled;
 
-    ConstString mangled = obj->GetMangledName ();
-    ConstString demangled = obj->GetDemangledName ();
-
     if (mangled && g_most_recent_mangled_to_name_sans_args.first == mangled)
     {
         return g_most_recent_mangled_to_name_sans_args.second;
@@ -197,7 +194,7 @@ Mangled::Clear ()
 int
 Mangled::Compare (const Mangled& a, const Mangled& b)
 {
-    return ConstString::Compare(a.GetName(ePreferMangled), a.GetName(ePreferMangled));
+    return ConstString::Compare(a.GetName(lldb::eLanguageTypeUnknown, ePreferMangled), a.GetName(lldb::eLanguageTypeUnknown, ePreferMangled));
 }
 
 
@@ -261,7 +258,7 @@ Mangled::SetValue (const ConstString &na
 // object's lifetime.
 //----------------------------------------------------------------------
 const ConstString&
-Mangled::GetDemangledName () const
+Mangled::GetDemangledName (lldb::LanguageType language) const
 {
     // Check to make sure we have a valid mangled name and that we
     // haven't already decoded our mangled name.
@@ -340,18 +337,19 @@ Mangled::GetDemangledName () const
 
 
 ConstString
-Mangled::GetDisplayDemangledName () const
+Mangled::GetDisplayDemangledName (lldb::LanguageType language) const
 {
-    return GetDemangledName();
+    return GetDemangledName(language);
 }
 
 bool
-Mangled::NameMatches (const RegularExpression& regex) const
+Mangled::NameMatches (const RegularExpression& regex, lldb::LanguageType language) const
 {
     if (m_mangled && regex.Execute (m_mangled.AsCString()))
         return true;
-    
-    if (GetDemangledName() && regex.Execute (m_demangled.AsCString()))
+
+    ConstString demangled = GetDemangledName(language);
+    if (demangled && regex.Execute (demangled.AsCString()))
         return true;
     return false;
 }
@@ -359,30 +357,28 @@ Mangled::NameMatches (const RegularExpre
 //----------------------------------------------------------------------
 // Get the demangled name if there is one, else return the mangled name.
 //----------------------------------------------------------------------
-const ConstString&
-Mangled::GetName (Mangled::NamePreference preference) const
+ConstString
+Mangled::GetName (lldb::LanguageType language, Mangled::NamePreference preference) const
 {
+    ConstString demangled = GetDemangledName(language);
+
     if (preference == ePreferDemangledWithoutArguments)
     {
-        // Call the accessor to make sure we get a demangled name in case
-        // it hasn't been demangled yet...
-        GetDemangledName();
-
-        return get_demangled_name_without_arguments (this);
+        return get_demangled_name_without_arguments (m_mangled, demangled);
     }
     if (preference == ePreferDemangled)
     {
         // Call the accessor to make sure we get a demangled name in case
         // it hasn't been demangled yet...
-        if (GetDemangledName())
-            return m_demangled;
+        if (demangled)
+            return demangled;
         return m_mangled;
     }
     else
     {
         if (m_mangled)
             return m_mangled;
-        return GetDemangledName();
+        return demangled;
     }
 }
 
@@ -435,7 +431,7 @@ Mangled::GuessLanguage () const
     ConstString mangled = GetMangledName();
     if (mangled)
     {
-        if (GetDemangledName())
+        if (GetDemangledName(lldb::eLanguageTypeUnknown))
         {
             if (cstring_is_mangled(mangled.GetCString()))
                 return lldb::eLanguageTypeC_plus_plus;
@@ -453,7 +449,7 @@ operator << (Stream& s, const Mangled& o
     if (obj.GetMangledName())
         s << "mangled = '" << obj.GetMangledName() << "'";
 
-    const ConstString& demangled = obj.GetDemangledName();
+    const ConstString& demangled = obj.GetDemangledName(lldb::eLanguageTypeUnknown);
     if (demangled)
         s << ", demangled = '" << demangled << '\'';
     else

Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Wed Jul  8 17:32:23 2015
@@ -373,7 +373,7 @@ IRExecutionUnit::GetRunnableInfo(Error &
                 ss.PutCString("\n");
             emitNewLine = true;
             ss.PutCString("  ");
-            ss.PutCString(Mangled(failed_lookup).GetDemangledName().AsCString());
+            ss.PutCString(Mangled(failed_lookup).GetDemangledName(lldb::eLanguageTypeObjC_plus_plus).AsCString());
         }
         
         m_failed_lookups.clear();

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Wed Jul  8 17:32:23 2015
@@ -267,11 +267,11 @@ IRForTarget::GetFunctionAddress (llvm::F
                 {
                     if (mangled_name.GetMangledName())
                         m_error_stream->Printf("error: call to a function '%s' ('%s') that is not present in the target\n",
-                                               mangled_name.GetName().GetCString(),
+                                               mangled_name.GetName(lldb::eLanguageTypeObjC_plus_plus).GetCString(),
                                                mangled_name.GetMangledName().GetCString());
                     else
                         m_error_stream->Printf("error: call to a function '%s' that is not present in the target\n",
-                                               mangled_name.GetName().GetCString());
+                                               mangled_name.GetName(lldb::eLanguageTypeObjC_plus_plus).GetCString());
                 }
                 return LookupResult::Fail;
             }

Modified: lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp Wed Jul  8 17:32:23 2015
@@ -500,7 +500,7 @@ DynamicLoaderHexagonDYLD::GetStepThrough
     if (sym == NULL || !sym->IsTrampoline())
         return thread_plan_sp;
 
-    const ConstString &sym_name = sym->GetMangled().GetName(Mangled::ePreferMangled);
+    const ConstString sym_name = sym->GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled);
     if (!sym_name)
         return thread_plan_sp;
 

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Wed Jul  8 17:32:23 2015
@@ -1604,7 +1604,7 @@ DynamicLoaderMacOSXDYLD::GetStepThroughT
         
         if (current_symbol->IsTrampoline())
         {
-            const ConstString &trampoline_name = current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
+            const ConstString &trampoline_name = current_symbol->GetMangled().GetName(current_symbol->GetLanguage(), Mangled::ePreferMangled);
             
             if (trampoline_name)
             {
@@ -1754,7 +1754,7 @@ DynamicLoaderMacOSXDYLD::FindEquivalentS
                                                lldb_private::ModuleList &images, 
                                                lldb_private::SymbolContextList &equivalent_symbols)
 {
-    const ConstString &trampoline_name = original_symbol->GetMangled().GetName(Mangled::ePreferMangled);
+    const ConstString &trampoline_name = original_symbol->GetMangled().GetName(original_symbol->GetLanguage(), Mangled::ePreferMangled);
     if (!trampoline_name)
         return 0;
         

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Wed Jul  8 17:32:23 2015
@@ -458,7 +458,7 @@ DynamicLoaderPOSIXDYLD::GetStepThroughTr
     if (sym == NULL || !sym->IsTrampoline())
         return thread_plan_sp;
 
-    const ConstString &sym_name = sym->GetMangled().GetName(Mangled::ePreferMangled);
+    ConstString sym_name = sym->GetName();
     if (!sym_name)
         return thread_plan_sp;
 

Modified: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Wed Jul  8 17:32:23 2015
@@ -106,7 +106,7 @@ ItaniumABILanguageRuntime::GetDynamicTyp
                 Symbol *symbol = sc.symbol;
                 if (symbol != NULL)
                 {
-                    const char *name = symbol->GetMangled().GetDemangledName().AsCString();
+                    const char *name = symbol->GetMangled().GetDemangledName(lldb::eLanguageTypeC_plus_plus).AsCString();
                     if (name && strstr(name, vtable_demangled_prefix) == name)
                     {
                         Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Wed Jul  8 17:32:23 2015
@@ -2031,8 +2031,9 @@ ObjectFileELF::ParseSymbols (Symtab *sym
             if (! mangled_name.empty())
                 mangled.SetMangledName( ConstString((mangled_name + suffix).str()) );
 
-            llvm::StringRef demangled_name = mangled.GetDemangledName().GetStringRef();
-            if (! demangled_name.empty())
+            ConstString demangled = mangled.GetDemangledName(lldb::eLanguageTypeUnknown);
+            llvm::StringRef demangled_name = demangled.GetStringRef();
+            if (!demangled_name.empty())
                 mangled.SetDemangledName( ConstString((demangled_name + suffix).str()) );
         }
 

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Wed Jul  8 17:32:23 2015
@@ -3853,7 +3853,7 @@ ObjectFileMachO::ParseSymtab ()
                             {
                                 // This is usually the second N_SO entry that contains just the filename,
                                 // so here we combine it with the first one if we are minimizing the symbol table
-                                const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString();
+                                const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName(lldb::eLanguageTypeUnknown).AsCString();
                                 if (so_path && so_path[0])
                                 {
                                     std::string full_so_path (so_path);
@@ -4244,7 +4244,7 @@ ObjectFileMachO::ParseSymtab ()
 
                     if (is_gsym)
                     {
-                        const char *gsym_name = sym[sym_idx].GetMangled().GetName(Mangled::ePreferMangled).GetCString();
+                        const char *gsym_name = sym[sym_idx].GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled).GetCString();
                         if (gsym_name)
                             N_GSYM_name_to_sym_idx[gsym_name] = sym_idx;
                     }
@@ -4312,7 +4312,7 @@ ObjectFileMachO::ParseSymtab ()
                                 bool found_it = false;
                                 for (ValueToSymbolIndexMap::const_iterator pos = range.first; pos != range.second; ++pos)
                                 {
-                                    if (sym[sym_idx].GetMangled().GetName(Mangled::ePreferMangled) == sym[pos->second].GetMangled().GetName(Mangled::ePreferMangled))
+                                    if (sym[sym_idx].GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled) == sym[pos->second].GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled))
                                     {
                                         m_nlist_idx_to_sym_idx[nlist_idx] = pos->second;
                                         // We just need the flags from the linker symbol, so put these flags
@@ -4351,7 +4351,7 @@ ObjectFileMachO::ParseSymtab ()
                                 bool found_it = false;
                                 for (ValueToSymbolIndexMap::const_iterator pos = range.first; pos != range.second; ++pos)
                                 {
-                                    if (sym[sym_idx].GetMangled().GetName(Mangled::ePreferMangled) == sym[pos->second].GetMangled().GetName(Mangled::ePreferMangled))
+                                    if (sym[sym_idx].GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled) == sym[pos->second].GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled))
                                     {
                                         m_nlist_idx_to_sym_idx[nlist_idx] = pos->second;
                                         // We just need the flags from the linker symbol, so put these flags
@@ -4369,7 +4369,7 @@ ObjectFileMachO::ParseSymtab ()
                             else
                             {
                                 // Combine N_GSYM stab entries with the non stab symbol
-                                const char *gsym_name = sym[sym_idx].GetMangled().GetName(Mangled::ePreferMangled).GetCString();
+                                const char *gsym_name = sym[sym_idx].GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled).GetCString();
                                 if (gsym_name)
                                 {
                                     ConstNameToSymbolIndexMap::const_iterator pos = N_GSYM_name_to_sym_idx.find(gsym_name);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Wed Jul  8 17:32:23 2015
@@ -669,6 +669,7 @@ DWARFCompileUnit::Index (const uint32_t
                                                                 GetOffset());
     }
 
+    const LanguageType cu_language = GetLanguageType();
     DWARFDebugInfoEntry::const_iterator pos;
     DWARFDebugInfoEntry::const_iterator begin = m_die_array.begin();
     DWARFDebugInfoEntry::const_iterator end = m_die_array.end();
@@ -882,8 +883,9 @@ DWARFCompileUnit::Index (const uint32_t
                     {
                         Mangled mangled (ConstString(mangled_cstr), true);
                         func_fullnames.Insert (mangled.GetMangledName(), die.GetOffset());
-                        if (mangled.GetDemangledName())
-                            func_fullnames.Insert (mangled.GetDemangledName(), die.GetOffset());
+                        ConstString demangled = mangled.GetDemangledName(cu_language);
+                        if (demangled)
+                            func_fullnames.Insert (demangled, die.GetOffset());
                     }
                 }
             }
@@ -904,8 +906,9 @@ DWARFCompileUnit::Index (const uint32_t
                     {
                         Mangled mangled (ConstString(mangled_cstr), true);
                         func_fullnames.Insert (mangled.GetMangledName(), die.GetOffset());
-                        if (mangled.GetDemangledName())
-                            func_fullnames.Insert (mangled.GetDemangledName(), die.GetOffset());
+                        ConstString demangled = mangled.GetDemangledName(cu_language);
+                        if (demangled)
+                            func_fullnames.Insert (demangled, die.GetOffset());
                     }
                 }
                 else
@@ -951,8 +954,9 @@ DWARFCompileUnit::Index (const uint32_t
                 {
                     Mangled mangled (ConstString(mangled_cstr), true);
                     globals.Insert (mangled.GetMangledName(), die.GetOffset());
-                    if (mangled.GetDemangledName())
-                        globals.Insert (mangled.GetDemangledName(), die.GetOffset());
+                    ConstString demangled = mangled.GetDemangledName(cu_language);
+                    if (demangled)
+                        globals.Insert (demangled, die.GetOffset());
                 }
             }
             break;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Jul  8 17:32:23 2015
@@ -3775,9 +3775,10 @@ SymbolFileDWARF::FunctionDieMatchesParti
             }
         }
 
-        if (best_name.GetDemangledName())
+        const LanguageType cu_language = const_cast<DWARFCompileUnit *>(dwarf_cu)->GetLanguageType();
+        if (best_name.GetDemangledName(cu_language))
         {
-            const char *demangled = best_name.GetDemangledName().GetCString();
+            const char *demangled = best_name.GetDemangledName(cu_language).GetCString();
             if (demangled)
             {
                 std::string name_no_parens(partial_name, base_name_end - partial_name);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Wed Jul  8 17:32:23 2015
@@ -113,7 +113,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo
                             // correctly to the new addresses in the main executable.
 
                             // First we find the original symbol in the .o file's symbol table
-                            Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType (exe_symbol->GetMangled().GetName(Mangled::ePreferMangled),
+                            Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType (exe_symbol->GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled),
                                                                                                  eSymbolTypeCode,
                                                                                                  Symtab::eDebugNo,
                                                                                                  Symtab::eVisibilityAny);
@@ -145,7 +145,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo
                             // sizes from the DWARF info as we are parsing.
 
                             // Next we find the non-stab entry that corresponds to the N_GSYM in the .o file
-                            Symbol *oso_gsym_symbol = oso_symtab->FindFirstSymbolWithNameAndType (exe_symbol->GetMangled().GetName(Mangled::ePreferMangled),
+                            Symbol *oso_gsym_symbol = oso_symtab->FindFirstSymbolWithNameAndType (exe_symbol->GetMangled().GetName(lldb::eLanguageTypeUnknown, Mangled::ePreferMangled),
                                                                                                   eSymbolTypeData,
                                                                                                   Symtab::eDebugNo,
                                                                                                   Symtab::eVisibilityAny);

Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Wed Jul  8 17:32:23 2015
@@ -161,7 +161,7 @@ SymbolFileSymtab::ParseCompileUnitAtInde
     {
         const Symbol *cu_symbol = m_obj_file->GetSymtab()->SymbolAtIndex(m_source_indexes[idx]);
         if (cu_symbol)
-            cu_sp.reset(new CompileUnit (m_obj_file->GetModule(), NULL, cu_symbol->GetMangled().GetName().AsCString(), 0, eLanguageTypeUnknown));
+            cu_sp.reset(new CompileUnit (m_obj_file->GetModule(), NULL, cu_symbol->GetName().AsCString(), 0, eLanguageTypeUnknown));
     }
     return cu_sp;
 }

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Wed Jul  8 17:32:23 2015
@@ -77,7 +77,7 @@ FunctionInfo::GetDeclaration() const
     return m_declaration;
 }
 
-const ConstString&
+ConstString
 FunctionInfo::GetName() const
 {
     return m_name;
@@ -140,30 +140,30 @@ InlineFunctionInfo::Dump(Stream *s, bool
 }
 
 void
-InlineFunctionInfo::DumpStopContext (Stream *s) const
+InlineFunctionInfo::DumpStopContext (Stream *s, LanguageType language) const
 {
 //    s->Indent("[inlined] ");
     s->Indent();
     if (m_mangled)
-        s->PutCString (m_mangled.GetName().AsCString());
+        s->PutCString (m_mangled.GetName(language).AsCString());
     else
         s->PutCString (m_name.AsCString());
 }
 
 
-const ConstString &
-InlineFunctionInfo::GetName () const
+ConstString
+InlineFunctionInfo::GetName (LanguageType language) const
 {
     if (m_mangled)
-        return m_mangled.GetName();
+        return m_mangled.GetName(language);
     return m_name;
 }
 
 ConstString
-InlineFunctionInfo::GetDisplayName () const
+InlineFunctionInfo::GetDisplayName (LanguageType language) const
 {
     if (m_mangled)
-        return m_mangled.GetDisplayDemangledName();
+        return m_mangled.GetDisplayDemangledName(language);
     return m_name;
 }
 
@@ -471,7 +471,7 @@ Function::GetDisplayName () const
 {
     if (!m_mangled)
         return ConstString();
-    return m_mangled.GetDisplayDemangledName();
+    return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
 clang::DeclContext *
@@ -617,5 +617,32 @@ Function::GetPrologueByteSize ()
     return m_prologue_byte_size;
 }
 
+lldb::LanguageType
+Function::GetLanguage() const
+{
+    if (m_comp_unit)
+        return m_comp_unit->GetLanguage();
+    else
+        return lldb::eLanguageTypeUnknown;
+}
+
+ConstString
+Function::GetName() const
+{
+    LanguageType language = lldb::eLanguageTypeUnknown;
+    if (m_comp_unit)
+        language = m_comp_unit->GetLanguage();
+    return m_mangled.GetName(language);
+}
+
+ConstString
+Function::GetNameNoArguments() const
+{
+    LanguageType language = lldb::eLanguageTypeUnknown;
+    if (m_comp_unit)
+        language = m_comp_unit->GetLanguage();
+    return m_mangled.GetName(language, Mangled::ePreferDemangledWithoutArguments);
+}
+
 
 

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Wed Jul  8 17:32:23 2015
@@ -189,7 +189,7 @@ Symbol::GetDisplayName () const
 {
     if (!m_mangled)
         return ConstString();
-    return m_mangled.GetDisplayDemangledName();
+    return m_mangled.GetDisplayDemangledName(GetLanguage());
 }
 
 ConstString
@@ -296,8 +296,9 @@ Symbol::GetDescription (Stream *s, lldb:
         else
             s->Printf (", value = 0x%16.16" PRIx64, m_addr_range.GetBaseAddress().GetOffset());
     }
-    if (m_mangled.GetDemangledName())
-        s->Printf(", name=\"%s\"", m_mangled.GetDemangledName().AsCString());
+    ConstString demangled = m_mangled.GetDemangledName(GetLanguage());
+    if (demangled)
+        s->Printf(", name=\"%s\"", demangled.AsCString());
     if (m_mangled.GetMangledName())
         s->Printf(", mangled=\"%s\"", m_mangled.GetMangledName().AsCString());
 
@@ -317,6 +318,7 @@ Symbol::Dump(Stream *s, Target *target,
     // Make sure the size of the symbol is up to date before dumping
     GetByteSize();
 
+    ConstString name = m_mangled.GetName(GetLanguage());
     if (ValueIsAddress())
     {
         if (!m_addr_range.GetBaseAddress().Dump(s, nullptr, Address::DumpStyleFileAddress))
@@ -333,13 +335,13 @@ Symbol::Dump(Stream *s, Target *target,
         s->Printf(  format,
                     GetByteSize(),
                     m_flags,
-                    m_mangled.GetName().AsCString(""));
+                    name.AsCString(""));
     }
     else if (m_type == eSymbolTypeReExported)
     {
         s->Printf ("                                                         0x%8.8x %s",
                    m_flags,
-                   m_mangled.GetName().AsCString(""));
+                   name.AsCString(""));
         
         ConstString reexport_name = GetReExportedSymbolName();
         intptr_t shlib = m_addr_range.GetByteSize();
@@ -357,7 +359,7 @@ Symbol::Dump(Stream *s, Target *target,
                     m_addr_range.GetBaseAddress().GetOffset(),
                     GetByteSize(),
                     m_flags,
-                    m_mangled.GetName().AsCString(""));
+                    name.AsCString(""));
     }
 }
 
@@ -447,7 +449,7 @@ bool
 Symbol::Compare(const ConstString& name, SymbolType type) const
 {
     if (type == eSymbolTypeAny || m_type == type)
-        return m_mangled.GetMangledName() == name || m_mangled.GetDemangledName() == name;
+        return m_mangled.GetMangledName() == name || m_mangled.GetDemangledName(GetLanguage()) == name;
     return false;
 }
 
@@ -643,6 +645,18 @@ Symbol::GetLoadAddress (Target *target)
         return LLDB_INVALID_ADDRESS;
 }
 
+ConstString
+Symbol::GetName () const
+{
+    return m_mangled.GetName(GetLanguage());
+}
+
+ConstString
+Symbol::GetNameNoArguments () const
+{
+    return m_mangled.GetName(GetLanguage(), Mangled::ePreferDemangledWithoutArguments);
+}
+
 
 lldb::addr_t
 Symbol::ResolveCallableAddress(Target &target) const

Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Wed Jul  8 17:32:23 2015
@@ -160,15 +160,15 @@ SymbolContext::DumpStopContext (
             s->Printf("<");
             dumped_something = true;
         }
-        else if (show_function_arguments == false && function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments))
-        {
-            dumped_something = true;
-            function->GetMangled().GetName(Mangled::ePreferDemangledWithoutArguments).Dump(s);
-        }
-        else if (function->GetMangled().GetName())
+        else
         {
-            dumped_something = true;
-            function->GetMangled().GetName().Dump(s);
+            ConstString name;
+            if (show_function_arguments == false)
+                name = function->GetNameNoArguments();
+            if (!name)
+                name = function->GetName();
+            if (name)
+                name.Dump(s);
         }
         
         if (addr.IsValid())
@@ -192,7 +192,7 @@ SymbolContext::DumpStopContext (
             dumped_something = true;
             Block *inlined_block = block->GetContainingInlinedBlock();
             const InlineFunctionInfo* inlined_block_info = inlined_block->GetInlinedFunctionInfo();
-            s->Printf (" [inlined] %s", inlined_block_info->GetName().GetCString());
+            s->Printf (" [inlined] %s", inlined_block_info->GetName(function->GetLanguage()).GetCString());
             
             lldb_private::AddressRange block_range;
             if (inlined_block->GetRangeContainingAddress(addr, block_range))
@@ -235,12 +235,12 @@ SymbolContext::DumpStopContext (
             s->Printf("<");
             dumped_something = true;
         }
-        else if (symbol->GetMangled().GetName())
+        else if (symbol->GetName())
         {
             dumped_something = true;
             if (symbol->GetType() == eSymbolTypeTrampoline)
                 s->PutCString("symbol stub for: ");
-            symbol->GetMangled().GetName().Dump(s);
+            symbol->GetName().Dump(s);
         }
 
         if (addr.IsValid() && symbol->ValueIsAddress())
@@ -438,7 +438,7 @@ SymbolContext::Dump(Stream *s, Target *t
     s->Indent();
     *s << "Symbol       = " << (void *)symbol;
     if (symbol != nullptr && symbol->GetMangled())
-        *s << ' ' << symbol->GetMangled().GetName().AsCString();
+        *s << ' ' << symbol->GetName().AsCString();
     s->EOL();
     *s << "Variable     = " << (void *)variable;
     if (variable != nullptr)
@@ -681,14 +681,14 @@ SymbolContext::GetFunctionName (Mangled:
             {
                 const InlineFunctionInfo *inline_info = inlined_block->GetInlinedFunctionInfo();
                 if (inline_info)
-                    return inline_info->GetName();
+                    return inline_info->GetName(function->GetLanguage());
             }
         }
-        return function->GetMangled().GetName(preference);
+        return function->GetMangled().GetName(function->GetLanguage(), preference);
     }
     else if (symbol && symbol->ValueIsAddress())
     {
-        return symbol->GetMangled().GetName(preference);
+        return symbol->GetMangled().GetName(symbol->GetLanguage(), preference);
     }
     else
     {
@@ -916,7 +916,7 @@ SymbolContextSpecifier::SymbolContextMat
             {
                 was_inlined = true;
                 const Mangled &name = inline_info->GetMangled();
-                if (!name.NameMatches (func_name))
+                if (!name.NameMatches (func_name, sc.function->GetLanguage()))
                     return false;
             }
         }
@@ -925,12 +925,12 @@ SymbolContextSpecifier::SymbolContextMat
         {
             if (sc.function != nullptr)
             {
-                if (!sc.function->GetMangled().NameMatches(func_name))
+                if (!sc.function->GetMangled().NameMatches(func_name, sc.function->GetLanguage()))
                     return false;
             }
             else if (sc.symbol != nullptr)
             {
-                if (!sc.symbol->GetMangled().NameMatches(func_name))
+                if (!sc.symbol->GetMangled().NameMatches(func_name, sc.function->GetLanguage()))
                     return false;
             }
         }

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Wed Jul  8 17:32:23 2015
@@ -136,7 +136,7 @@ Symtab::Dump (Stream *s, Target *target,
                 CStringToSymbol name_map;
                 for (const_iterator pos = m_symbols.begin(), end = m_symbols.end(); pos != end; ++pos)
                 {
-                    const char *name = pos->GetMangled().GetName(Mangled::ePreferDemangled).AsCString();
+                    const char *name = pos->GetName().AsCString();
                     if (name && name[0])
                         name_map.insert (std::make_pair(name, &(*pos)));
                 }
@@ -329,7 +329,7 @@ Symtab::InitNameIndexes()
                          entry.cstring[2] != 'G' && // avoid guard variables
                          entry.cstring[2] != 'Z'))  // named local entities (if we eventually handle eSymbolTypeData, we will want this back)
                     {
-                        CPPLanguageRuntime::MethodName cxx_method (mangled.GetDemangledName());
+                        CPPLanguageRuntime::MethodName cxx_method (mangled.GetDemangledName(lldb::eLanguageTypeC_plus_plus));
                         entry.cstring = ConstString(cxx_method.GetBasename()).GetCString();
                         if (entry.cstring && entry.cstring[0])
                         {
@@ -378,7 +378,7 @@ Symtab::InitNameIndexes()
                 }
             }
             
-            entry.cstring = mangled.GetDemangledName().GetCString();
+            entry.cstring = mangled.GetDemangledName(symbol->GetLanguage()).GetCString();
             if (entry.cstring && entry.cstring[0]) {
                 m_name_to_index.Append (entry);
 
@@ -486,7 +486,7 @@ Symtab::AppendSymbolNamesToMap (const In
             const Mangled &mangled = symbol->GetMangled();
             if (add_demangled)
             {
-                entry.cstring = mangled.GetDemangledName().GetCString();
+                entry.cstring = mangled.GetDemangledName(symbol->GetLanguage()).GetCString();
                 if (entry.cstring && entry.cstring[0])
                     name_to_index_map.Append (entry);
             }
@@ -746,7 +746,7 @@ Symtab::AppendSymbolIndexesMatchingRegEx
     {
         if (symbol_type == eSymbolTypeAny || m_symbols[i].GetType() == symbol_type)
         {
-            const char *name = m_symbols[i].GetMangled().GetName().AsCString();
+            const char *name = m_symbols[i].GetName().AsCString();
             if (name)
             {
                 if (regexp.Execute (name))
@@ -773,7 +773,7 @@ Symtab::AppendSymbolIndexesMatchingRegEx
             if (CheckSymbolAtIndex(i, symbol_debug_type, symbol_visibility) == false)
                 continue;
 
-            const char *name = m_symbols[i].GetMangled().GetName().AsCString();
+            const char *name = m_symbols[i].GetName().AsCString();
             if (name)
             {
                 if (regexp.Execute (name))

Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Wed Jul  8 17:32:23 2015
@@ -15,6 +15,7 @@
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/Function.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/Type.h"
@@ -65,22 +66,51 @@ Variable::~Variable()
 {
 }
 
+lldb::LanguageType
+Variable::GetLanguage () const
+{
+    SymbolContext variable_sc;
+    m_owner_scope->CalculateSymbolContext(&variable_sc);
+    if (variable_sc.comp_unit)
+        return variable_sc.comp_unit->GetLanguage();
+    return lldb::eLanguageTypeUnknown;
+}
+
 
-const ConstString&
+
+ConstString
 Variable::GetName() const
 {
-    const ConstString &name = m_mangled.GetName();
-    if (name)
-        return name;
+    if (m_mangled)
+    {
+        ConstString name = m_mangled.GetName(GetLanguage());
+        if (name)
+            return name;
+    }
     return m_name;
 }
 
 bool
+Variable::NameMatches (const ConstString &name) const
+{
+    if (m_name == name)
+        return true;
+    SymbolContext variable_sc;
+    m_owner_scope->CalculateSymbolContext(&variable_sc);
+
+    LanguageType language = eLanguageTypeUnknown;
+    if (variable_sc.comp_unit)
+        language = variable_sc.comp_unit->GetLanguage();
+    return m_mangled.NameMatches (name, language);
+}
+bool
 Variable::NameMatches (const RegularExpression& regex) const
 {
     if (regex.Execute (m_name.AsCString()))
         return true;
-    return m_mangled.NameMatches (regex);
+    if (m_mangled)
+        return m_mangled.NameMatches (regex, GetLanguage());
+    return false;
 }
 
 Type *

Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=241751&r1=241750&r2=241751&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Wed Jul  8 17:32:23 2015
@@ -430,7 +430,7 @@ ThreadPlanStepOverRange::DoWillResume (l
                             const InlineFunctionInfo *inline_info = frame_block->GetInlinedFunctionInfo();
                             const char *name;
                             if (inline_info)
-                                name = inline_info->GetName().AsCString();
+                                name = inline_info->GetName(frame_block->CalculateSymbolContextFunction()->GetLanguage()).AsCString();
                             else
                                 name = "<unknown-notinlined>";
                             





More information about the lldb-commits mailing list