aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index bb6220a..b3e2f6a 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1180,12 +1180,13 @@ static constexpr OptionEnumValues SaveCoreStyles() {
class CommandObjectProcessSaveCore : public CommandObjectParsed {
public:
CommandObjectProcessSaveCore(CommandInterpreter &interpreter)
- : CommandObjectParsed(interpreter, "process save-core",
- "Save the current process as a core file using an "
- "appropriate file type.",
- "process save-core [-s corefile-style] FILE",
- eCommandRequiresProcess | eCommandTryTargetAPILock |
- eCommandProcessMustBeLaunched) {}
+ : CommandObjectParsed(
+ interpreter, "process save-core",
+ "Save the current process as a core file using an "
+ "appropriate file type.",
+ "process save-core [-s corefile-style -p plugin-name] FILE",
+ eCommandRequiresProcess | eCommandTryTargetAPILock |
+ eCommandProcessMustBeLaunched) {}
~CommandObjectProcessSaveCore() override = default;
@@ -1208,6 +1209,9 @@ public:
Status error;
switch (short_option) {
+ case 'p':
+ m_requested_plugin_name.SetString(option_arg);
+ break;
case 's':
m_requested_save_core_style =
(lldb::SaveCoreStyle)OptionArgParser::ToOptionEnum(
@@ -1223,10 +1227,12 @@ public:
void OptionParsingStarting(ExecutionContext *execution_context) override {
m_requested_save_core_style = eSaveCoreUnspecified;
+ m_requested_plugin_name.Clear();
}
// Instance variables to hold the values for command options.
SaveCoreStyle m_requested_save_core_style;
+ ConstString m_requested_plugin_name;
};
protected:
@@ -1237,7 +1243,8 @@ protected:
FileSpec output_file(command.GetArgumentAtIndex(0));
SaveCoreStyle corefile_style = m_options.m_requested_save_core_style;
Status error =
- PluginManager::SaveCore(process_sp, output_file, corefile_style);
+ PluginManager::SaveCore(process_sp, output_file, corefile_style,
+ m_options.m_requested_plugin_name);
if (error.Success()) {
if (corefile_style == SaveCoreStyle::eSaveCoreDirtyOnly ||
corefile_style == SaveCoreStyle::eSaveCoreStackOnly) {