Add an "extra-startup-commands" process setting so we can send some command strings to the actual process plugin to interpret as it wishes.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159511 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index fceeafd..dabad32 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -4866,7 +4866,9 @@
}
ProcessInstanceSettings::ProcessInstanceSettings (const ProcessInstanceSettings &rhs) :
- InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString())
+ InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString()),
+ m_disable_memory_cache(rhs.m_disable_memory_cache),
+ m_extra_startup_commands (rhs.m_extra_startup_commands)
{
if (m_instance_name != InstanceSettings::GetDefaultName())
{
@@ -4888,6 +4890,8 @@
{
if (this != &rhs)
{
+ m_disable_memory_cache = rhs.m_disable_memory_cache;
+ m_extra_startup_commands = rhs.m_extra_startup_commands;
}
return *this;
@@ -4919,6 +4923,10 @@
}
}
+ else if (var_name == GetExtraStartupCommandVarName())
+ {
+ UserSettingsController::UpdateStringArrayVariable (op, index_value, m_extra_startup_commands, value, err);
+ }
}
void
@@ -4947,6 +4955,15 @@
value.AppendString(m_disable_memory_cache ? "true" : "false");
return true;
}
+ else if (var_name == GetExtraStartupCommandVarName())
+ {
+ if (m_extra_startup_commands.GetArgumentCount() > 0)
+ {
+ for (int i = 0; i < m_extra_startup_commands.GetArgumentCount(); ++i)
+ value.AppendString (m_extra_startup_commands.GetArgumentAtIndex (i));
+ }
+ return true;
+ }
else
{
if (err)
@@ -4976,6 +4993,14 @@
return disable_memory_cache_var_name;
}
+const ConstString &
+ProcessInstanceSettings::GetExtraStartupCommandVarName () const
+{
+ static ConstString extra_startup_command_var_name ("extra-startup-command");
+
+ return extra_startup_command_var_name;
+}
+
//--------------------------------------------------
// SettingsController Variable Tables
//--------------------------------------------------
@@ -4999,6 +5024,7 @@
"true",
#endif
NULL, false, false, "Disable reading and caching of memory in fixed-size units." },
+ { "extra-startup-command", eSetVarTypeArray, NULL, NULL, false, false, "A list containing extra commands understood by the particular process plugin used." },
{ NULL, eSetVarTypeNone, NULL, NULL, false, false, NULL }
};