[Lldb-commits] [lldb] r121834 - /lldb/trunk/source/Core/Mangled.cpp

Jason Molenda jmolenda at apple.com
Tue Dec 14 20:20:25 PST 2010


Author: jmolenda
Date: Tue Dec 14 22:20:25 2010
New Revision: 121834

URL: http://llvm.org/viewvc/llvm-project?rev=121834&view=rev
Log:
Fix a crash on some platforms where a dSYM for a system library lists a DW_AT_mips_linkage_name for
a non-mangled function - we pass the non mangled string down through abi::__cxa_demangle and it
crashes.  Usually passing non mangled strings to abi::__cxa_demangle works out fine but not
always, apparently.


Modified:
    lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=121834&r1=121833&r2=121834&view=diff
==============================================================================
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Tue Dec 14 22:20:25 2010
@@ -143,7 +143,8 @@
         // We already know mangled is valid from the above check,
         // lets just make sure it isn't empty...
         const char * mangled = m_mangled.AsCString();
-        if (mangled[0])
+        // Don't bother running anything that doesn't start with _Z through the demangler
+        if (mangled[0] != '\0' && mangled[0] == '_' && mangled[1] == 'Z')
         {
             // Since demangling can be a costly, and since all names that go 
             // into a ConstString (like our m_mangled and m_demangled members)





More information about the lldb-commits mailing list