[Lldb-commits] [lldb] r213591 - Improve LLDB's embedded C++ demangler by addressing the following two issues:

Kate Stone katherine.stone at apple.com
Mon Jul 21 17:18:52 PDT 2014


Author: kate
Date: Mon Jul 21 19:18:52 2014
New Revision: 213591

URL: http://llvm.org/viewvc/llvm-project?rev=213591&view=rev
Log:
Improve LLDB's embedded C++ demangler by addressing the following two issues:

1) Preserve ref qualification state in a local variable while parsing a nested name.  Previously, the state was recorded in the shared db reference and could therefore be overwritten when parsing multiple levels of nested names (e.g.: when a qualified name has qualified template args.)

2) Address an off-by-one error when testing whether or not a thunk is non-virtual.  This resulted in the demangled identifying all thunks as non-virtual.


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=213591&r1=213590&r2=213591&view=diff
==============================================================================
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Mon Jul 21 19:18:52 2014
@@ -3932,15 +3932,15 @@ parse_nested_name(const char* first, con
         const char* t0 = parse_cv_qualifiers(first+1, last, cv);
         if (t0 == last)
             return first;
-        db.ref = 0;
+        unsigned ref = 0;
         if (*t0 == 'R')
         {
-            db.ref = 1;
+            ref = 1;
             ++t0;
         }
         else if (*t0 == 'O')
         {
-            db.ref = 2;
+            ref = 2;
             ++t0;
         }
         db.names.emplace_back();
@@ -4054,6 +4054,7 @@ parse_nested_name(const char* first, con
             }
         }
         first = t0 + 1;
+        db.ref = ref;
         db.cv = cv;
         if (pop_subs && !db.subs.empty())
             db.subs.pop_back();
@@ -4413,7 +4414,7 @@ parse_special_name(const char* first, co
                 {
                     if (db.names.empty())
                         return first;
-                    if (first[2] == 'v')
+                    if (first[1] == 'v')
                     {
                         db.names.back().first.insert(0, "virtual thunk to ");
                         first = t;





More information about the lldb-commits mailing list