aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpoint.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-04-28 01:40:57 +0000
committerJim Ingham <jingham@apple.com>2016-04-28 01:40:57 +0000
commit76bb8d6719c2f664a69c4e2e89664c230f807a3b (patch)
tree23cecaf99000645d1da0f8027fa7b2cd61e843ae /lldb/source/Commands/CommandObjectBreakpoint.cpp
parent8bdcd522510f923185cdfaec66c4a78d0a0d38c0 (diff)
downloadllvm-76bb8d6719c2f664a69c4e2e89664c230f807a3b.zip
llvm-76bb8d6719c2f664a69c4e2e89664c230f807a3b.tar.gz
llvm-76bb8d6719c2f664a69c4e2e89664c230f807a3b.tar.bz2
Add the ability to limit "source regexp" breakpoints to a particular function
within a source file. This isn't done, I need to make the name match smarter (right now it requires an exact match which is annoying for methods of a class in a namespace. Also, though we use it in tests all over the place, it doesn't look like we have a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch. llvm-svn: 267834
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 8d4ec95..b7ed2a2 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -342,6 +342,10 @@ public:
error.SetErrorStringWithFormat ("invalid thread index string '%s'", option_arg);
break;
+ case 'X':
+ m_source_regex_func_names.insert(option_arg);
+ break;
+
default:
error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
break;
@@ -381,6 +385,7 @@ public:
m_all_files = false;
m_exception_extra_args.Clear();
m_move_to_nearest_code = eLazyBoolCalculate;
+ m_source_regex_func_names.clear();
}
const OptionDefinition*
@@ -423,6 +428,7 @@ public:
bool m_all_files;
Args m_exception_extra_args;
LazyBool m_move_to_nearest_code;
+ std::unordered_set<std::string> m_source_regex_func_names;
};
protected:
@@ -608,6 +614,7 @@ protected:
}
bp = target->CreateSourceRegexBreakpoint (&(m_options.m_modules),
&(m_options.m_filenames),
+ m_options.m_source_regex_func_names,
regexp,
internal,
m_options.m_hardware,
@@ -805,6 +812,9 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
{ LLDB_OPT_SET_3, true, "name", 'n', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
"Set the breakpoint by function name. Can be repeated multiple times to make one breakpoint for multiple names" },
+ { LLDB_OPT_SET_9, false, "source-regexp-function", 'X', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
+ "When used with '-p' limits the source regex to source contained in the named functions. Can be repeated multiple times." },
+
{ LLDB_OPT_SET_4, true, "fullname", 'F', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFullName,
"Set the breakpoint by fully qualified function names. For C++ this means namespaces and all arguments, and "
"for Objective C this means a full function prototype with class and selector. "
@@ -855,7 +865,7 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
"Sets Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."},
{ LLDB_OPT_SET_ALL, false, "breakpoint-name", 'N', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBreakpointName,
- "Adds this to the list of names for this breakopint."},
+ "Adds this to the list of names for this breakpoint."},
{ LLDB_OPT_OFFSET_APPLIES, false, "address-slide", 'R', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeAddress,
"Add the specified offset to whatever address(es) the breakpoint resolves to. "