diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-12 04:29:14 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-12 04:29:14 +0000 |
commit | e02b850483251d82e89d574269c4a38f18a6b422 (patch) | |
tree | d99880f8aa27664e5e2a1d75b427d0b4bd350523 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 5627fd71c87cc82aefb05b2946deb3c688bbad2c (diff) | |
download | bcm5719-llvm-e02b850483251d82e89d574269c4a38f18a6b422.tar.gz bcm5719-llvm-e02b850483251d82e89d574269c4a38f18a6b422.zip |
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.
llvm-svn: 116293
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index e7cf0a8bb95..a9d1615dfca 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -104,7 +104,7 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] = "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 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] = { 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 @@ CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, cons 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 @@ CommandObjectBreakpointSet::Execute 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) |