summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index f1a09a7f979..c40b91b8ffb 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2265,6 +2265,15 @@ g_x86_dis_flavor_value_types[] =
{ 0, NULL, NULL }
};
+static OptionEnumValueElement
+g_load_script_from_sym_file_enums[] =
+{
+ {(int64_t)LoadScriptFromSymFile::eDefault, "default", "Don't load scripts but warn when they are found (default)"},
+ {(int64_t)LoadScriptFromSymFile::eNo, "no", "Don't load scripts"},
+ {(int64_t)LoadScriptFromSymFile::eYes, "yes", "Load scripts"},
+ { 0, NULL, NULL }
+};
+
static PropertyDefinition
g_properties[] =
{
@@ -2301,7 +2310,7 @@ g_properties[] =
// FIXME: This is the wrong way to do per-architecture settings, but we don't have a general per architecture settings system in place yet.
{ "x86-disassembly-flavor" , OptionValue::eTypeEnum , false, eX86DisFlavorDefault, NULL, g_x86_dis_flavor_value_types, "The default disassembly flavor to use for x86 or x86-64 targets." },
{ "use-fast-stepping" , OptionValue::eTypeBoolean , false, true, NULL, NULL, "Use a fast stepping algorithm based on running from branch to branch rather than instruction single-stepping." },
- { "load-script-from-symbol-file" , OptionValue::eTypeBoolean , false, false, NULL, NULL, "Allow LLDB to load scripting resources embedded in symbol files when available." },
+ { "load-script-from-symbol-file" , OptionValue::eTypeEnum , false, (int64_t)LoadScriptFromSymFile::eDefault, NULL, g_load_script_from_sym_file_enums, "Allow LLDB to load scripting resources embedded in symbol files when available." },
{ NULL , OptionValue::eTypeInvalid , false, 0 , NULL, NULL, NULL }
};
enum
@@ -2373,6 +2382,13 @@ public:
}
return ProtectedGetPropertyAtIndex (idx);
}
+
+ lldb::TargetSP
+ GetTargetSP ()
+ {
+ return m_target->shared_from_this();
+ }
+
protected:
void
@@ -2674,18 +2690,11 @@ TargetProperties::GetUseFastStepping () const
return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
}
-bool
+LoadScriptFromSymFile
TargetProperties::GetLoadScriptFromSymbolFile () const
{
const uint32_t idx = ePropertyLoadScriptFromSymbolFile;
- return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
-}
-
-void
-TargetProperties::SetLoadScriptFromSymbolFile (bool b)
-{
- const uint32_t idx = ePropertyLoadScriptFromSymbolFile;
- m_collection_sp->SetPropertyAtIndexAsBoolean(NULL, idx, b);
+ return (LoadScriptFromSymFile)m_collection_sp->GetPropertyAtIndexAsEnumeration (NULL, idx, g_properties[idx].default_uint_value);
}
const TargetPropertiesSP &
OpenPOWER on IntegriCloud