diff options
author | Enrico Granata <egranata@apple.com> | 2012-10-22 18:18:36 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-10-22 18:18:36 +0000 |
commit | e3e91517ffd7e63bcb5b9d196f85e2b09802b414 (patch) | |
tree | 16ba51bd013c2fb1d9753e2c6a6aae958202f892 /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
parent | 2f758cf8bafb527e9a709043d9704449a5f767b8 (diff) | |
download | bcm5719-llvm-e3e91517ffd7e63bcb5b9d196f85e2b09802b414.tar.gz bcm5719-llvm-e3e91517ffd7e63bcb5b9d196f85e2b09802b414.zip |
<rdar://problem/12437442>
Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar*
If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was
no trivial way for us to change the SP inside an SBValue on the fly
This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM)
As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython
Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases)
llvm-svn: 166426
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index efb884135fd..a6a94f4f55a 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -197,24 +197,6 @@ 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::PythonInputReaderManager::PythonInputReaderManager (ScriptInterpreterPython *interpreter) : m_interpreter(interpreter), m_debugger_sp(), @@ -1933,10 +1915,9 @@ 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); + ret_val = g_swig_synthetic_script (class_name, + python_interpreter->m_dictionary_name.c_str(), + valobj); } return MakeScriptObject(ret_val); @@ -2275,8 +2256,7 @@ ScriptInterpreterPython::CalculateNumChildren (const lldb::ScriptInterpreterObje { Locker py_lock(this); - ForceDisableSyntheticChildren no_synthetics(GetCommandInterpreter().GetDebugger().GetSelectedTarget().get()); - ret_val = g_swig_calc_children (implementor); + ret_val = g_swig_calc_children (implementor); } return ret_val; @@ -2302,8 +2282,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); + child_ptr = g_swig_get_child_index (implementor,idx); if (child_ptr != NULL && child_ptr != Py_None) { value_sb = (lldb::SBValue*)g_swig_cast_to_sbvalue(child_ptr); @@ -2339,8 +2318,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); + ret_val = g_swig_get_index_child (implementor, child_name); } return ret_val; @@ -2364,8 +2342,7 @@ ScriptInterpreterPython::UpdateSynthProviderInstance (const lldb::ScriptInterpre { Locker py_lock(this); - ForceDisableSyntheticChildren no_synthetics(GetCommandInterpreter().GetDebugger().GetSelectedTarget().get()); - ret_val = g_swig_update_provider (implementor); + ret_val = g_swig_update_provider (implementor); } return ret_val; |