[Lldb-commits] [lldb] r266139 - Fixed being able to set breakpoints on destructors when we don't fully specify the demangled name. So all of the following now work:

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 12 15:02:37 PDT 2016


Author: gclayton
Date: Tue Apr 12 17:02:37 2016
New Revision: 266139

URL: http://llvm.org/viewvc/llvm-project?rev=266139&view=rev
Log:
Fixed being able to set breakpoints on destructors when we don't fully specify the demangled name. So all of the following now work:

(lldb) b ~Foo
(lldb) b Foo::~Foo
(lldb) b Bar::Foo::~Foo

Improved out C++ breakpoint locations tests as well to cover this issue.

<rdar://problem/25577252>


Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
    lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py?rev=266139&r1=266138&r2=266139&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py Tue Apr 12 17:02:37 2016
@@ -48,15 +48,18 @@ class TestCPPBreakpointLocations(TestBas
             { 'name' : 'func1', 'loc_names' : [ 'a::c::func1()', 'b::c::func1()'] },
             { 'name' : 'func2', 'loc_names' : [ 'a::c::func2()', 'c::d::func2()'] },
             { 'name' : 'func3', 'loc_names' : [ 'a::c::func3()', 'b::c::func3()', 'c::d::func3()'] },
+            { 'name' : '~c', 'loc_names' : [ 'a::c::~c()', 'b::c::~c()', 'a::c::~c()', 'b::c::~c()'] },
             { 'name' : 'c::func1', 'loc_names' : [ 'a::c::func1()', 'b::c::func1()'] },
             { 'name' : 'c::func2', 'loc_names' : [ 'a::c::func2()'] },
             { 'name' : 'c::func3', 'loc_names' : [ 'a::c::func3()', 'b::c::func3()'] },
+            { 'name' : 'c::~c', 'loc_names' : [ 'a::c::~c()', 'b::c::~c()', 'a::c::~c()', 'b::c::~c()'] },
             { 'name' : 'a::c::func1', 'loc_names' : [ 'a::c::func1()'] },
             { 'name' : 'b::c::func1', 'loc_names' : [ 'b::c::func1()'] },
             { 'name' : 'c::d::func2', 'loc_names' : [ 'c::d::func2()'] },
             { 'name' : 'a::c::func1()', 'loc_names' : [ 'a::c::func1()'] },
             { 'name' : 'b::c::func1()', 'loc_names' : [ 'b::c::func1()'] },
             { 'name' : 'c::d::func2()', 'loc_names' : [ 'c::d::func2()'] },
+            { 'name' : 'c::~c()', 'loc_names' : [ 'a::c::~c()', 'b::c::~c()', 'a::c::~c()', 'b::c::~c()'] },
         ]
         
         for bp_dict in bp_dicts:

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=266139&r1=266138&r2=266139&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Tue Apr 12 17:02:37 2016
@@ -330,7 +330,7 @@ CPlusPlusLanguage::IsCPPMangledName (con
 bool
 CPlusPlusLanguage::ExtractContextAndIdentifier (const char *name, llvm::StringRef &context, llvm::StringRef &identifier)
 {
-    static RegularExpression g_basename_regex("^(([A-Za-z_][A-Za-z_0-9]*::)*)([A-Za-z_][A-Za-z_0-9]*)$");
+    static RegularExpression g_basename_regex("^(([A-Za-z_][A-Za-z_0-9]*::)*)(~?[A-Za-z_~][A-Za-z_0-9]*)$");
     RegularExpression::Match match(4);
     if (g_basename_regex.Execute (name, &match))
     {




More information about the lldb-commits mailing list