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.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 6648d4c86be..34fb4b8f426 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -73,7 +73,8 @@ Target::Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::Plat
m_source_manager(*this),
m_stop_hooks (),
m_stop_hook_next_id (0),
- m_suppress_stop_hooks (false)
+ m_suppress_stop_hooks (false),
+ m_suppress_synthetic_value(false)
{
SetEventName (eBroadcastBitBreakpointChanged, "breakpoint-changed");
SetEventName (eBroadcastBitModulesLoaded, "modules-loaded");
@@ -183,6 +184,7 @@ Target::Destroy()
m_stop_hooks.clear();
m_stop_hook_next_id = 0;
m_suppress_stop_hooks = false;
+ m_suppress_synthetic_value = false;
}
@@ -2106,6 +2108,7 @@ Target::SettingsController::CreateInstanceSettings (const char *instance_name)
#define TSC_DEFAULT_ARCH "default-arch"
#define TSC_EXPR_PREFIX "expr-prefix"
#define TSC_PREFER_DYNAMIC "prefer-dynamic-value"
+#define TSC_ENABLE_SYNTHETIC "enable-synthetic-value"
#define TSC_SKIP_PROLOGUE "skip-prologue"
#define TSC_SOURCE_MAP "source-map"
#define TSC_EXE_SEARCH_PATHS "exec-search-paths"
@@ -2144,6 +2147,13 @@ GetSettingNameForPreferDynamicValue ()
}
static const ConstString &
+GetSettingNameForEnableSyntheticValue ()
+{
+ static ConstString g_const_string (TSC_ENABLE_SYNTHETIC);
+ return g_const_string;
+}
+
+static const ConstString &
GetSettingNameForSourcePathMap ()
{
static ConstString g_const_string (TSC_SOURCE_MAP);
@@ -2291,6 +2301,7 @@ TargetInstanceSettings::TargetInstanceSettings
m_expr_prefix_file (),
m_expr_prefix_contents (),
m_prefer_dynamic_value (2),
+ m_enable_synthetic_value(true, true),
m_skip_prologue (true, true),
m_source_map (NULL, NULL),
m_exe_search_paths (),
@@ -2330,6 +2341,7 @@ TargetInstanceSettings::TargetInstanceSettings (const TargetInstanceSettings &rh
m_expr_prefix_file (rhs.m_expr_prefix_file),
m_expr_prefix_contents (rhs.m_expr_prefix_contents),
m_prefer_dynamic_value (rhs.m_prefer_dynamic_value),
+ m_enable_synthetic_value(rhs.m_enable_synthetic_value),
m_skip_prologue (rhs.m_skip_prologue),
m_source_map (rhs.m_source_map),
m_exe_search_paths (rhs.m_exe_search_paths),
@@ -2365,6 +2377,7 @@ TargetInstanceSettings::operator= (const TargetInstanceSettings &rhs)
m_expr_prefix_file = rhs.m_expr_prefix_file;
m_expr_prefix_contents = rhs.m_expr_prefix_contents;
m_prefer_dynamic_value = rhs.m_prefer_dynamic_value;
+ m_enable_synthetic_value = rhs.m_enable_synthetic_value;
m_skip_prologue = rhs.m_skip_prologue;
m_source_map = rhs.m_source_map;
m_exe_search_paths = rhs.m_exe_search_paths;
@@ -2442,6 +2455,13 @@ TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_n
if (err.Success())
m_prefer_dynamic_value = new_value;
}
+ else if (var_name == GetSettingNameForEnableSyntheticValue())
+ {
+ bool ok;
+ bool new_value = Args::StringToBoolean(value, true, &ok);
+ if (ok)
+ m_enable_synthetic_value.SetCurrentValue(new_value);
+ }
else if (var_name == GetSettingNameForSkipPrologue())
{
err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_skip_prologue);
@@ -2626,6 +2646,13 @@ TargetInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
{
value.AppendString (g_dynamic_value_types[m_prefer_dynamic_value].string_value);
}
+ else if (var_name == GetSettingNameForEnableSyntheticValue())
+ {
+ if (m_skip_prologue)
+ value.AppendString ("true");
+ else
+ value.AppendString ("false");
+ }
else if (var_name == GetSettingNameForSkipPrologue())
{
if (m_skip_prologue)
@@ -2824,6 +2851,7 @@ Target::SettingsController::instance_settings_table[] =
// ================= ================== =============== ======================= ====== ====== =========================================================================
{ TSC_EXPR_PREFIX , eSetVarTypeString , NULL , NULL, false, false, "Path to a file containing expressions to be prepended to all expressions." },
{ TSC_PREFER_DYNAMIC , eSetVarTypeEnum , NULL , g_dynamic_value_types, false, false, "Should printed values be shown as their dynamic value." },
+ { TSC_ENABLE_SYNTHETIC , eSetVarTypeBoolean, "true" , NULL, false, false, "Should synthetic values be used by default whenever available." },
{ TSC_SKIP_PROLOGUE , eSetVarTypeBoolean, "true" , NULL, false, false, "Skip function prologues when setting breakpoints by name." },
{ TSC_SOURCE_MAP , eSetVarTypeArray , NULL , NULL, false, false, "Source path remappings to use when locating source files from debug information." },
{ TSC_EXE_SEARCH_PATHS , eSetVarTypeArray , NULL , NULL, false, false, "Executable search paths to use when locating executable files whose paths don't match the local file system." },
OpenPOWER on IntegriCloud