[Lldb-commits] [lldb] r176063 - <rdar://problem/13289157>

Greg Clayton gclayton at apple.com
Mon Feb 25 16:21:39 PST 2013


Author: gclayton
Date: Mon Feb 25 18:21:38 2013
New Revision: 176063

URL: http://llvm.org/viewvc/llvm-project?rev=176063&view=rev
Log:
<rdar://problem/13289157>

Set the exception breakpoints more efficiently by specifying two module basenames as module filters for Apple vendor targets.


Modified:
    lldb/trunk/include/lldb/Core/FileSpecList.h
    lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=176063&r1=176062&r2=176063&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
+++ lldb/trunk/include/lldb/Core/FileSpecList.h Mon Feb 25 18:21:38 2013
@@ -176,6 +176,12 @@ public:
     size_t
     MemorySize () const;
 
+    bool
+    IsEmpty() const
+    {
+        return m_files.empty();
+    }
+
     //------------------------------------------------------------------
     /// Get the number of files in the file list.
     ///

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=176063&r1=176062&r2=176063&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Mon Feb 25 18:21:38 2013
@@ -413,11 +413,24 @@ ItaniumABILanguageRuntime::SetExceptionB
     if (!m_cxx_exception_bp_sp)
     {
         Target &target = m_process->GetTarget();
-        
+        FileSpecList filter_modules;
+        // Limit the number of modules that are searched for these breakpoints for
+        // Apple binaries.
+        if (target.GetArchitecture().GetTriple().getVendor() == llvm::Triple::Apple)
+        {
+            filter_modules.Append(FileSpec("libc++abi.dylib", false));
+            filter_modules.Append(FileSpec("libSystem.B.dylib", false));
+        }
         BreakpointResolverSP exception_resolver_sp = CreateExceptionResolver (NULL, catch_bp, throw_bp, for_expressions);
-        SearchFilterSP filter_sp = target.GetSearchFilterForModule(NULL);
+        SearchFilterSP filter_sp;
+        
+        if (filter_modules.IsEmpty())
+            filter_sp = target.GetSearchFilterForModule(NULL);
+        else
+            filter_sp = target.GetSearchFilterForModuleList(&filter_modules);
         
         m_cxx_exception_bp_sp = target.CreateBreakpoint (filter_sp, exception_resolver_sp, is_internal);
+        printf("exception breakpoint with %zu locations\n", m_cxx_exception_bp_sp->GetNumLocations());/// REMOVE THIS PRIOR TO CHECKIN
         if (m_cxx_exception_bp_sp)
             m_cxx_exception_bp_sp->SetBreakpointKind("c++ exception");
     }





More information about the lldb-commits mailing list