From c53114e30aa428ff2fcfd48927ef05b3d250a371 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 25 Jul 2011 16:59:05 +0000 Subject: new flag -P to type synth add lets you type a Python class interactively added a final newline to fooSynthProvider.py new option to automatically save user input in InputReaderEZ checking for NULL pointers in several new places llvm-svn: 135916 --- lldb/source/Core/FormatClasses.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lldb/source/Core/FormatClasses.cpp') diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp index 9a232ae7af4..e321a40a310 100644 --- a/lldb/source/Core/FormatClasses.cpp +++ b/lldb/source/Core/FormatClasses.cpp @@ -164,15 +164,26 @@ SyntheticScriptProvider::FrontEnd::FrontEnd(std::string pclass, SyntheticChildrenFrontEnd(be), m_python_class(pclass) { + if (be.get() == NULL) + { + m_interpreter = NULL; + m_wrapper = NULL; + return; + } + m_interpreter = be->GetUpdatePoint().GetTarget()->GetDebugger().GetCommandInterpreter().GetScriptInterpreter(); - m_wrapper = (PyObject*)m_interpreter->CreateSyntheticScriptedProvider(m_python_class, m_backend); + + if (m_interpreter == NULL) + m_wrapper = NULL; + else + m_wrapper = (PyObject*)m_interpreter->CreateSyntheticScriptedProvider(m_python_class, m_backend); } std::string SyntheticScriptProvider::GetDescription() { StreamString sstr; - sstr.Printf("%s%s%s Python class: %s", + sstr.Printf("%s%s%s Python class %s", m_cascades ? "" : " (not cascading)", m_skip_pointers ? " (skip pointers)" : "", m_skip_references ? " (skip references)" : "", -- cgit v1.2.3