summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-03-27 02:35:13 +0000
committerEnrico Granata <egranata@apple.com>2012-03-27 02:35:13 +0000
commitc5bc412cf6cb8ca4a8aaa33b36519affea73f9b7 (patch)
tree115bd96399cee3c0d45d3bf48cce6132de153a52 /lldb/source/Interpreter/ScriptInterpreterPython.cpp
parentfe384a2c84fb9808be47c894bd445bc18891556a (diff)
downloadbcm5719-llvm-c5bc412cf6cb8ca4a8aaa33b36519affea73f9b7.tar.gz
bcm5719-llvm-c5bc412cf6cb8ca4a8aaa33b36519affea73f9b7.zip
Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior. There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic. The test suite has been changed accordingly. Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching llvm-svn: 153495
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 81bbf3f11ac..9c84eab00d2 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -234,6 +234,24 @@ ScriptInterpreterPython::Locker::~Locker()
DoFreeLock();
}
+class ForceDisableSyntheticChildren
+{
+public:
+ ForceDisableSyntheticChildren (Target* target) :
+ m_target(target)
+ {
+ m_old_value = target->GetSuppressSyntheticValue();
+ target->SetSuppressSyntheticValue(true);
+ }
+ ~ForceDisableSyntheticChildren ()
+ {
+ m_target->SetSuppressSyntheticValue(m_old_value);
+ }
+private:
+ Target* m_target;
+ bool m_old_value;
+};
+
ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interpreter) :
ScriptInterpreter (interpreter, eScriptLanguagePython),
m_embedded_python_pty (),
@@ -1328,6 +1346,7 @@ ScriptInterpreterPython::CreateSyntheticScriptedProvider (std::string class_name
{
Locker py_lock(this);
+ ForceDisableSyntheticChildren no_synthetics(target);
ret_val = g_swig_synthetic_script (class_name,
python_interpreter->m_dictionary_name.c_str(),
valobj);
@@ -1586,6 +1605,7 @@ ScriptInterpreterPython::CalculateNumChildren (const lldb::ScriptInterpreterObje
{
Locker py_lock(this);
+ ForceDisableSyntheticChildren no_synthetics(GetCommandInterpreter().GetDebugger().GetSelectedTarget().get());
ret_val = g_swig_calc_children (implementor);
}
@@ -1612,6 +1632,7 @@ ScriptInterpreterPython::GetChildAtIndex (const lldb::ScriptInterpreterObjectSP&
{
Locker py_lock(this);
+ ForceDisableSyntheticChildren no_synthetics(GetCommandInterpreter().GetDebugger().GetSelectedTarget().get());
child_ptr = g_swig_get_child_index (implementor,idx);
if (child_ptr != NULL && child_ptr != Py_None)
{
@@ -1648,6 +1669,7 @@ ScriptInterpreterPython::GetIndexOfChildWithName (const lldb::ScriptInterpreterO
{
Locker py_lock(this);
+ ForceDisableSyntheticChildren no_synthetics(GetCommandInterpreter().GetDebugger().GetSelectedTarget().get());
ret_val = g_swig_get_index_child (implementor, child_name);
}
@@ -1672,6 +1694,7 @@ ScriptInterpreterPython::UpdateSynthProviderInstance (const lldb::ScriptInterpre
{
Locker py_lock(this);
+ ForceDisableSyntheticChildren no_synthetics(GetCommandInterpreter().GetDebugger().GetSelectedTarget().get());
ret_val = g_swig_update_provider (implementor);
}
OpenPOWER on IntegriCloud