Modified the "breakpoint set --name NAME" to be the auto breakpoint set 
function. It will inspect NAME and do the following:
- if the name contains '(' or starts with "-[" or "+[" then a full name search
  will happen to match full function names with args (C++ demangled names) or
  full objective C method prototypes.
- if the name contains "::" and no '(', then it is assumed to be a qualified
  function name that is in a namespace or class. For "foo::bar::baz" we will
  search for any functions with the basename or method name of "baz", then
  filter the results to only those that contain "foo::bar::baz". This allows
  setting breakpoint on C++ functions and methods without having to fully
  qualify all of the types that would appear in C++ mangled names.
- if the name contains ":" (not "::"), then NAME is assumed to be an ObjC
  selector.
_ otherwise, we assume just a plain function basename.

Now that "--name" is our "auto" mode, I introduced the new "--basename" option
("breakpoint set --basename NAME") to allow for function names that aren't 
methods or selectors, just basenames. This can also be used to ignore C++
namespaces and class hierarchies for class methods.

Fixed clang enumeration promotion types to be correct.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116293 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectBreakpoint.cpp b/source/Commands/CommandObjectBreakpoint.cpp
index e7cf0a8..a9d1615 100644
--- a/source/Commands/CommandObjectBreakpoint.cpp
+++ b/source/Commands/CommandObjectBreakpoint.cpp
@@ -104,7 +104,7 @@
         "Set the breakpoint by address, at the specified address."},
 
     { LLDB_OPT_SET_3, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
-        "Set the breakpoint by function name - for C++ this means namespaces and arguments will be ignored." },
+        "Set the breakpoint by function name." },
 
     { LLDB_OPT_SET_4, true, "fullname", 'F', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFullName,
         "Set the breakpoint by fully qualified function names. For C++ this means namespaces and all arguemnts, and "
@@ -119,6 +119,9 @@
     { LLDB_OPT_SET_7, true, "func-regex", 'r', required_argument, NULL, 0, eArgTypeRegularExpression,
         "Set the breakpoint by function name, evaluating a regular-expression to find the function name(s)." },
 
+    { LLDB_OPT_SET_8, true, "basename", 'b', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
+        "Set the breakpoint by function basename (C++ namespaces and arguments will be ignored)." },
+
     { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 
@@ -157,11 +160,16 @@
             m_line_num = Args::StringToUInt32 (option_arg, 0);
             break;
 
-        case 'n':
+        case 'b':
             m_func_name = option_arg;
             m_func_name_type_mask |= eFunctionNameTypeBase;
             break;
 
+        case 'n':
+            m_func_name = option_arg;
+            m_func_name_type_mask |= eFunctionNameTypeAuto;
+            break;
+
         case 'F':
             m_func_name = option_arg;
             m_func_name_type_mask |= eFunctionNameTypeFull;
@@ -391,17 +399,8 @@
                 uint32_t name_type_mask = m_options.m_func_name_type_mask;
                 
                 if (name_type_mask == 0)
-                {
-                
-                    if (m_options.m_func_name.find('(') != std::string::npos ||
-                        m_options.m_func_name.find("-[") == 0 ||
-                        m_options.m_func_name.find("+[") == 0)
-                        name_type_mask |= eFunctionNameTypeFull;
-                    else
-                        name_type_mask |= eFunctionNameTypeBase;
-                }
-                    
-                
+                    name_type_mask = eFunctionNameTypeAuto;
+                                    
                 if (use_module)
                 {
                     for (int i = 0; i < num_modules; ++i)