aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpoint.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-09-22 23:42:42 +0000
committerJim Ingham <jingham@apple.com>2016-09-22 23:42:42 +0000
commit2d3628e1f0c52db37d53061f2113e90e52ca0200 (patch)
treee2e551b2572b96b30b5fc7c89963e91375bdc013 /lldb/source/Commands/CommandObjectBreakpoint.cpp
parentbe0ed59cdc9b765869b0a2355b185809507a02db (diff)
downloadllvm-2d3628e1f0c52db37d53061f2113e90e52ca0200.zip
llvm-2d3628e1f0c52db37d53061f2113e90e52ca0200.tar.gz
llvm-2d3628e1f0c52db37d53061f2113e90e52ca0200.tar.bz2
Add the ability to append breakpoints to the save file.
llvm-svn: 282212
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 1e90b57..cb6d1d8 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -2210,7 +2210,8 @@ private:
#pragma mark Write::CommandOptions
static OptionDefinition g_breakpoint_write_options[] = {
// clang-format off
- { LLDB_OPT_SET_ALL, true, "file", 'f', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eDiskFileCompletion, eArgTypeFilename, "The file into which to write the breakpoints." },
+ { LLDB_OPT_SET_ALL, true, "file", 'f', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eDiskFileCompletion, eArgTypeFilename, "The file into which to write the breakpoints." },
+ { LLDB_OPT_SET_ALL, false, "append",'a', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Append to saved breakpoints file if it exists."},
// clang-format on
};
@@ -2251,6 +2252,9 @@ public:
case 'f':
m_filename.assign(option_arg);
break;
+ case 'a':
+ m_append = true;
+ break;
default:
error.SetErrorStringWithFormat("unrecognized option '%c'",
short_option);
@@ -2262,6 +2266,7 @@ public:
void OptionParsingStarting(ExecutionContext *execution_context) override {
m_filename.clear();
+ m_append = false;
}
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
@@ -2271,6 +2276,7 @@ public:
// Instance variables to hold the values for command options.
std::string m_filename;
+ bool m_append = false;
};
protected:
@@ -2296,7 +2302,8 @@ protected:
}
}
Error error = target->SerializeBreakpointsToFile(
- FileSpec(m_options.m_filename.c_str(), true), valid_bp_ids);
+ FileSpec(m_options.m_filename.c_str(), true), valid_bp_ids,
+ m_options.m_append);
if (!error.Success()) {
result.AppendErrorWithFormat("error serializing breakpoints: %s.",
error.AsCString());