summaryrefslogtreecommitdiffstats
path: root/lldb/include
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/include')
-rw-r--r--lldb/include/lldb/API/SBValue.h8
-rw-r--r--lldb/include/lldb/Core/Debugger.h2
-rw-r--r--lldb/include/lldb/Core/Error.h3
-rw-r--r--lldb/include/lldb/Core/FormatManager.h290
-rw-r--r--lldb/include/lldb/Core/InputReader.h62
-rw-r--r--lldb/include/lldb/Core/InputReaderEZ.h81
-rw-r--r--lldb/include/lldb/Core/StringList.h10
-rw-r--r--lldb/include/lldb/Core/ValueObject.h9
-rw-r--r--lldb/include/lldb/Interpreter/ScriptInterpreter.h29
-rw-r--r--lldb/include/lldb/Interpreter/ScriptInterpreterPython.h17
-rw-r--r--lldb/include/lldb/Utility/PriorityPointerPair.h150
-rw-r--r--lldb/include/lldb/Utility/RefCounter.h2
-rw-r--r--lldb/include/lldb/lldb-forward-rtti.h2
-rw-r--r--lldb/include/lldb/lldb-forward.h2
14 files changed, 644 insertions, 23 deletions
diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h
index 40a461285b2..9fce5bc2876 100644
--- a/lldb/include/lldb/API/SBValue.h
+++ b/lldb/include/lldb/API/SBValue.h
@@ -167,6 +167,10 @@ public:
// classes.
lldb::SBValue
GetChildMemberWithName (const char *name, lldb::DynamicValueType use_dynamic);
+
+ // Expands nested expressions like .a->b[0].c[1]->d
+ lldb::SBValue
+ GetValueForExpressionPath(const char* expr_path);
uint32_t
GetNumChildren ();
@@ -190,12 +194,12 @@ public:
bool
GetExpressionPath (lldb::SBStream &description, bool qualify_cxx_base_classes);
+ SBValue (const lldb::ValueObjectSP &value_sp);
+
protected:
friend class SBValueList;
friend class SBFrame;
- SBValue (const lldb::ValueObjectSP &value_sp);
-
#ifndef SWIG
// Mimic shared pointer...
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index f43b842fd3b..ea9a648ee12 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -576,8 +576,6 @@ public:
static uint32_t
GetCount();
};
-
-
};
} // namespace lldb_private
diff --git a/lldb/include/lldb/Core/Error.h b/lldb/include/lldb/Core/Error.h
index a36d842224e..a0476c8353b 100644
--- a/lldb/include/lldb/Core/Error.h
+++ b/lldb/include/lldb/Core/Error.h
@@ -69,6 +69,9 @@ public:
explicit
Error (ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric);
+ explicit
+ Error (const char* err_str);
+
Error (const Error &rhs);
//------------------------------------------------------------------
/// Assignment operator.
diff --git a/lldb/include/lldb/Core/FormatManager.h b/lldb/include/lldb/Core/FormatManager.h
index f1bd52cc38b..1fc4756f0bf 100644
--- a/lldb/include/lldb/Core/FormatManager.h
+++ b/lldb/include/lldb/Core/FormatManager.h
@@ -50,8 +50,10 @@ namespace std
#include "lldb/Core/UserID.h"
#include "lldb/Core/UserSettingsController.h"
#include "lldb/Core/ValueObject.h"
+#include "lldb/Interpreter/ScriptInterpreterPython.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Platform.h"
+#include "lldb/Target/StackFrame.h"
#include "lldb/Target/TargetList.h"
namespace lldb_private {
@@ -67,8 +69,263 @@ public:
};
+struct ValueFormat
+{
+ bool m_cascades;
+ bool m_skip_pointers;
+ bool m_skip_references;
+ lldb::Format m_format;
+ ValueFormat (lldb::Format f = lldb::eFormatInvalid,
+ bool casc = false,
+ bool skipptr = false,
+ bool skipref = false) :
+ m_cascades(casc),
+ m_skip_pointers(skipptr),
+ m_skip_references(skipref),
+ m_format (f)
+ {
+ }
+
+ typedef lldb::SharedPtr<ValueFormat>::Type SharedPointer;
+ typedef bool(*ValueCallback)(void*, const char*, const ValueFormat::SharedPointer&);
+
+ ~ValueFormat()
+ {
+ }
+
+ bool
+ Cascades()
+ {
+ return m_cascades;
+ }
+ bool
+ SkipsPointers()
+ {
+ return m_skip_pointers;
+ }
+ bool
+ SkipsReferences()
+ {
+ return m_skip_references;
+ }
+
+ lldb::Format
+ GetFormat()
+ {
+ return m_format;
+ }
+
+ std::string
+ FormatObject(lldb::ValueObjectSP object)
+ {
+ if (!object.get())
+ return "NULL";
+
+ StreamString sstr;
+
+ if (ClangASTType::DumpTypeValue (object->GetClangAST(), // The clang AST
+ object->GetClangType(), // The clang type to display
+ &sstr,
+ m_format, // Format to display this type with
+ object->GetDataExtractor(), // Data to extract from
+ 0, // Byte offset into "data"
+ object->GetByteSize(), // Byte size of item in "data"
+ object->GetBitfieldBitSize(), // Bitfield bit size
+ object->GetBitfieldBitOffset())) // Bitfield bit offset
+ return (sstr.GetString());
+ else
+ {
+ return ("unsufficient data for value");
+ }
+
+ }
+
+};
+
struct SummaryFormat
{
+ bool m_cascades;
+ bool m_skip_pointers;
+ bool m_skip_references;
+ bool m_dont_show_children;
+ bool m_dont_show_value;
+ bool m_show_members_oneliner;
+
+ SummaryFormat(bool casc = false,
+ bool skipptr = false,
+ bool skipref = false,
+ bool nochildren = true,
+ bool novalue = true,
+ bool oneliner = false) :
+ m_cascades(casc),
+ m_skip_pointers(skipptr),
+ m_skip_references(skipref),
+ m_dont_show_children(nochildren),
+ m_dont_show_value(novalue),
+ m_show_members_oneliner(oneliner)
+ {
+ }
+
+ bool
+ Cascades()
+ {
+ return m_cascades;
+ }
+ bool
+ SkipsPointers()
+ {
+ return m_skip_pointers;
+ }
+ bool
+ SkipsReferences()
+ {
+ return m_skip_references;
+ }
+
+ bool
+ DoesPrintChildren() const
+ {
+ return !m_dont_show_children;
+ }
+
+ bool
+ DoesPrintValue() const
+ {
+ return !m_dont_show_value;
+ }
+
+ bool
+ IsOneliner() const
+ {
+ return m_show_members_oneliner;
+ }
+
+ virtual
+ ~SummaryFormat()
+ {
+ }
+
+ virtual std::string
+ FormatObject(lldb::ValueObjectSP object) = 0;
+
+ virtual std::string
+ GetDescription() = 0;
+
+ typedef lldb::SharedPtr<SummaryFormat>::Type SharedPointer;
+ typedef bool(*SummaryCallback)(void*, const char*, const SummaryFormat::SharedPointer&);
+ typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const SummaryFormat::SharedPointer&);
+
+};
+
+// simple string-based summaries, using ${var to show data
+struct StringSummaryFormat : public SummaryFormat
+{
+ std::string m_format;
+
+ StringSummaryFormat(bool casc = false,
+ bool skipptr = false,
+ bool skipref = false,
+ bool nochildren = true,
+ bool novalue = true,
+ bool oneliner = false,
+ std::string f = "") :
+ SummaryFormat(casc,skipptr,skipref,nochildren,novalue,oneliner),
+ m_format(f)
+ {
+ }
+
+ std::string
+ GetFormat()
+ {
+ return m_format;
+ }
+
+ virtual
+ ~StringSummaryFormat()
+ {
+ }
+
+ virtual std::string
+ FormatObject(lldb::ValueObjectSP object);
+
+ virtual std::string
+ GetDescription()
+ {
+ StreamString sstr;
+ sstr.Printf ("`%s`%s%s%s%s%s%s\n", m_format.c_str(),
+ m_cascades ? "" : " (not cascading)",
+ m_dont_show_children ? "" : " (show children)",
+ m_dont_show_value ? " (hide value)" : "",
+ m_show_members_oneliner ? " (one-line printout)" : "",
+ m_skip_pointers ? " (skip pointers)" : "",
+ m_skip_references ? " (skip references)" : "");
+ return sstr.GetString();
+ }
+
+};
+
+// Python-based summaries, running script code to show data
+struct ScriptSummaryFormat : public SummaryFormat
+{
+ std::string m_function_name;
+ std::string m_python_script;
+
+ ScriptSummaryFormat(bool casc = false,
+ bool skipptr = false,
+ bool skipref = false,
+ bool nochildren = true,
+ bool novalue = true,
+ bool oneliner = false,
+ std::string fname = "",
+ std::string pscri = "") :
+ SummaryFormat(casc,skipptr,skipref,nochildren,novalue,oneliner),
+ m_function_name(fname),
+ m_python_script(pscri)
+ {
+ }
+
+ std::string
+ GetFunctionName()
+ {
+ return m_function_name;
+ }
+
+ std::string
+ GetPythonScript()
+ {
+ return m_python_script;
+ }
+
+ virtual
+ ~ScriptSummaryFormat()
+ {
+ }
+
+ virtual std::string
+ FormatObject(lldb::ValueObjectSP object)
+ {
+ return std::string(ScriptInterpreterPython::CallPythonScriptFunction(m_function_name.c_str(),
+ object).c_str());
+ }
+
+ virtual std::string
+ GetDescription()
+ {
+ StreamString sstr;
+ sstr.Printf ("%s%s%s\n%s\n", m_cascades ? "" : " (not cascading)",
+ m_skip_pointers ? " (skip pointers)" : "",
+ m_skip_references ? " (skip references)" : "",
+ m_python_script.c_str());
+ return sstr.GetString();
+
+ }
+
+ typedef lldb::SharedPtr<ScriptSummaryFormat>::Type SharedPointer;
+
+};
+
+/*struct SummaryFormat
+{
std::string m_format;
bool m_dont_show_children;
bool m_dont_show_value;
@@ -116,32 +373,35 @@ struct SummaryFormat
typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const SummaryFormat::SharedPointer&);
};
-
-struct ValueFormat
+
+struct ScriptFormat
{
- lldb::Format m_format;
+ std::string m_function_name;
+ std::string m_python_script;
bool m_cascades;
bool m_skip_references;
bool m_skip_pointers;
- ValueFormat (lldb::Format f = lldb::eFormatInvalid,
- bool c = false,
- bool skipptr = false,
- bool skipref = false) :
- m_format (f),
+ ScriptFormat (std::string n,
+ std::string s = "",
+ bool c = false,
+ bool skipptr = false,
+ bool skipref = false) :
+ m_function_name (n),
+ m_python_script(s),
m_cascades (c),
m_skip_references(skipref),
m_skip_pointers(skipptr)
{
}
- typedef lldb::SharedPtr<ValueFormat>::Type SharedPointer;
- typedef bool(*ValueCallback)(void*, const char*, const ValueFormat::SharedPointer&);
+ typedef lldb::SharedPtr<ScriptFormat>::Type SharedPointer;
+ typedef bool(*ScriptCallback)(void*, const char*, const ScriptFormat::SharedPointer&);
- ~ValueFormat()
+ ~ScriptFormat()
{
}
-};
+};*/
template<typename KeyType, typename ValueType>
class FormatNavigator;
@@ -457,11 +717,13 @@ private:
typedef FormatNavigator<const char*, ValueFormat> ValueNavigator;
typedef FormatNavigator<const char*, SummaryFormat> SummaryNavigator;
typedef FormatNavigator<lldb::RegularExpressionSP, SummaryFormat> RegexSummaryNavigator;
+ typedef FormatNavigator<const char*, SummaryFormat> ScriptNavigator;
typedef ValueNavigator::MapType ValueMap;
typedef SummaryNavigator::MapType SummaryMap;
typedef RegexSummaryNavigator::MapType RegexSummaryMap;
typedef FormatMap<const char*, SummaryFormat> NamedSummariesMap;
+ typedef ScriptNavigator::MapType ScriptMap;
ValueNavigator m_value_nav;
SummaryNavigator m_summary_nav;
@@ -469,6 +731,8 @@ private:
NamedSummariesMap m_named_summaries_map;
+ ScriptNavigator m_script_nav;
+
uint32_t m_last_revision;
public:
@@ -478,6 +742,7 @@ public:
m_summary_nav(this),
m_regex_summary_nav(this),
m_named_summaries_map(this),
+ m_script_nav(this),
m_last_revision(0)
{
}
@@ -487,6 +752,7 @@ public:
SummaryNavigator& Summary() { return m_summary_nav; }
RegexSummaryNavigator& RegexSummary() { return m_regex_summary_nav; }
NamedSummariesMap& NamedSummary() { return m_named_summaries_map; }
+ ScriptNavigator& Script() { return m_script_nav; }
static bool
GetFormatFromCString (const char *format_cstr,
diff --git a/lldb/include/lldb/Core/InputReader.h b/lldb/include/lldb/Core/InputReader.h
index c1658a296cf..e1cc6aa2c08 100644
--- a/lldb/include/lldb/Core/InputReader.h
+++ b/lldb/include/lldb/Core/InputReader.h
@@ -12,7 +12,7 @@
#include "lldb/lldb-public.h"
#include "lldb/lldb-enumerations.h"
-#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Error.h"
#include "lldb/Host/Predicate.h"
@@ -27,6 +27,31 @@ public:
lldb::InputReaderAction notification,
const char *bytes,
size_t bytes_len);
+
+ struct HandlerData
+ {
+ InputReader& reader;
+ const char *bytes;
+ size_t bytes_len;
+ void* baton;
+
+ HandlerData(InputReader& r,
+ const char* b,
+ size_t l,
+ void* t) :
+ reader(r),
+ bytes(b),
+ bytes_len(l),
+ baton(t)
+ {
+ }
+
+ lldb::StreamSP
+ GetOutStream();
+
+ bool
+ GetBatchMode();
+ };
InputReader (Debugger &debugger);
@@ -41,6 +66,41 @@ public:
const char *prompt,
bool echo);
+ virtual Error Initialize(void* baton,
+ lldb::InputReaderGranularity token_size = lldb::eInputReaderGranularityLine,
+ const char* end_token = "DONE",
+ const char *prompt = "> ",
+ bool echo = true)
+ {
+ return Error("unimplemented");
+ }
+
+ // to use these handlers instead of the Callback function, you must subclass
+ // InputReaderEZ, and redefine the handlers for the events you care about
+ virtual void
+ ActivateHandler(HandlerData&) {}
+
+ virtual void
+ DeactivateHandler(HandlerData&) {}
+
+ virtual void
+ ReactivateHandler(HandlerData&) {}
+
+ virtual void
+ AsynchronousOutputWrittenHandler(HandlerData&) {}
+
+ virtual void
+ GotTokenHandler(HandlerData&) {}
+
+ virtual void
+ InterruptHandler(HandlerData&) {}
+
+ virtual void
+ EOFHandler(HandlerData&) {}
+
+ virtual void
+ DoneHandler(HandlerData&) {}
+
bool
IsDone () const
{
diff --git a/lldb/include/lldb/Core/InputReaderEZ.h b/lldb/include/lldb/Core/InputReaderEZ.h
new file mode 100644
index 00000000000..95f6af9fc95
--- /dev/null
+++ b/lldb/include/lldb/Core/InputReaderEZ.h
@@ -0,0 +1,81 @@
+//===-- InputReaderEZ.h -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_InputReaderEZ_h_
+#define liblldb_InputReaderEZ_h_
+
+#include "lldb/lldb-public.h"
+#include "lldb/lldb-enumerations.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/InputReader.h"
+#include "lldb/Host/Predicate.h"
+
+
+namespace lldb_private {
+
+class InputReaderEZ : public InputReader
+{
+
+private:
+
+ static size_t Callback_Impl(void *baton,
+ InputReader &reader,
+ lldb::InputReaderAction notification,
+ const char *bytes,
+ size_t bytes_len);
+public:
+
+ InputReaderEZ (Debugger &debugger) :
+ InputReader(debugger)
+ {}
+
+ virtual
+ ~InputReaderEZ ();
+
+ virtual Error Initialize(void* baton,
+ lldb::InputReaderGranularity token_size = lldb::eInputReaderGranularityLine,
+ const char* end_token = "DONE",
+ const char *prompt = "> ",
+ bool echo = true);
+
+ virtual void
+ ActivateHandler(HandlerData&) {}
+
+ virtual void
+ DeactivateHandler(HandlerData&) {}
+
+ virtual void
+ ReactivateHandler(HandlerData&) {}
+
+ virtual void
+ AsynchronousOutputWrittenHandler(HandlerData&) {}
+
+ virtual void
+ GotTokenHandler(HandlerData&) {}
+
+ virtual void
+ InterruptHandler(HandlerData&) {}
+
+ virtual void
+ EOFHandler(HandlerData&) {}
+
+ virtual void
+ DoneHandler(HandlerData&) {}
+
+protected:
+ friend class Debugger;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN (InputReaderEZ);
+
+};
+
+} // namespace lldb_private
+
+#endif // #ifndef liblldb_InputReaderEZ_h_
diff --git a/lldb/include/lldb/Core/StringList.h b/lldb/include/lldb/Core/StringList.h
index b080919e87d..c4edb82ba8c 100644
--- a/lldb/include/lldb/Core/StringList.h
+++ b/lldb/include/lldb/Core/StringList.h
@@ -68,7 +68,17 @@ public:
size_t
SplitIntoLines (const char *lines, size_t len);
+
+ std::string
+ CopyList(const char* item_preamble = NULL,
+ const char* items_sep = "\n");
+
+ StringList&
+ operator << (const char* str);
+ StringList&
+ operator << (StringList strings);
+
private:
STLStringArray m_strings;
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 87f41d90371..d7e39deb5b8 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -27,6 +27,7 @@
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/StackID.h"
+#include "lldb/Utility/PriorityPointerPair.h"
#include "lldb/Utility/SharedCluster.h"
namespace lldb_private {
@@ -75,7 +76,8 @@ public:
{
eDisplayValue = 1,
eDisplaySummary,
- eDisplayLanguageSpecific
+ eDisplayLanguageSpecific,
+ eDisplayLocation
};
enum ExpressionPathScanEndReason
@@ -731,8 +733,8 @@ protected:
lldb::Format m_format;
uint32_t m_last_format_mgr_revision;
lldb::SummaryFormatSP m_last_summary_format;
- lldb::ValueFormatSP m_last_value_format;
lldb::SummaryFormatSP m_forced_summary_format;
+ lldb::ValueFormatSP m_last_value_format;
lldb::user_id_t m_user_id_of_forced_summary;
bool m_value_is_valid:1,
m_value_did_change:1,
@@ -802,6 +804,9 @@ protected:
void
SetValueIsValid (bool valid);
+
+ void
+ ClearUserVisibleData();
public:
lldb::addr_t
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
index 438222c7456..38ac00eaad2 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
@@ -26,6 +26,13 @@ public:
const char *session_dictionary_name,
const lldb::StackFrameSP& frame_sp,
const lldb::BreakpointLocationSP &bp_loc_sp);
+
+ typedef
+
+ typedef std::string (*SWIGPythonTypeScriptCallbackFunction) (const char *python_function_name,
+ const char *session_dictionary_name,
+ const lldb::ValueObjectSP& valobj_sp);
+
typedef enum
{
eCharPtr,
@@ -77,6 +84,25 @@ public:
{
return false;
}
+
+ virtual bool
+ GenerateTypeScriptFunction (StringList &input, StringList &output)
+ {
+ return false;
+ }
+
+ // use this if the function code is just a one-liner script
+ virtual bool
+ GenerateTypeScriptFunction (const char* oneliner, StringList &output)
+ {
+ return false;
+ }
+
+ virtual bool
+ GenerateFunction(std::string& signature, StringList &input, StringList &output)
+ {
+ return false;
+ }
virtual void
CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
@@ -104,7 +130,8 @@ public:
static void
InitializeInterpreter (SWIGInitCallback python_swig_init_callback,
- SWIGBreakpointCallbackFunction python_swig_breakpoint_callback);
+ SWIGBreakpointCallbackFunction python_swig_breakpoint_callback,
+ SWIGPythonTypeScriptCallbackFunction python_swig_typescript_callback);
static void
TerminateInterpreter ();
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
index 4b1c38d5cdc..5d33e7953b7 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
@@ -50,6 +50,16 @@ public:
ExportFunctionDefinitionToInterpreter (StringList &function_def);
bool
+ GenerateTypeScriptFunction (StringList &input, StringList &output);
+
+ // use this if the function code is just a one-liner script
+ bool
+ GenerateTypeScriptFunction (const char* oneliner, StringList &output);
+
+ bool
+ GenerateFunction(std::string& signature, StringList &input, StringList &output);
+
+ bool
GenerateBreakpointCommandCallbackData (StringList &input, StringList &output);
static size_t
@@ -64,6 +74,10 @@ public:
StoppointCallbackContext *context,
lldb::user_id_t break_id,
lldb::user_id_t break_loc_id);
+
+ static std::string
+ CallPythonScriptFunction (const char *python_function_name,
+ lldb::ValueObjectSP valobj);
void
CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
@@ -88,7 +102,8 @@ public:
static void
InitializeInterpreter (SWIGInitCallback python_swig_init_callback,
- SWIGBreakpointCallbackFunction python_swig_breakpoint_callback);
+ SWIGBreakpointCallbackFunction python_swig_breakpoint_callback,
+ SWIGPythonTypeScriptCallbackFunction python_swig_typescript_callback);
protected:
diff --git a/lldb/include/lldb/Utility/PriorityPointerPair.h b/lldb/include/lldb/Utility/PriorityPointerPair.h
new file mode 100644
index 00000000000..949173d302e
--- /dev/null
+++ b/lldb/include/lldb/Utility/PriorityPointerPair.h
@@ -0,0 +1,150 @@
+//===-- PriorityPointerPair.h ----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_PriorityPointerPair_h_
+#define liblldb_PriorityPointerPair_h_
+
+#include "lldb/lldb-public.h"
+#include "lldb/Utility/SharingPtr.h"
+
+namespace lldb_utility {
+
+//----------------------------------------------------------------------
+// A prioritized pair of SharedPtr<T>. One of the two pointers is high
+// priority, the other is low priority.
+// The Get() method always returns high, if *high != NULL,
+// otherwise, low is returned (even if *low == NULL)
+//----------------------------------------------------------------------
+
+template<typename T>
+class PriorityPointerPair
+{
+public:
+
+ typedef T& reference_type;
+ typedef T* pointer_type;
+
+ typedef typename lldb::SharedPtr<T>::Type T_SP;
+
+ PriorityPointerPair() :
+ m_high(),
+ m_low()
+ {}
+
+ PriorityPointerPair(pointer_type high,
+ pointer_type low) :
+ m_high(high),
+ m_low(low)
+ {}
+
+ PriorityPointerPair(pointer_type low) :
+ m_high(),
+ m_low(low)
+ {}
+
+ PriorityPointerPair(T_SP& high,
+ T_SP& low) :
+ m_high(high),
+ m_low(low)
+ {}
+
+ PriorityPointerPair(T_SP& low) :
+ m_high(),
+ m_low(low)
+ {}
+
+ void
+ SwapLow(pointer_type l)
+ {
+ m_low.swap(l);
+ }
+
+ void
+ SwapHigh(pointer_type h)
+ {
+ m_high.swap(h);
+ }
+
+ void
+ SwapLow(T_SP l)
+ {
+ m_low.swap(l);
+ }
+
+ void
+ SwapHigh(T_SP h)
+ {
+ m_high.swap(h);
+ }
+
+ T_SP
+ GetLow()
+ {
+ return m_low;
+ }
+
+ T_SP
+ GetHigh()
+ {
+ return m_high;
+ }
+
+ T_SP
+ Get()
+ {
+ if (m_high.get())
+ return m_high;
+ return m_low;
+ }
+
+ void
+ ResetHigh()
+ {
+ m_high.reset();
+ }
+
+ void
+ ResetLow()
+ {
+ m_low.reset();
+ }
+
+ void
+ Reset()
+ {
+ ResetLow();
+ ResetHigh();
+ }
+
+ reference_type
+ operator*() const
+ {
+ return Get().operator*();
+ }
+
+ pointer_type
+ operator->() const
+ {
+ return Get().operator->();
+ }
+
+ ~PriorityPointerPair();
+
+private:
+
+ T_SP m_high;
+ T_SP m_low;
+
+ DISALLOW_COPY_AND_ASSIGN (PriorityPointerPair);
+
+};
+
+} // namespace lldb_utility
+
+#endif // #ifndef liblldb_PriorityPointerPair_h_
diff --git a/lldb/include/lldb/Utility/RefCounter.h b/lldb/include/lldb/Utility/RefCounter.h
index 7c3e341537e..6daed5498eb 100644
--- a/lldb/include/lldb/Utility/RefCounter.h
+++ b/lldb/include/lldb/Utility/RefCounter.h
@@ -20,8 +20,6 @@ namespace lldb_utility {
// RefCounter ref(ptr);
// (of course, the pointer is a shared resource, and must be accessible to
// everyone who needs it). Synchronization is handled by RefCounter itself
-// To check if more than 1 RefCounter is attached to the same value, you can
-// either call shared(), or simply cast ref to bool
// The counter is decreased each time a RefCounter to it goes out of scope
//----------------------------------------------------------------------
class RefCounter
diff --git a/lldb/include/lldb/lldb-forward-rtti.h b/lldb/include/lldb/lldb-forward-rtti.h
index b5a02d6d9c0..858e521ebd9 100644
--- a/lldb/include/lldb/lldb-forward-rtti.h
+++ b/lldb/include/lldb/lldb-forward-rtti.h
@@ -56,11 +56,13 @@ namespace lldb {
typedef SharedPtr<lldb_private::RegularExpression>::Type RegularExpressionSP;
typedef SharedPtr<lldb_private::Section>::Type SectionSP;
typedef SharedPtr<lldb_private::SearchFilter>::Type SearchFilterSP;
+ typedef SharedPtr<lldb_private::ScriptSummaryFormat>::Type ScriptFormatSP;
typedef SharedPtr<lldb_private::StackFrame>::Type StackFrameSP;
typedef SharedPtr<lldb_private::StackFrameList>::Type StackFrameListSP;
typedef SharedPtr<lldb_private::StopInfo>::Type StopInfoSP;
typedef SharedPtr<lldb_private::StoppointLocation>::Type StoppointLocationSP;
typedef SharedPtr<lldb_private::Stream>::Type StreamSP;
+ typedef SharedPtr<lldb_private::StringSummaryFormat>::Type StringSummaryFormatSP;
typedef SharedPtr<lldb_private::SummaryFormat>::Type SummaryFormatSP;
typedef SharedPtr<lldb_private::SymbolFile>::Type SymbolFileSP;
typedef SharedPtr<lldb_private::SymbolContextSpecifier>::Type SymbolContextSpecifierSP;
diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h
index 4b3a97fc4d1..9d616d19cc6 100644
--- a/lldb/include/lldb/lldb-forward.h
+++ b/lldb/include/lldb/lldb-forward.h
@@ -114,6 +114,7 @@ class RegisterLocationList;
class RegisterValue;
class RegularExpression;
class Scalar;
+class ScriptSummaryFormat;
class ScriptInterpreter;
class ScriptInterpreterPython;
class SearchFilter;
@@ -131,6 +132,7 @@ class Stream;
class StreamFile;
class StreamString;
class StringList;
+class StringSummaryFormat;
class SummaryFormat;
class Symbol;
class SymbolContext;
OpenPOWER on IntegriCloud