Added the ability to restrict breakpoints by function name, function regexp, selector
etc to specific source files.
Added SB API's to specify these source files & also more than one module.
Added an "exact" option to CompileUnit's FindLineEntry API.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140362 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 19bd7f9..ebaab10 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -207,13 +207,13 @@
 }
 
 BreakpointSP
-Target::CreateBreakpoint (const FileSpecList *containingModules,
-                  const FileSpec &file,
+Target::CreateSourceRegexBreakpoint (const FileSpecList *containingModules,
+                  const FileSpecList *source_file_spec_list,
                   RegularExpression &source_regex,
                   bool internal)
 {
-    SearchFilterSP filter_sp(GetSearchFilterForModuleList (containingModules));
-    BreakpointResolverSP resolver_sp(new BreakpointResolverFileRegex (NULL, file, source_regex));
+    SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, source_file_spec_list));
+    BreakpointResolverSP resolver_sp(new BreakpointResolverFileRegex (NULL, source_regex));
     return CreateBreakpoint (filter_sp, resolver_sp, internal);
 }
 
@@ -255,7 +255,8 @@
 }
 
 BreakpointSP
-Target::CreateBreakpoint (const FileSpecList *containingModules, 
+Target::CreateBreakpoint (const FileSpecList *containingModules,
+                          const FileSpecList *containingSourceFiles,
                           const char *func_name, 
                           uint32_t func_name_type_mask, 
                           bool internal,
@@ -264,7 +265,7 @@
     BreakpointSP bp_sp;
     if (func_name)
     {
-        SearchFilterSP filter_sp(GetSearchFilterForModuleList (containingModules));
+        SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
         
         BreakpointResolverSP resolver_sp (new BreakpointResolverName (NULL, 
                                                                       func_name, 
@@ -317,13 +318,36 @@
     return filter_sp;
 }
 
+SearchFilterSP
+Target::GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
+{
+    if (containingSourceFiles == NULL || containingSourceFiles->GetSize() == 0)
+        return GetSearchFilterForModuleList(containingModules);
+        
+    SearchFilterSP filter_sp;
+    lldb::TargetSP target_sp = this->GetSP();
+    if (containingModules == NULL)
+    {
+        // We could make a special "CU List only SearchFilter".  Better yet was if these could be composable, 
+        // but that will take a little reworking.
+        
+        filter_sp.reset (new SearchFilterByModuleListAndCU (target_sp, FileSpecList(), *containingSourceFiles));
+    }
+    else
+    {
+        filter_sp.reset (new SearchFilterByModuleListAndCU (target_sp, *containingModules, *containingSourceFiles));
+    }
+    return filter_sp;
+}
+
 BreakpointSP
-Target::CreateBreakpoint (const FileSpecList *containingModules, 
+Target::CreateFuncRegexBreakpoint (const FileSpecList *containingModules, 
+                          const FileSpecList *containingSourceFiles,
                           RegularExpression &func_regex, 
                           bool internal,
                           LazyBool skip_prologue)
 {
-    SearchFilterSP filter_sp(GetSearchFilterForModuleList (containingModules));
+    SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
     BreakpointResolverSP resolver_sp(new BreakpointResolverName (NULL, 
                                                                  func_regex, 
                                                                  skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));