Index: lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h =================================================================== --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h @@ -17,10 +17,10 @@ #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointResolver.h" #include "lldb/Core/Address.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/SearchFilter.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h =================================================================== --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h @@ -17,7 +17,7 @@ // Other libraries and framework includes // Project includes #include "lldb/Breakpoint/BreakpointResolver.h" -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/AddressResolver.h =================================================================== --- lldb/trunk/include/lldb/Core/AddressResolver.h +++ lldb/trunk/include/lldb/Core/AddressResolver.h @@ -18,9 +18,9 @@ // Project includes #include "lldb/Core/Address.h" #include "lldb/Core/AddressRange.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/SearchFilter.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/AddressResolverName.h =================================================================== --- lldb/trunk/include/lldb/Core/AddressResolverName.h +++ lldb/trunk/include/lldb/Core/AddressResolverName.h @@ -13,7 +13,7 @@ // Project includes #include "lldb/Core/AddressResolver.h" -#include "lldb/Core/RegularExpression.h" +#include "lldb/Utility/RegularExpression.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/ArchSpec.h =================================================================== --- lldb/trunk/include/lldb/Core/ArchSpec.h +++ lldb/trunk/include/lldb/Core/ArchSpec.h @@ -12,7 +12,7 @@ #if defined(__cplusplus) -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-forward.h" #include "llvm/ADT/Triple.h" Index: lldb/trunk/include/lldb/Core/Broadcaster.h =================================================================== --- lldb/trunk/include/lldb/Core/Broadcaster.h +++ lldb/trunk/include/lldb/Core/Broadcaster.h @@ -21,7 +21,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" #include "llvm/ADT/SmallVector.h" Index: lldb/trunk/include/lldb/Core/Communication.h =================================================================== --- lldb/trunk/include/lldb/Core/Communication.h +++ lldb/trunk/include/lldb/Core/Communication.h @@ -19,8 +19,8 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Broadcaster.h" -#include "lldb/Core/Error.h" #include "lldb/Host/HostThread.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/Timeout.h" #include "lldb/lldb-private.h" Index: lldb/trunk/include/lldb/Core/ConstString.h =================================================================== --- lldb/trunk/include/lldb/Core/ConstString.h +++ lldb/trunk/include/lldb/Core/ConstString.h @@ -1,479 +0,0 @@ -//===-- ConstString.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_ConstString_h_ -#define liblldb_ConstString_h_ - -// C Includes -// C++ Includes -// Other libraries and framework includes -#include "llvm/ADT/StringRef.h" - -// Project includes -#include "lldb/lldb-private.h" - -namespace lldb_private { - -//---------------------------------------------------------------------- -/// @class ConstString ConstString.h "lldb/Core/ConstString.h" -/// @brief A uniqued constant string class. -/// -/// Provides an efficient way to store strings as uniqued strings. After -/// the strings are uniqued, finding strings that are equal to one -/// another is very fast as just the pointers need to be compared. It -/// also allows for many common strings from many different sources to -/// be shared to keep the memory footprint low. -/// -/// No reference counting is done on strings that are added to the -/// string pool, once strings are added they are in the string pool for -/// the life of the program. -//---------------------------------------------------------------------- -class ConstString { -public: - //------------------------------------------------------------------ - /// Default constructor - /// - /// Initializes the string to an empty string. - //------------------------------------------------------------------ - ConstString() : m_string(nullptr) {} - - //------------------------------------------------------------------ - /// Copy constructor - /// - /// Copies the string value in \a rhs into this object. - /// - /// @param[in] rhs - /// Another string object to copy. - //------------------------------------------------------------------ - ConstString(const ConstString &rhs) : m_string(rhs.m_string) {} - - explicit ConstString(const llvm::StringRef &s); - - //------------------------------------------------------------------ - /// Construct with C String value - /// - /// Constructs this object with a C string by looking to see if the - /// C string already exists in the global string pool. If it doesn't - /// exist, it is added to the string pool. - /// - /// @param[in] cstr - /// A NULL terminated C string to add to the string pool. - //------------------------------------------------------------------ - explicit ConstString(const char *cstr); - - //------------------------------------------------------------------ - /// Construct with C String value with max length - /// - /// Constructs this object with a C string with a length. If - /// \a max_cstr_len is greater than the actual length of the string, - /// the string length will be truncated. This allows substrings to - /// be created without the need to NULL terminate the string as it - /// is passed into this function. - /// - /// @param[in] cstr - /// A pointer to the first character in the C string. The C - /// string can be NULL terminated in a buffer that contains - /// more characters than the length of the string, or the - /// string can be part of another string and a new substring - /// can be created. - /// - /// @param[in] max_cstr_len - /// The max length of \a cstr. If the string length of \a cstr - /// is less than \a max_cstr_len, then the string will be - /// truncated. If the string length of \a cstr is greater than - /// \a max_cstr_len, then only max_cstr_len bytes will be used - /// from \a cstr. - //------------------------------------------------------------------ - explicit ConstString(const char *cstr, size_t max_cstr_len); - - //------------------------------------------------------------------ - /// Destructor - /// - /// Since constant string values are currently not reference counted, - /// there isn't much to do here. - //------------------------------------------------------------------ - ~ConstString() = default; - - //---------------------------------------------------------------------- - /// C string equality binary predicate function object for ConstString - /// objects. - //---------------------------------------------------------------------- - struct StringIsEqual { - //-------------------------------------------------------------- - /// C equality test. - /// - /// Two C strings are equal when they are contained in ConstString - /// objects when their pointer values are equal to each other. - /// - /// @return - /// Returns \b true if the C string in \a lhs is equal to - /// the C string value in \a rhs, \b false otherwise. - //-------------------------------------------------------------- - bool operator()(const char *lhs, const char *rhs) const { - return lhs == rhs; - } - }; - - //------------------------------------------------------------------ - /// Convert to bool operator. - /// - /// This allows code to check a ConstString object to see if it - /// contains a valid string using code such as: - /// - /// @code - /// ConstString str(...); - /// if (str) - /// { ... - /// @endcode - /// - /// @return - /// /b True this object contains a valid non-empty C string, \b - /// false otherwise. - //------------------------------------------------------------------ - explicit operator bool() const { return m_string && m_string[0]; } - - //------------------------------------------------------------------ - /// Assignment operator - /// - /// Assigns the string in this object with the value from \a rhs. - /// - /// @param[in] rhs - /// Another string object to copy into this object. - /// - /// @return - /// A const reference to this object. - //------------------------------------------------------------------ - const ConstString &operator=(const ConstString &rhs) { - m_string = rhs.m_string; - return *this; - } - - //------------------------------------------------------------------ - /// Equal to operator - /// - /// Returns true if this string is equal to the string in \a rhs. - /// This operation is very fast as it results in a pointer - /// comparison since all strings are in a uniqued in a global string - /// pool. - /// - /// @param[in] rhs - /// Another string object to compare this object to. - /// - /// @return - /// @li \b true if this object is equal to \a rhs. - /// @li \b false if this object is not equal to \a rhs. - //------------------------------------------------------------------ - bool operator==(const ConstString &rhs) const { - // We can do a pointer compare to compare these strings since they - // must come from the same pool in order to be equal. - return m_string == rhs.m_string; - } - - //------------------------------------------------------------------ - /// Not equal to operator - /// - /// Returns true if this string is not equal to the string in \a rhs. - /// This operation is very fast as it results in a pointer - /// comparison since all strings are in a uniqued in a global string - /// pool. - /// - /// @param[in] rhs - /// Another string object to compare this object to. - /// - /// @return - /// @li \b true if this object is not equal to \a rhs. - /// @li \b false if this object is equal to \a rhs. - //------------------------------------------------------------------ - bool operator!=(const ConstString &rhs) const { - return m_string != rhs.m_string; - } - - bool operator<(const ConstString &rhs) const; - - //------------------------------------------------------------------ - /// Get the string value as a C string. - /// - /// Get the value of the contained string as a NULL terminated C - /// string value. - /// - /// If \a value_if_empty is nullptr, then nullptr will be returned. - /// - /// @return - /// Returns \a value_if_empty if the string is empty, otherwise - /// the C string value contained in this object. - //------------------------------------------------------------------ - const char *AsCString(const char *value_if_empty = nullptr) const { - return (IsEmpty() ? value_if_empty : m_string); - } - - //------------------------------------------------------------------ - /// Get the string value as a llvm::StringRef - /// - /// @return - /// Returns a new llvm::StringRef object filled in with the - /// needed data. - //------------------------------------------------------------------ - llvm::StringRef GetStringRef() const { - return llvm::StringRef(m_string, GetLength()); - } - - //------------------------------------------------------------------ - /// Get the string value as a C string. - /// - /// Get the value of the contained string as a NULL terminated C - /// string value. Similar to the ConstString::AsCString() function, - /// yet this function will always return nullptr if the string is not - /// valid. So this function is a direct accessor to the string - /// pointer value. - /// - /// @return - /// Returns nullptr the string is invalid, otherwise the C string - /// value contained in this object. - //------------------------------------------------------------------ - const char *GetCString() const { return m_string; } - - //------------------------------------------------------------------ - /// Get the length in bytes of string value. - /// - /// The string pool stores the length of the string, so we can avoid - /// calling strlen() on the pointer value with this function. - /// - /// @return - /// Returns the number of bytes that this string occupies in - /// memory, not including the NULL termination byte. - //------------------------------------------------------------------ - size_t GetLength() const; - - //------------------------------------------------------------------ - /// Clear this object's state. - /// - /// Clear any contained string and reset the value to the an empty - /// string value. - //------------------------------------------------------------------ - void Clear() { m_string = nullptr; } - - //------------------------------------------------------------------ - /// Equal to operator - /// - /// Returns true if this string is equal to the string in \a rhs. - /// If case sensitive equality is tested, this operation is very - /// fast as it results in a pointer comparison since all strings - /// are in a uniqued in a global string pool. - /// - /// @param[in] rhs - /// The Left Hand Side const ConstString object reference. - /// - /// @param[in] rhs - /// The Right Hand Side const ConstString object reference. - /// - /// @param[in] case_sensitive - /// Case sensitivity. If true, case sensitive equality - /// will be tested, otherwise character case will be ignored - /// - /// @return - /// @li \b true if this object is equal to \a rhs. - /// @li \b false if this object is not equal to \a rhs. - //------------------------------------------------------------------ - static bool Equals(const ConstString &lhs, const ConstString &rhs, - const bool case_sensitive = true); - - //------------------------------------------------------------------ - /// Compare two string objects. - /// - /// Compares the C string values contained in \a lhs and \a rhs and - /// returns an integer result. - /// - /// NOTE: only call this function when you want a true string - /// comparison. If you want string equality use the, use the == - /// operator as it is much more efficient. Also if you want string - /// inequality, use the != operator for the same reasons. - /// - /// @param[in] lhs - /// The Left Hand Side const ConstString object reference. - /// - /// @param[in] rhs - /// The Right Hand Side const ConstString object reference. - /// - /// @param[in] case_sensitive - /// Case sensitivity of compare. If true, case sensitive compare - /// will be performed, otherwise character case will be ignored - /// - /// @return - /// @li -1 if lhs < rhs - /// @li 0 if lhs == rhs - /// @li 1 if lhs > rhs - //------------------------------------------------------------------ - static int Compare(const ConstString &lhs, const ConstString &rhs, - const bool case_sensitive = true); - - //------------------------------------------------------------------ - /// Dump the object description to a stream. - /// - /// Dump the string value to the stream \a s. If the contained string - /// is empty, print \a value_if_empty to the stream instead. If - /// \a value_if_empty is nullptr, then nothing will be dumped to the - /// stream. - /// - /// @param[in] s - /// The stream that will be used to dump the object description. - /// - /// @param[in] value_if_empty - /// The value to dump if the string is empty. If nullptr, nothing - /// will be output to the stream. - //------------------------------------------------------------------ - void Dump(Stream *s, const char *value_if_empty = nullptr) const; - - //------------------------------------------------------------------ - /// Dump the object debug description to a stream. - /// - /// @param[in] s - /// The stream that will be used to dump the object description. - //------------------------------------------------------------------ - void DumpDebug(Stream *s) const; - - //------------------------------------------------------------------ - /// Test for empty string. - /// - /// @return - /// @li \b true if the contained string is empty. - /// @li \b false if the contained string is not empty. - //------------------------------------------------------------------ - bool IsEmpty() const { return m_string == nullptr || m_string[0] == '\0'; } - - //------------------------------------------------------------------ - /// Set the C string value. - /// - /// Set the string value in the object by uniquing the \a cstr - /// string value in our global string pool. - /// - /// If the C string already exists in the global string pool, it - /// finds the current entry and returns the existing value. If it - /// doesn't exist, it is added to the string pool. - /// - /// @param[in] cstr - /// A NULL terminated C string to add to the string pool. - //------------------------------------------------------------------ - void SetCString(const char *cstr); - - void SetString(const llvm::StringRef &s); - - //------------------------------------------------------------------ - /// Set the C string value and its mangled counterpart. - /// - /// Object files and debug symbols often use mangled string to - /// represent the linkage name for a symbol, function or global. - /// The string pool can efficiently store these values and their - /// counterparts so when we run into another instance of a mangled - /// name, we can avoid calling the name demangler over and over on - /// the same strings and then trying to unique them. - /// - /// @param[in] demangled - /// The demangled C string to correlate with the \a mangled - /// name. - /// - /// @param[in] mangled - /// The already uniqued mangled ConstString to correlate the - /// soon to be uniqued version of \a demangled. - //------------------------------------------------------------------ - void SetCStringWithMangledCounterpart(const char *demangled, - const ConstString &mangled); - - //------------------------------------------------------------------ - /// Retrieve the mangled or demangled counterpart for a mangled - /// or demangled ConstString. - /// - /// Object files and debug symbols often use mangled string to - /// represent the linkage name for a symbol, function or global. - /// The string pool can efficiently store these values and their - /// counterparts so when we run into another instance of a mangled - /// name, we can avoid calling the name demangler over and over on - /// the same strings and then trying to unique them. - /// - /// @param[in] counterpart - /// A reference to a ConstString object that might get filled in - /// with the demangled/mangled counterpart. - /// - /// @return - /// /b True if \a counterpart was filled in with the counterpart - /// /b false otherwise. - //------------------------------------------------------------------ - bool GetMangledCounterpart(ConstString &counterpart) const; - - //------------------------------------------------------------------ - /// Set the C string value with length. - /// - /// Set the string value in the object by uniquing \a cstr_len bytes - /// starting at the \a cstr string value in our global string pool. - /// If trim is true, then \a cstr_len indicates a maximum length of - /// the CString and if the actual length of the string is less, then - /// it will be trimmed. - /// - /// If the C string already exists in the global string pool, it - /// finds the current entry and returns the existing value. If it - /// doesn't exist, it is added to the string pool. - /// - /// @param[in] cstr - /// A NULL terminated C string to add to the string pool. - /// - /// @param[in] cstr_len - /// The maximum length of the C string. - //------------------------------------------------------------------ - void SetCStringWithLength(const char *cstr, size_t cstr_len); - - //------------------------------------------------------------------ - /// Set the C string value with the minimum length between - /// \a fixed_cstr_len and the actual length of the C string. This - /// can be used for data structures that have a fixed length to - /// store a C string where the string might not be NULL terminated - /// if the string takes the entire buffer. - //------------------------------------------------------------------ - void SetTrimmedCStringWithLength(const char *cstr, size_t fixed_cstr_len); - - //------------------------------------------------------------------ - /// Get the memory cost of this object. - /// - /// Return the size in bytes that this object takes in memory. This - /// returns the size in bytes of this object, which does not include - /// any the shared string values it may refer to. - /// - /// @return - /// The number of bytes that this object occupies in memory. - /// - /// @see ConstString::StaticMemorySize () - //------------------------------------------------------------------ - size_t MemorySize() const { return sizeof(ConstString); } - - //------------------------------------------------------------------ - /// Get the size in bytes of the current global string pool. - /// - /// Reports the size in bytes of all shared C string values, - /// containers and any other values as a byte size for the - /// entire string pool. - /// - /// @return - /// The number of bytes that the global string pool occupies - /// in memory. - //------------------------------------------------------------------ - static size_t StaticMemorySize(); - -protected: - //------------------------------------------------------------------ - // Member variables - //------------------------------------------------------------------ - const char *m_string; -}; - -//------------------------------------------------------------------ -/// Stream the string value \a str to the stream \a s -//------------------------------------------------------------------ -Stream &operator<<(Stream &s, const ConstString &str); - -} // namespace lldb_private - -#endif // liblldb_ConstString_h_ Index: lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h =================================================================== --- lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h +++ lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h @@ -11,7 +11,7 @@ #define liblldb_DataBufferMemoryMap_h_ #include "lldb/Core/DataBuffer.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" #include Index: lldb/trunk/include/lldb/Core/Error.h =================================================================== --- lldb/trunk/include/lldb/Core/Error.h +++ lldb/trunk/include/lldb/Core/Error.h @@ -1,315 +0,0 @@ -//===-- Error.h -------------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef __DCError_h__ -#define __DCError_h__ -#if defined(__cplusplus) - -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/FormatVariadic.h" - -#include -#include -#include - -#include "lldb/lldb-private.h" - -#include "llvm/Support/FormatVariadic.h" - -namespace lldb_private { - -class Log; - -//---------------------------------------------------------------------- -/// @class Error Error.h "lldb/Core/Error.h" -/// @brief An error handling class. -/// -/// This class is designed to be able to hold any error code that can be -/// encountered on a given platform. The errors are stored as a value -/// of type Error::ValueType. This value should be large enough to hold -/// any and all errors that the class supports. Each error has an -/// associated type that is of type lldb::ErrorType. New types -/// can be added to support new error types, and architecture specific -/// types can be enabled. In the future we may wish to switch to a -/// registration mechanism where new error types can be registered at -/// runtime instead of a hard coded scheme. -/// -/// All errors in this class also know how to generate a string -/// representation of themselves for printing results and error codes. -/// The string value will be fetched on demand and its string value will -/// be cached until the error is cleared of the value of the error -/// changes. -//---------------------------------------------------------------------- -class Error { -public: - //------------------------------------------------------------------ - /// Every error value that this object can contain needs to be able - /// to fit into ValueType. - //------------------------------------------------------------------ - typedef uint32_t ValueType; - - //------------------------------------------------------------------ - /// Default constructor. - /// - /// Initialize the error object with a generic success value. - /// - /// @param[in] err - /// An error code. - /// - /// @param[in] type - /// The type for \a err. - //------------------------------------------------------------------ - Error(); - - explicit Error(ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric); - - explicit Error(const char *format, ...) __attribute__((format(printf, 2, 3))); - - Error(const Error &rhs); - //------------------------------------------------------------------ - /// Assignment operator. - /// - /// @param[in] err - /// An error code. - /// - /// @return - /// A const reference to this object. - //------------------------------------------------------------------ - const Error &operator=(const Error &rhs); - - //------------------------------------------------------------------ - /// Assignment operator from a kern_return_t. - /// - /// Sets the type to \c MachKernel and the error code to \a err. - /// - /// @param[in] err - /// A mach error code. - /// - /// @return - /// A const reference to this object. - //------------------------------------------------------------------ - const Error &operator=(uint32_t err); - - ~Error(); - - //------------------------------------------------------------------ - /// Get the error string associated with the current error. - // - /// Gets the error value as a NULL terminated C string. The error - /// string will be fetched and cached on demand. The error string - /// will be retrieved from a callback that is appropriate for the - /// type of the error and will be cached until the error value is - /// changed or cleared. - /// - /// @return - /// The error as a NULL terminated C string value if the error - /// is valid and is able to be converted to a string value, - /// NULL otherwise. - //------------------------------------------------------------------ - const char *AsCString(const char *default_error_str = "unknown error") const; - - //------------------------------------------------------------------ - /// Clear the object state. - /// - /// Reverts the state of this object to contain a generic success - /// value and frees any cached error string value. - //------------------------------------------------------------------ - void Clear(); - - //------------------------------------------------------------------ - /// Test for error condition. - /// - /// @return - /// \b true if this object contains an error, \b false - /// otherwise. - //------------------------------------------------------------------ - bool Fail() const; - - //------------------------------------------------------------------ - /// Access the error value. - /// - /// @return - /// The error value. - //------------------------------------------------------------------ - ValueType GetError() const; - - //------------------------------------------------------------------ - /// Access the error type. - /// - /// @return - /// The error type enumeration value. - //------------------------------------------------------------------ - lldb::ErrorType GetType() const; - - //------------------------------------------------------------------ - /// Log an error to Log(). - /// - /// Log the error given a formatted string \a format. If the this - /// object contains an error code, update the error string to - /// contain the prefix "error: ", followed by the formatted string, - /// followed by the error value and any string that describes the - /// error value. This allows more context to be given to an error - /// string that remains cached in this object. Logging always occurs - /// even when the error code contains a non-error value. - /// - /// @param[in] format - /// A printf style format string. - /// - /// @param[in] ... - /// Variable arguments that are needed for the printf style - /// format string \a format. - //------------------------------------------------------------------ - void PutToLog(Log *log, const char *format, ...) - __attribute__((format(printf, 3, 4))); - - //------------------------------------------------------------------ - /// Log an error to Log() if the error value is an error. - /// - /// Log the error given a formatted string \a format only if the - /// error value in this object describes an error condition. If the - /// this object contains an error, update the error string to - /// contain the prefix "error: " followed by the formatted string, - /// followed by the error value and any string that describes the - /// error value. This allows more context to be given to an error - /// string that remains cached in this object. - /// - /// @param[in] format - /// A printf style format string. - /// - /// @param[in] ... - /// Variable arguments that are needed for the printf style - /// format string \a format. - //------------------------------------------------------------------ - void LogIfError(Log *log, const char *format, ...) - __attribute__((format(printf, 3, 4))); - - //------------------------------------------------------------------ - /// Set accessor from a kern_return_t. - /// - /// Set accesssor for the error value to \a err and the error type - /// to \c MachKernel. - /// - /// @param[in] err - /// A mach error code. - //------------------------------------------------------------------ - void SetMachError(uint32_t err); - - void SetExpressionError(lldb::ExpressionResults, const char *mssg); - - int SetExpressionErrorWithFormat(lldb::ExpressionResults, const char *format, - ...) __attribute__((format(printf, 3, 4))); - - //------------------------------------------------------------------ - /// Set accesssor with an error value and type. - /// - /// Set accesssor for the error value to \a err and the error type - /// to \a type. - /// - /// @param[in] err - /// A mach error code. - /// - /// @param[in] type - /// The type for \a err. - //------------------------------------------------------------------ - void SetError(ValueType err, lldb::ErrorType type); - - //------------------------------------------------------------------ - /// Set the current error to errno. - /// - /// Update the error value to be \c errno and update the type to - /// be \c Error::POSIX. - //------------------------------------------------------------------ - void SetErrorToErrno(); - - //------------------------------------------------------------------ - /// Set the current error to a generic error. - /// - /// Update the error value to be \c LLDB_GENERIC_ERROR and update the - /// type to be \c Error::Generic. - //------------------------------------------------------------------ - void SetErrorToGenericError(); - - //------------------------------------------------------------------ - /// Set the current error string to \a err_str. - /// - /// Set accessor for the error string value for a generic errors, - /// or to supply additional details above and beyond the standard - /// error strings that the standard type callbacks typically - /// provide. This allows custom strings to be supplied as an - /// error explanation. The error string value will remain until the - /// error value is cleared or a new error value/type is assigned. - /// - /// @param err_str - /// The new custom error string to copy and cache. - //------------------------------------------------------------------ - void SetErrorString(llvm::StringRef err_str); - - //------------------------------------------------------------------ - /// Set the current error string to a formatted error string. - /// - /// @param format - /// A printf style format string - //------------------------------------------------------------------ - int SetErrorStringWithFormat(const char *format, ...) - __attribute__((format(printf, 2, 3))); - - int SetErrorStringWithVarArg(const char *format, va_list args); - - template - void SetErrorStringWithFormatv(const char *format, Args &&... args) { - SetErrorString(llvm::formatv(format, std::forward(args)...).str()); - } - - //------------------------------------------------------------------ - /// Test for success condition. - /// - /// Returns true if the error code in this object is considered a - /// successful return value. - /// - /// @return - /// \b true if this object contains an value that describes - /// success (non-erro), \b false otherwise. - //------------------------------------------------------------------ - bool Success() const; - - //------------------------------------------------------------------ - /// Test for a failure due to a generic interrupt. - /// - /// Returns true if the error code in this object was caused by an interrupt. - /// At present only supports Posix EINTR. - /// - /// @return - /// \b true if this object contains an value that describes - /// failure due to interrupt, \b false otherwise. - //------------------------------------------------------------------ - bool WasInterrupted() const; - -protected: - //------------------------------------------------------------------ - /// Member variables - //------------------------------------------------------------------ - ValueType m_code; ///< Error code as an integer value. - lldb::ErrorType m_type; ///< The type of the above error code. - mutable std::string m_string; ///< A string representation of the error code. -}; - -} // namespace lldb_private - -namespace llvm { -template <> struct format_provider { - static void format(const lldb_private::Error &error, llvm::raw_ostream &OS, - llvm::StringRef Options) { - llvm::format_provider::format(error.AsCString(), OS, - Options); - } -}; -} - -#endif // #if defined(__cplusplus) -#endif // #ifndef __DCError_h__ Index: lldb/trunk/include/lldb/Core/Event.h =================================================================== --- lldb/trunk/include/lldb/Core/Event.h +++ lldb/trunk/include/lldb/Core/Event.h @@ -19,9 +19,9 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Broadcaster.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/StructuredData.h" #include "lldb/Host/Predicate.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/FormatEntity.h =================================================================== --- lldb/trunk/include/lldb/Core/FormatEntity.h +++ lldb/trunk/include/lldb/Core/FormatEntity.h @@ -17,7 +17,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" namespace llvm { Index: lldb/trunk/include/lldb/Core/IOHandler.h =================================================================== --- lldb/trunk/include/lldb/Core/IOHandler.h +++ lldb/trunk/include/lldb/Core/IOHandler.h @@ -21,13 +21,13 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Flags.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Core/ValueObjectList.h" #include "lldb/Host/Predicate.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-enumerations.h" #include "lldb/lldb-public.h" Index: lldb/trunk/include/lldb/Core/Log.h =================================================================== --- lldb/trunk/include/lldb/Core/Log.h +++ lldb/trunk/include/lldb/Core/Log.h @@ -11,10 +11,10 @@ #define liblldb_Log_h_ // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" #include "lldb/Core/Logging.h" #include "lldb/Core/PluginInterface.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" // Other libraries and framework includes Index: lldb/trunk/include/lldb/Core/Mangled.h =================================================================== --- lldb/trunk/include/lldb/Core/Mangled.h +++ lldb/trunk/include/lldb/Core/Mangled.h @@ -11,7 +11,7 @@ #define liblldb_Mangled_h_ #if defined(__cplusplus) -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" #include Index: lldb/trunk/include/lldb/Core/MappedHash.h =================================================================== --- lldb/trunk/include/lldb/Core/MappedHash.h +++ lldb/trunk/include/lldb/Core/MappedHash.h @@ -23,7 +23,7 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" class MappedHash { public: Index: lldb/trunk/include/lldb/Core/ModuleSpec.h =================================================================== --- lldb/trunk/include/lldb/Core/ModuleSpec.h +++ lldb/trunk/include/lldb/Core/ModuleSpec.h @@ -12,10 +12,10 @@ // Project includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" #include "lldb/Target/PathMappingList.h" +#include "lldb/Utility/Stream.h" // Other libraries and framework includes #include "llvm/Support/Chrono.h" Index: lldb/trunk/include/lldb/Core/RegularExpression.h =================================================================== --- lldb/trunk/include/lldb/Core/RegularExpression.h +++ lldb/trunk/include/lldb/Core/RegularExpression.h @@ -1,216 +0,0 @@ -//===-- RegularExpression.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_RegularExpression_h_ -#define liblldb_RegularExpression_h_ - -#ifdef _WIN32 -#include "../lib/Support/regex_impl.h" - -typedef llvm_regmatch_t regmatch_t; -typedef llvm_regex_t regex_t; - -inline int regcomp(llvm_regex_t *a, const char *b, int c) { - return llvm_regcomp(a, b, c); -} - -inline size_t regerror(int a, const llvm_regex_t *b, char *c, size_t d) { - return llvm_regerror(a, b, c, d); -} - -inline int regexec(const llvm_regex_t *a, const char *b, size_t c, - llvm_regmatch_t d[], int e) { - return llvm_regexec(a, b, c, d, e); -} - -inline void regfree(llvm_regex_t *a) { llvm_regfree(a); } -#else -#ifdef __ANDROID__ -#include -#endif -#include -#endif -#include - -#include -#include - -namespace llvm { -class StringRef; -} // namespace llvm - -namespace lldb_private { - -//---------------------------------------------------------------------- -/// @class RegularExpression RegularExpression.h "lldb/Core/RegularExpression.h" -/// @brief A C++ wrapper class for regex. -/// -/// This regular expression class wraps the posix regex functions -/// \c regcomp(), \c regerror(), \c regexec(), and \c regfree() from -/// the header file in \c /usr/include/regex\.h. -//---------------------------------------------------------------------- -class RegularExpression { -public: - class Match { - public: - Match(uint32_t max_matches) : m_matches() { - if (max_matches > 0) - m_matches.resize(max_matches + 1); - } - - void Clear() { - const size_t num_matches = m_matches.size(); - regmatch_t invalid_match = {-1, -1}; - for (size_t i = 0; i < num_matches; ++i) - m_matches[i] = invalid_match; - } - - size_t GetSize() const { return m_matches.size(); } - - regmatch_t *GetData() { - return (m_matches.empty() ? nullptr : m_matches.data()); - } - - bool GetMatchAtIndex(llvm::StringRef s, uint32_t idx, - std::string &match_str) const; - - bool GetMatchAtIndex(llvm::StringRef s, uint32_t idx, - llvm::StringRef &match_str) const; - - bool GetMatchSpanningIndices(llvm::StringRef s, uint32_t idx1, - uint32_t idx2, - llvm::StringRef &match_str) const; - - protected: - std::vector - m_matches; ///< Where parenthesized subexpressions results are stored - }; - - //------------------------------------------------------------------ - /// Default constructor. - /// - /// The default constructor that initializes the object state such - /// that it contains no compiled regular expression. - //------------------------------------------------------------------ - RegularExpression(); - - explicit RegularExpression(llvm::StringRef string); - - //------------------------------------------------------------------ - /// Destructor. - /// - /// Any previously compiled regular expression contained in this - /// object will be freed. - //------------------------------------------------------------------ - ~RegularExpression(); - - RegularExpression(const RegularExpression &rhs); - - const RegularExpression &operator=(const RegularExpression &rhs); - - //------------------------------------------------------------------ - /// Compile a regular expression. - /// - /// Compile a regular expression using the supplied regular - /// expression text. The compiled regular expression lives - /// in this object so that it can be readily used for regular - /// expression matches. Execute() can be called after the regular - /// expression is compiled. Any previously compiled regular - /// expression contained in this object will be freed. - /// - /// @param[in] re - /// A NULL terminated C string that represents the regular - /// expression to compile. - /// - /// @return - /// \b true if the regular expression compiles successfully, - /// \b false otherwise. - //------------------------------------------------------------------ - bool Compile(llvm::StringRef string); - bool Compile(const char *) = delete; - - //------------------------------------------------------------------ - /// Executes a regular expression. - /// - /// Execute a regular expression match using the compiled regular - /// expression that is already in this object against the match - /// string \a s. If any parens are used for regular expression - /// matches \a match_count should indicate the number of regmatch_t - /// values that are present in \a match_ptr. - /// - /// @param[in] string - /// The string to match against the compile regular expression. - /// - /// @param[in] match - /// A pointer to a RegularExpression::Match structure that was - /// properly initialized with the desired number of maximum - /// matches, or nullptr if no parenthesized matching is needed. - /// - /// @return - /// \b true if \a string matches the compiled regular - /// expression, \b false otherwise. - //------------------------------------------------------------------ - bool Execute(llvm::StringRef string, Match *match = nullptr) const; - bool Execute(const char *, Match * = nullptr) = delete; - - size_t GetErrorAsCString(char *err_str, size_t err_str_max_len) const; - - //------------------------------------------------------------------ - /// Free the compiled regular expression. - /// - /// If this object contains a valid compiled regular expression, - /// this function will free any resources it was consuming. - //------------------------------------------------------------------ - void Free(); - - //------------------------------------------------------------------ - /// Access the regular expression text. - /// - /// Returns the text that was used to compile the current regular - /// expression. - /// - /// @return - /// The NULL terminated C string that was used to compile the - /// current regular expression - //------------------------------------------------------------------ - llvm::StringRef GetText() const; - - //------------------------------------------------------------------ - /// Test if valid. - /// - /// Test if this object contains a valid regular expression. - /// - /// @return - /// \b true if the regular expression compiled and is ready - /// for execution, \b false otherwise. - //------------------------------------------------------------------ - bool IsValid() const; - - void Clear() { - Free(); - m_re.clear(); - m_comp_err = 1; - } - - int GetErrorCode() const { return m_comp_err; } - - bool operator<(const RegularExpression &rhs) const; - -private: - //------------------------------------------------------------------ - // Member variables - //------------------------------------------------------------------ - std::string m_re; ///< A copy of the original regular expression text - int m_comp_err; ///< Error code for the regular expression compilation - regex_t m_preg; ///< The compiled regular expression -}; - -} // namespace lldb_private - -#endif // liblldb_RegularExpression_h_ Index: lldb/trunk/include/lldb/Core/Section.h =================================================================== --- lldb/trunk/include/lldb/Core/Section.h +++ lldb/trunk/include/lldb/Core/Section.h @@ -11,13 +11,13 @@ #define liblldb_Section_h_ #include "lldb/Core/AddressRange.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" #include "lldb/Core/ModuleChild.h" #include "lldb/Core/RangeMap.h" #include "lldb/Core/UserID.h" #include "lldb/Core/VMRange.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" #include Index: lldb/trunk/include/lldb/Core/Stream.h =================================================================== --- lldb/trunk/include/lldb/Core/Stream.h +++ lldb/trunk/include/lldb/Core/Stream.h @@ -1,548 +0,0 @@ -//===-- Stream.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_Stream_h_ -#define liblldb_Stream_h_ - -// C Includes -#include - -// C++ Includes -// Other libraries and framework includes -// Project includes -#include "lldb/Core/Flags.h" -#include "lldb/lldb-private.h" - -#include "llvm/Support/FormatVariadic.h" - -namespace lldb_private { - -//---------------------------------------------------------------------- -/// @class Stream Stream.h "lldb/Core/Stream.h" -/// @brief A stream class that can stream formatted output to a file. -//---------------------------------------------------------------------- -class Stream { -public: - //------------------------------------------------------------------ - /// \a m_flags bit values. - //------------------------------------------------------------------ - enum { - eBinary = (1 << 0) ///< Get and put data as binary instead of as the default - ///string mode. - }; - - //------------------------------------------------------------------ - /// Construct with flags and address size and byte order. - /// - /// Construct with dump flags \a flags and the default address - /// size. \a flags can be any of the above enumeration logical OR'ed - /// together. - //------------------------------------------------------------------ - Stream(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); - - //------------------------------------------------------------------ - /// Construct a default Stream, not binary, host byte order and - /// host addr size. - /// - //------------------------------------------------------------------ - Stream(); - - //------------------------------------------------------------------ - /// Destructor - //------------------------------------------------------------------ - virtual ~Stream(); - - //------------------------------------------------------------------ - // Subclasses must override these methods - //------------------------------------------------------------------ - - //------------------------------------------------------------------ - /// Flush the stream. - /// - /// Subclasses should flush the stream to make any output appear - /// if the stream has any buffering. - //------------------------------------------------------------------ - virtual void Flush() = 0; - - //------------------------------------------------------------------ - /// Output character bytes to the stream. - /// - /// Appends \a src_len characters from the buffer \a src to the - /// stream. - /// - /// @param[in] src - /// A buffer containing at least \a src_len bytes of data. - /// - /// @param[in] src_len - /// A number of bytes to append to the stream. - /// - /// @return - /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ - virtual size_t Write(const void *src, size_t src_len) = 0; - - //------------------------------------------------------------------ - // Member functions - //------------------------------------------------------------------ - size_t PutChar(char ch); - - //------------------------------------------------------------------ - /// Set the byte_order value. - /// - /// Sets the byte order of the data to extract. Extracted values - /// will be swapped if necessary when decoding. - /// - /// @param[in] byte_order - /// The byte order value to use when extracting data. - /// - /// @return - /// The old byte order value. - //------------------------------------------------------------------ - lldb::ByteOrder SetByteOrder(lldb::ByteOrder byte_order); - - //------------------------------------------------------------------ - /// Format a C string from a printf style format and variable - /// arguments and encode and append the resulting C string as hex - /// bytes. - /// - /// @param[in] format - /// A printf style format string. - /// - /// @param[in] ... - /// Any additional arguments needed for the printf format string. - /// - /// @return - /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ - size_t PrintfAsRawHex8(const char *format, ...) - __attribute__((__format__(__printf__, 2, 3))); - - //------------------------------------------------------------------ - /// Format a C string from a printf style format and variable - /// arguments and encode and append the resulting C string as hex - /// bytes. - /// - /// @param[in] format - /// A printf style format string. - /// - /// @param[in] ... - /// Any additional arguments needed for the printf format string. - /// - /// @return - /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ - size_t PutHex8(uint8_t uvalue); - - size_t PutNHex8(size_t n, uint8_t uvalue); - - size_t PutHex16(uint16_t uvalue, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - - size_t PutHex32(uint32_t uvalue, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - - size_t PutHex64(uint64_t uvalue, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - - size_t PutMaxHex64(uint64_t uvalue, size_t byte_size, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - size_t PutFloat(float f, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - - size_t PutDouble(double d, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - - size_t PutLongDouble(long double ld, - lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); - - size_t PutPointer(void *ptr); - - // Append \a src_len bytes from \a src to the stream as hex characters - // (two ascii characters per byte of input data) - size_t - PutBytesAsRawHex8(const void *src, size_t src_len, - lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid, - lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid); - - // Append \a src_len bytes from \a s to the stream as binary data. - size_t PutRawBytes(const void *s, size_t src_len, - lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid, - lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid); - - size_t PutCStringAsRawHex8(const char *s); - - //------------------------------------------------------------------ - /// Output a NULL terminated C string \a cstr to the stream \a s. - /// - /// @param[in] cstr - /// A NULL terminated C string. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(const char *cstr); - - Stream &operator<<(llvm::StringRef str); - - //------------------------------------------------------------------ - /// Output a pointer value \a p to the stream \a s. - /// - /// @param[in] p - /// A void pointer. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(const void *p); - - //------------------------------------------------------------------ - /// Output a character \a ch to the stream \a s. - /// - /// @param[in] ch - /// A printable character value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(char ch); - - //------------------------------------------------------------------ - /// Output a uint8_t \a uval to the stream \a s. - /// - /// @param[in] uval - /// A uint8_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(uint8_t uval); - - //------------------------------------------------------------------ - /// Output a uint16_t \a uval to the stream \a s. - /// - /// @param[in] uval - /// A uint16_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(uint16_t uval); - - //------------------------------------------------------------------ - /// Output a uint32_t \a uval to the stream \a s. - /// - /// @param[in] uval - /// A uint32_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(uint32_t uval); - - //------------------------------------------------------------------ - /// Output a uint64_t \a uval to the stream \a s. - /// - /// @param[in] uval - /// A uint64_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(uint64_t uval); - - //------------------------------------------------------------------ - /// Output a int8_t \a sval to the stream \a s. - /// - /// @param[in] sval - /// A int8_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(int8_t sval); - - //------------------------------------------------------------------ - /// Output a int16_t \a sval to the stream \a s. - /// - /// @param[in] sval - /// A int16_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(int16_t sval); - - //------------------------------------------------------------------ - /// Output a int32_t \a sval to the stream \a s. - /// - /// @param[in] sval - /// A int32_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(int32_t sval); - - //------------------------------------------------------------------ - /// Output a int64_t \a sval to the stream \a s. - /// - /// @param[in] sval - /// A int64_t value. - /// - /// @return - /// A reference to this class so multiple things can be streamed - /// in one statement. - //------------------------------------------------------------------ - Stream &operator<<(int64_t sval); - - //------------------------------------------------------------------ - /// Output an address value to this stream. - /// - /// Put an address \a addr out to the stream with optional \a prefix - /// and \a suffix strings. - /// - /// @param[in] addr - /// An address value. - /// - /// @param[in] addr_size - /// Size in bytes of the address, used for formatting. - /// - /// @param[in] prefix - /// A prefix C string. If nullptr, no prefix will be output. - /// - /// @param[in] suffix - /// A suffix C string. If nullptr, no suffix will be output. - //------------------------------------------------------------------ - void Address(uint64_t addr, uint32_t addr_size, const char *prefix = nullptr, - const char *suffix = nullptr); - - //------------------------------------------------------------------ - /// Output an address range to this stream. - /// - /// Put an address range \a lo_addr - \a hi_addr out to the stream - /// with optional \a prefix and \a suffix strings. - /// - /// @param[in] lo_addr - /// The start address of the address range. - /// - /// @param[in] hi_addr - /// The end address of the address range. - /// - /// @param[in] addr_size - /// Size in bytes of the address, used for formatting. - /// - /// @param[in] prefix - /// A prefix C string. If nullptr, no prefix will be output. - /// - /// @param[in] suffix - /// A suffix C string. If nullptr, no suffix will be output. - //------------------------------------------------------------------ - void AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, - const char *prefix = nullptr, const char *suffix = nullptr); - - //------------------------------------------------------------------ - /// Output a C string to the stream. - /// - /// Print a C string \a cstr to the stream. - /// - /// @param[in] cstr - /// The string to be output to the stream. - //------------------------------------------------------------------ - size_t PutCString(llvm::StringRef cstr); - - //------------------------------------------------------------------ - /// Output and End of Line character to the stream. - //------------------------------------------------------------------ - size_t EOL(); - - //------------------------------------------------------------------ - /// Get the address size in bytes. - /// - /// @return - /// The size of an address in bytes that is used when outputting - /// address and pointer values to the stream. - //------------------------------------------------------------------ - uint32_t GetAddressByteSize() const; - - //------------------------------------------------------------------ - /// The flags accessor. - /// - /// @return - /// A reference to the Flags member variable. - //------------------------------------------------------------------ - Flags &GetFlags(); - - //------------------------------------------------------------------ - /// The flags const accessor. - /// - /// @return - /// A const reference to the Flags member variable. - //------------------------------------------------------------------ - const Flags &GetFlags() const; - - //------------------------------------------------------------------ - //// The byte order accessor. - //// - //// @return - //// The byte order. - //------------------------------------------------------------------ - lldb::ByteOrder GetByteOrder() const; - - //------------------------------------------------------------------ - /// Get the current indentation level. - /// - /// @return - /// The current indentation level as an integer. - //------------------------------------------------------------------ - int GetIndentLevel() const; - - //------------------------------------------------------------------ - /// Indent the current line in the stream. - /// - /// Indent the current line using the current indentation level and - /// print an optional string following the indentation spaces. - /// - /// @param[in] s - /// A C string to print following the indentation. If nullptr, just - /// output the indentation characters. - //------------------------------------------------------------------ - size_t Indent(const char *s = nullptr); - size_t Indent(llvm::StringRef s); - - //------------------------------------------------------------------ - /// Decrement the current indentation level. - //------------------------------------------------------------------ - void IndentLess(int amount = 2); - - //------------------------------------------------------------------ - /// Increment the current indentation level. - //------------------------------------------------------------------ - void IndentMore(int amount = 2); - - //------------------------------------------------------------------ - /// Output an offset value. - /// - /// Put an offset \a uval out to the stream using the printf format - /// in \a format. - /// - /// @param[in] offset - /// The offset value. - /// - /// @param[in] format - /// The printf style format to use when outputting the offset. - //------------------------------------------------------------------ - void Offset(uint32_t offset, const char *format = "0x%8.8x: "); - - //------------------------------------------------------------------ - /// Output printf formatted output to the stream. - /// - /// Print some formatted output to the stream. - /// - /// @param[in] format - /// A printf style format string. - /// - /// @param[in] ... - /// Variable arguments that are needed for the printf style - /// format string \a format. - //------------------------------------------------------------------ - size_t Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); - - size_t PrintfVarArg(const char *format, va_list args); - - template void Format(const char *format, Args &&... args) { - PutCString(llvm::formatv(format, std::forward(args)...).str()); - } - - //------------------------------------------------------------------ - /// Output a quoted C string value to the stream. - /// - /// Print a double quoted NULL terminated C string to the stream - /// using the printf format in \a format. - /// - /// @param[in] cstr - /// A NULL terminated C string value. - /// - /// @param[in] format - /// The optional C string format that can be overridden. - //------------------------------------------------------------------ - void QuotedCString(const char *cstr, const char *format = "\"%s\""); - - //------------------------------------------------------------------ - /// Set the address size in bytes. - /// - /// @param[in] addr_size - /// The new size in bytes of an address to use when outputting - /// address and pointer values. - //------------------------------------------------------------------ - void SetAddressByteSize(uint32_t addr_size); - - //------------------------------------------------------------------ - /// Set the current indentation level. - /// - /// @param[in] level - /// The new indentation level. - //------------------------------------------------------------------ - void SetIndentLevel(int level); - - //------------------------------------------------------------------ - /// Output a SLEB128 number to the stream. - /// - /// Put an SLEB128 \a uval out to the stream using the printf format - /// in \a format. - /// - /// @param[in] uval - /// A uint64_t value that was extracted as a SLEB128 value. - /// - /// @param[in] format - /// The optional printf format that can be overridden. - //------------------------------------------------------------------ - size_t PutSLEB128(int64_t uval); - - //------------------------------------------------------------------ - /// Output a ULEB128 number to the stream. - /// - /// Put an ULEB128 \a uval out to the stream using the printf format - /// in \a format. - /// - /// @param[in] uval - /// A uint64_t value that was extracted as a ULEB128 value. - /// - /// @param[in] format - /// The optional printf format that can be overridden. - //------------------------------------------------------------------ - size_t PutULEB128(uint64_t uval); - - static void UnitTest(Stream *s); - -protected: - //------------------------------------------------------------------ - // Member variables - //------------------------------------------------------------------ - Flags m_flags; ///< Dump flags. - uint32_t m_addr_size; ///< Size of an address in bytes. - lldb::ByteOrder - m_byte_order; ///< Byte order to use when encoding scalar types. - int m_indent_level; ///< Indention level. - - size_t _PutHex8(uint8_t uvalue, bool add_prefix); -}; - -} // namespace lldb_private - -#endif // liblldb_Stream_h_ Index: lldb/trunk/include/lldb/Core/StreamAsynchronousIO.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamAsynchronousIO.h +++ lldb/trunk/include/lldb/Core/StreamAsynchronousIO.h @@ -13,7 +13,7 @@ #include -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/StreamBuffer.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamBuffer.h +++ lldb/trunk/include/lldb/Core/StreamBuffer.h @@ -10,7 +10,7 @@ #ifndef liblldb_StreamBuffer_h_ #define liblldb_StreamBuffer_h_ -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/SmallVector.h" #include #include Index: lldb/trunk/include/lldb/Core/StreamCallback.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamCallback.h +++ lldb/trunk/include/lldb/Core/StreamCallback.h @@ -13,8 +13,8 @@ #include #include -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/StreamFile.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamFile.h +++ lldb/trunk/include/lldb/Core/StreamFile.h @@ -18,8 +18,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/File.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/StreamGDBRemote.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamGDBRemote.h +++ lldb/trunk/include/lldb/Core/StreamGDBRemote.h @@ -17,7 +17,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/StreamString.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamString.h +++ lldb/trunk/include/lldb/Core/StreamString.h @@ -1,51 +0,0 @@ -//===-- StreamString.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_StreamString_h_ -#define liblldb_StreamString_h_ - -#include - -#include "lldb/Core/Stream.h" - -namespace lldb_private { - -class StreamString : public Stream { -public: - StreamString(); - - StreamString(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); - - ~StreamString() override; - - void Flush() override; - - size_t Write(const void *s, size_t length) override; - - void Clear(); - - bool Empty() const; - - size_t GetSize() const; - - size_t GetSizeOfLastLine() const; - - llvm::StringRef GetString() const; - - const char *GetData() const { return m_packet.c_str(); } - - void FillLastLineToColumn(uint32_t column, char fill_char); - -protected: - std::string m_packet; -}; - -} // namespace lldb_private - -#endif // liblldb_StreamString_h_ Index: lldb/trunk/include/lldb/Core/StreamTee.h =================================================================== --- lldb/trunk/include/lldb/Core/StreamTee.h +++ lldb/trunk/include/lldb/Core/StreamTee.h @@ -1,141 +0,0 @@ -//===-- StreamTee.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_StreamTee_h_ -#define liblldb_StreamTee_h_ - -#include - -#include - -#include "lldb/Core/Stream.h" - -namespace lldb_private { - -class StreamTee : public Stream { -public: - StreamTee() : Stream(), m_streams_mutex(), m_streams() {} - - StreamTee(lldb::StreamSP &stream_sp) - : Stream(), m_streams_mutex(), m_streams() { - // No need to lock mutex during construction - if (stream_sp) - m_streams.push_back(stream_sp); - } - - StreamTee(lldb::StreamSP &stream_sp, lldb::StreamSP &stream_2_sp) - : Stream(), m_streams_mutex(), m_streams() { - // No need to lock mutex during construction - if (stream_sp) - m_streams.push_back(stream_sp); - if (stream_2_sp) - m_streams.push_back(stream_2_sp); - } - - StreamTee(const StreamTee &rhs) - : Stream(rhs), m_streams_mutex(), m_streams() { - // Don't copy until we lock down "rhs" - std::lock_guard guard(rhs.m_streams_mutex); - m_streams = rhs.m_streams; - } - - ~StreamTee() override {} - - StreamTee &operator=(const StreamTee &rhs) { - if (this != &rhs) { - Stream::operator=(rhs); - std::lock_guard lhs_locker(m_streams_mutex); - std::lock_guard rhs_locker(rhs.m_streams_mutex); - m_streams = rhs.m_streams; - } - return *this; - } - - void Flush() override { - std::lock_guard guard(m_streams_mutex); - collection::iterator pos, end; - for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos) { - // Allow for our collection to contain NULL streams. This allows - // the StreamTee to be used with hard coded indexes for clients - // that might want N total streams with only a few that are set - // to valid values. - Stream *strm = pos->get(); - if (strm) - strm->Flush(); - } - } - - size_t Write(const void *s, size_t length) override { - std::lock_guard guard(m_streams_mutex); - if (m_streams.empty()) - return 0; - - size_t min_bytes_written = SIZE_MAX; - collection::iterator pos, end; - for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos) { - // Allow for our collection to contain NULL streams. This allows - // the StreamTee to be used with hard coded indexes for clients - // that might want N total streams with only a few that are set - // to valid values. - Stream *strm = pos->get(); - if (strm) { - const size_t bytes_written = strm->Write(s, length); - if (min_bytes_written > bytes_written) - min_bytes_written = bytes_written; - } - } - if (min_bytes_written == SIZE_MAX) - return 0; - return min_bytes_written; - } - - size_t AppendStream(const lldb::StreamSP &stream_sp) { - size_t new_idx = m_streams.size(); - std::lock_guard guard(m_streams_mutex); - m_streams.push_back(stream_sp); - return new_idx; - } - - size_t GetNumStreams() const { - size_t result = 0; - { - std::lock_guard guard(m_streams_mutex); - result = m_streams.size(); - } - return result; - } - - lldb::StreamSP GetStreamAtIndex(uint32_t idx) { - lldb::StreamSP stream_sp; - std::lock_guard guard(m_streams_mutex); - if (idx < m_streams.size()) - stream_sp = m_streams[idx]; - return stream_sp; - } - - void SetStreamAtIndex(uint32_t idx, const lldb::StreamSP &stream_sp) { - std::lock_guard guard(m_streams_mutex); - // Resize our stream vector as necessary to fit as many streams - // as needed. This also allows this class to be used with hard - // coded indexes that can be used contain many streams, not all - // of which are valid. - if (idx >= m_streams.size()) - m_streams.resize(idx + 1); - m_streams[idx] = stream_sp; - } - -protected: - typedef std::vector collection; - mutable std::recursive_mutex m_streams_mutex; - collection m_streams; -}; - -} // namespace lldb_private - -#endif // liblldb_StreamTee_h_ Index: lldb/trunk/include/lldb/Core/StructuredData.h =================================================================== --- lldb/trunk/include/lldb/Core/StructuredData.h +++ lldb/trunk/include/lldb/Core/StructuredData.h @@ -23,8 +23,8 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-defines.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/UniqueCStringMap.h =================================================================== --- lldb/trunk/include/lldb/Core/UniqueCStringMap.h +++ lldb/trunk/include/lldb/Core/UniqueCStringMap.h @@ -17,7 +17,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/RegularExpression.h" +#include "lldb/Utility/RegularExpression.h" + +#include "llvm/ADT/StringRef.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/UserSettingsController.h =================================================================== --- lldb/trunk/include/lldb/Core/UserSettingsController.h +++ lldb/trunk/include/lldb/Core/UserSettingsController.h @@ -19,11 +19,11 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StringList.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/Value.h =================================================================== --- lldb/trunk/include/lldb/Core/Value.h +++ lldb/trunk/include/lldb/Core/Value.h @@ -17,9 +17,9 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Scalar.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Core/ValueObject.h =================================================================== --- lldb/trunk/include/lldb/Core/ValueObject.h +++ lldb/trunk/include/lldb/Core/ValueObject.h @@ -22,9 +22,7 @@ #include "llvm/ADT/SmallVector.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Flags.h" #include "lldb/Core/UserID.h" #include "lldb/Core/Value.h" @@ -33,6 +31,8 @@ #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/Process.h" #include "lldb/Target/StackID.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/SharedCluster.h" #include "lldb/lldb-private.h" Index: lldb/trunk/include/lldb/DataFormatters/DataVisualization.h =================================================================== --- lldb/trunk/include/lldb/DataFormatters/DataVisualization.h +++ lldb/trunk/include/lldb/DataFormatters/DataVisualization.h @@ -15,9 +15,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/DataFormatters/FormatClasses.h" #include "lldb/DataFormatters/FormatManager.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/DataFormatters/FormatCache.h =================================================================== --- lldb/trunk/include/lldb/DataFormatters/FormatCache.h +++ lldb/trunk/include/lldb/DataFormatters/FormatCache.h @@ -18,7 +18,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-public.h" namespace lldb_private { Index: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h =================================================================== --- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h +++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h @@ -22,7 +22,6 @@ // Project includes #include "lldb/lldb-public.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormatClasses.h" #include "lldb/DataFormatters/TypeFormat.h" @@ -30,6 +29,7 @@ #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/DataFormatters/TypeValidator.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/StringLexer.h" namespace lldb_private { Index: lldb/trunk/include/lldb/DataFormatters/TypeSummary.h =================================================================== --- lldb/trunk/include/lldb/DataFormatters/TypeSummary.h +++ lldb/trunk/include/lldb/DataFormatters/TypeSummary.h @@ -23,9 +23,9 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-public.h" -#include "lldb/Core/Error.h" #include "lldb/Core/FormatEntity.h" #include "lldb/Core/StructuredData.h" +#include "lldb/Utility/Error.h" namespace lldb_private { class TypeSummaryOptions { Index: lldb/trunk/include/lldb/DataFormatters/VectorIterator.h =================================================================== --- lldb/trunk/include/lldb/DataFormatters/VectorIterator.h +++ lldb/trunk/include/lldb/DataFormatters/VectorIterator.h @@ -13,8 +13,8 @@ #include "lldb/lldb-forward.h" -#include "lldb/Core/ConstString.h" #include "lldb/Target/ExecutionContext.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/include/lldb/Expression/DWARFExpression.h =================================================================== --- lldb/trunk/include/lldb/Expression/DWARFExpression.h +++ lldb/trunk/include/lldb/Expression/DWARFExpression.h @@ -13,8 +13,8 @@ #include "lldb/Core/Address.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Disassembler.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Scalar.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" #include Index: lldb/trunk/include/lldb/Expression/ExpressionParser.h =================================================================== --- lldb/trunk/include/lldb/Expression/ExpressionParser.h +++ lldb/trunk/include/lldb/Expression/ExpressionParser.h @@ -10,7 +10,7 @@ #ifndef liblldb_ExpressionParser_h_ #define liblldb_ExpressionParser_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-public.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Expression/ExpressionVariable.h =================================================================== --- lldb/trunk/include/lldb/Expression/ExpressionVariable.h +++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h @@ -19,8 +19,8 @@ #include "llvm/ADT/DenseMap.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/ValueObject.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-public.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Expression/IRInterpreter.h =================================================================== --- lldb/trunk/include/lldb/Expression/IRInterpreter.h +++ lldb/trunk/include/lldb/Expression/IRInterpreter.h @@ -10,8 +10,8 @@ #ifndef liblldb_IRInterpreter_h_ #define liblldb_IRInterpreter_h_ -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-public.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Pass.h" Index: lldb/trunk/include/lldb/Expression/Materializer.h =================================================================== --- lldb/trunk/include/lldb/Expression/Materializer.h +++ lldb/trunk/include/lldb/Expression/Materializer.h @@ -17,10 +17,10 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Expression/IRMemoryMap.h" #include "lldb/Symbol/TaggedASTType.h" #include "lldb/Target/StackFrame.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-types.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Host/FileCache.h =================================================================== --- lldb/trunk/include/lldb/Host/FileCache.h +++ lldb/trunk/include/lldb/Host/FileCache.h @@ -14,8 +14,8 @@ #include "lldb/lldb-forward.h" #include "lldb/lldb-types.h" -#include "lldb/Core/Error.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/Error.h" namespace lldb_private { class FileCache { Index: lldb/trunk/include/lldb/Host/FileSpec.h =================================================================== --- lldb/trunk/include/lldb/Host/FileSpec.h +++ lldb/trunk/include/lldb/Host/FileSpec.h @@ -17,9 +17,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/STLUtils.h" #include "lldb/Host/PosixApi.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" #include "llvm/Support/FormatVariadic.h" Index: lldb/trunk/include/lldb/Host/FileSystem.h =================================================================== --- lldb/trunk/include/lldb/Host/FileSystem.h +++ lldb/trunk/include/lldb/Host/FileSystem.h @@ -10,8 +10,8 @@ #ifndef liblldb_Host_FileSystem_h #define liblldb_Host_FileSystem_h -#include "lldb/Core/Error.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/Error.h" #include "llvm/Support/Chrono.h" #include "lldb/lldb-types.h" Index: lldb/trunk/include/lldb/Host/HostNativeProcessBase.h =================================================================== --- lldb/trunk/include/lldb/Host/HostNativeProcessBase.h +++ lldb/trunk/include/lldb/Host/HostNativeProcessBase.h @@ -10,8 +10,8 @@ #ifndef lldb_Host_HostNativeProcessBase_h_ #define lldb_Host_HostNativeProcessBase_h_ -#include "lldb/Core/Error.h" #include "lldb/Host/HostProcess.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" Index: lldb/trunk/include/lldb/Host/HostNativeThreadBase.h =================================================================== --- lldb/trunk/include/lldb/Host/HostNativeThreadBase.h +++ lldb/trunk/include/lldb/Host/HostNativeThreadBase.h @@ -10,7 +10,7 @@ #ifndef lldb_Host_HostNativeThreadBase_h_ #define lldb_Host_HostNativeThreadBase_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" Index: lldb/trunk/include/lldb/Host/HostThread.h =================================================================== --- lldb/trunk/include/lldb/Host/HostThread.h +++ lldb/trunk/include/lldb/Host/HostThread.h @@ -10,8 +10,8 @@ #ifndef lldb_Host_HostThread_h_ #define lldb_Host_HostThread_h_ -#include "lldb/Core/Error.h" #include "lldb/Host/HostNativeThreadForward.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-types.h" #include Index: lldb/trunk/include/lldb/Host/LockFileBase.h =================================================================== --- lldb/trunk/include/lldb/Host/LockFileBase.h +++ lldb/trunk/include/lldb/Host/LockFileBase.h @@ -10,7 +10,7 @@ #ifndef liblldb_Host_LockFileBase_h_ #define liblldb_Host_LockFileBase_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include Index: lldb/trunk/include/lldb/Host/MainLoopBase.h =================================================================== --- lldb/trunk/include/lldb/Host/MainLoopBase.h +++ lldb/trunk/include/lldb/Host/MainLoopBase.h @@ -14,8 +14,8 @@ #include "llvm/Support/ErrorHandling.h" -#include "lldb/Core/Error.h" #include "lldb/Host/IOObject.h" +#include "lldb/Utility/Error.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Host/PipeBase.h =================================================================== --- lldb/trunk/include/lldb/Host/PipeBase.h +++ lldb/trunk/include/lldb/Host/PipeBase.h @@ -14,7 +14,7 @@ #include #include -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/include/lldb/Host/Socket.h =================================================================== --- lldb/trunk/include/lldb/Host/Socket.h +++ lldb/trunk/include/lldb/Host/Socket.h @@ -15,10 +15,10 @@ #include "lldb/lldb-private.h" -#include "lldb/Core/Error.h" #include "lldb/Host/IOObject.h" #include "lldb/Host/Predicate.h" #include "lldb/Host/SocketAddress.h" +#include "lldb/Utility/Error.h" #ifdef _WIN32 #include "lldb/Host/windows/windows.h" Index: lldb/trunk/include/lldb/Host/ThreadLauncher.h =================================================================== --- lldb/trunk/include/lldb/Host/ThreadLauncher.h +++ lldb/trunk/include/lldb/Host/ThreadLauncher.h @@ -11,8 +11,8 @@ #ifndef lldb_Host_ThreadLauncher_h_ #define lldb_Host_ThreadLauncher_h_ -#include "lldb/Core/Error.h" #include "lldb/Host/HostThread.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-types.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/include/lldb/Host/XML.h =================================================================== --- lldb/trunk/include/lldb/Host/XML.h +++ lldb/trunk/include/lldb/Host/XML.h @@ -24,8 +24,8 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/StreamString.h" #include "lldb/Core/StructuredData.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h =================================================================== --- lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h +++ lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h @@ -10,7 +10,7 @@ #ifndef liblldb_NativeBreakpointList_h_ #define liblldb_NativeBreakpointList_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" // #include "lldb/Host/NativeBreakpoint.h" Index: lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h =================================================================== --- lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h +++ lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h @@ -13,8 +13,8 @@ #include #include -#include "lldb/Core/Error.h" #include "lldb/Host/MainLoop.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" #include "lldb/lldb-types.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/include/lldb/Host/common/NativeWatchpointList.h =================================================================== --- lldb/trunk/include/lldb/Host/common/NativeWatchpointList.h +++ lldb/trunk/include/lldb/Host/common/NativeWatchpointList.h @@ -10,7 +10,7 @@ #ifndef liblldb_NativeWatchpointList_h_ #define liblldb_NativeWatchpointList_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" #include Index: lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h =================================================================== --- lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h +++ lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h @@ -14,8 +14,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Host/HostNativeProcessBase.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-types.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/Args.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/Args.h +++ lldb/trunk/include/lldb/Interpreter/Args.h @@ -21,8 +21,8 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/Error.h" #include "lldb/Host/OptionParser.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-types.h" #include "lldb/lldb-types.h" Index: lldb/trunk/include/lldb/Interpreter/CommandCompletions.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/CommandCompletions.h +++ lldb/trunk/include/lldb/Interpreter/CommandCompletions.h @@ -17,8 +17,8 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/FileSpecList.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/SearchFilter.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/CommandHistory.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/CommandHistory.h +++ lldb/trunk/include/lldb/Interpreter/CommandHistory.h @@ -18,7 +18,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h +++ lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h @@ -16,8 +16,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/RegularExpression.h" #include "lldb/Interpreter/CommandObject.h" +#include "lldb/Utility/RegularExpression.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h +++ lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h @@ -16,8 +16,8 @@ // Project includes #include "lldb/Core/STLUtils.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" -#include "lldb/Core/StreamTee.h" +#include "lldb/Utility/StreamString.h" +#include "lldb/Utility/StreamTee.h" #include "lldb/lldb-private.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h +++ lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h @@ -14,8 +14,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/OptionValue.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/OptionValue.h +++ lldb/trunk/include/lldb/Interpreter/OptionValue.h @@ -14,9 +14,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/FormatEntity.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-defines.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h +++ lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h @@ -14,12 +14,12 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h +++ lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h @@ -16,11 +16,11 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/FormatEntity.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Interpreter/OptionValue.h" #include "lldb/Interpreter/Property.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h +++ lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h @@ -14,8 +14,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/RegularExpression.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/RegularExpression.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/Property.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/Property.h +++ lldb/trunk/include/lldb/Interpreter/Property.h @@ -16,9 +16,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-defines.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h =================================================================== --- lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h +++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h @@ -18,9 +18,9 @@ #include "lldb/Breakpoint/BreakpointOptions.h" #include "lldb/Core/Broadcaster.h" -#include "lldb/Core/Error.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/StructuredData.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/PseudoTerminal.h" Index: lldb/trunk/include/lldb/Symbol/Block.h =================================================================== --- lldb/trunk/include/lldb/Symbol/Block.h +++ lldb/trunk/include/lldb/Symbol/Block.h @@ -18,11 +18,11 @@ // Project includes #include "lldb/Core/AddressRange.h" #include "lldb/Core/RangeMap.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/UserID.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/LineEntry.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/ClangASTContext.h =================================================================== --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h @@ -31,9 +31,9 @@ // Project includes #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h" #include "lldb/Core/ClangForward.h" -#include "lldb/Core/ConstString.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/TypeSystem.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-enumerations.h" class DWARFASTParserClang; Index: lldb/trunk/include/lldb/Symbol/CompileUnit.h =================================================================== --- lldb/trunk/include/lldb/Symbol/CompileUnit.h +++ lldb/trunk/include/lldb/Symbol/CompileUnit.h @@ -12,10 +12,10 @@ #include "lldb/Core/FileSpecList.h" #include "lldb/Core/ModuleChild.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/UserID.h" #include "lldb/Symbol/DebugMacros.h" #include "lldb/Symbol/Function.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-enumerations.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/CompilerDecl.h =================================================================== --- lldb/trunk/include/lldb/Symbol/CompilerDecl.h +++ lldb/trunk/include/lldb/Symbol/CompilerDecl.h @@ -10,8 +10,8 @@ #ifndef liblldb_CompilerDecl_h_ #define liblldb_CompilerDecl_h_ -#include "lldb/Core/ConstString.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h =================================================================== --- lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h +++ lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h @@ -12,7 +12,7 @@ #include -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/DebugMacros.h =================================================================== --- lldb/trunk/include/lldb/Symbol/DebugMacros.h +++ lldb/trunk/include/lldb/Symbol/DebugMacros.h @@ -17,7 +17,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/GoASTContext.h =================================================================== --- lldb/trunk/include/lldb/Symbol/GoASTContext.h +++ lldb/trunk/include/lldb/Symbol/GoASTContext.h @@ -20,9 +20,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/TypeSystem.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/JavaASTContext.h =================================================================== --- lldb/trunk/include/lldb/Symbol/JavaASTContext.h +++ lldb/trunk/include/lldb/Symbol/JavaASTContext.h @@ -18,8 +18,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Symbol/TypeSystem.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h =================================================================== --- lldb/trunk/include/lldb/Symbol/OCamlASTContext.h +++ lldb/trunk/include/lldb/Symbol/OCamlASTContext.h @@ -21,9 +21,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/TypeSystem.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Symbol/Type.h =================================================================== --- lldb/trunk/include/lldb/Symbol/Type.h +++ lldb/trunk/include/lldb/Symbol/Type.h @@ -11,11 +11,11 @@ #define liblldb_Type_h_ #include "lldb/Core/ClangForward.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/UserID.h" #include "lldb/Symbol/CompilerDecl.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Declaration.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" #include "llvm/ADT/APSInt.h" Index: lldb/trunk/include/lldb/Symbol/UnwindPlan.h =================================================================== --- lldb/trunk/include/lldb/Symbol/UnwindPlan.h +++ lldb/trunk/include/lldb/Symbol/UnwindPlan.h @@ -19,8 +19,8 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/AddressRange.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Target/ABI.h =================================================================== --- lldb/trunk/include/lldb/Target/ABI.h +++ lldb/trunk/include/lldb/Target/ABI.h @@ -14,9 +14,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" #include "llvm/ADT/ArrayRef.h" Index: lldb/trunk/include/lldb/Target/DynamicLoader.h =================================================================== --- lldb/trunk/include/lldb/Target/DynamicLoader.h +++ lldb/trunk/include/lldb/Target/DynamicLoader.h @@ -11,9 +11,9 @@ #define liblldb_DynamicLoader_h_ // Project includes -#include "lldb/Core/Error.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/UUID.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Target/MemoryRegionInfo.h =================================================================== --- lldb/trunk/include/lldb/Target/MemoryRegionInfo.h +++ lldb/trunk/include/lldb/Target/MemoryRegionInfo.h @@ -11,8 +11,8 @@ #ifndef lldb_MemoryRegionInfo_h #define lldb_MemoryRegionInfo_h -#include "lldb/Core/ConstString.h" #include "lldb/Core/RangeMap.h" +#include "lldb/Utility/ConstString.h" #include "lldb/Utility/Range.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Target/PathMappingList.h =================================================================== --- lldb/trunk/include/lldb/Target/PathMappingList.h +++ lldb/trunk/include/lldb/Target/PathMappingList.h @@ -15,8 +15,8 @@ #include #include // Other libraries and framework includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" // Project includes namespace lldb_private { Index: lldb/trunk/include/lldb/Target/Platform.h =================================================================== --- lldb/trunk/include/lldb/Target/Platform.h +++ lldb/trunk/include/lldb/Target/Platform.h @@ -22,11 +22,11 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/UserSettingsController.h" #include "lldb/Host/FileSpec.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private-forward.h" #include "lldb/lldb-public.h" Index: lldb/trunk/include/lldb/Target/Process.h =================================================================== --- lldb/trunk/include/lldb/Target/Process.h +++ lldb/trunk/include/lldb/Target/Process.h @@ -30,7 +30,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Communication.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Event.h" #include "lldb/Core/Listener.h" #include "lldb/Core/LoadedModuleInfoList.h" @@ -48,6 +47,7 @@ #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/QueueList.h" #include "lldb/Target/ThreadList.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" #include "llvm/ADT/ArrayRef.h" Index: lldb/trunk/include/lldb/Target/QueueItem.h =================================================================== --- lldb/trunk/include/lldb/Target/QueueItem.h +++ lldb/trunk/include/lldb/Target/QueueItem.h @@ -23,7 +23,7 @@ #include "lldb/lldb-private.h" #include "lldb/Core/Address.h" -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Target/StackFrame.h =================================================================== --- lldb/trunk/include/lldb/Target/StackFrame.h +++ lldb/trunk/include/lldb/Target/StackFrame.h @@ -17,15 +17,15 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Core/Flags.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/UserID.h" #include "lldb/Core/ValueObjectList.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/StackID.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Target/SystemRuntime.h =================================================================== --- lldb/trunk/include/lldb/Target/SystemRuntime.h +++ lldb/trunk/include/lldb/Target/SystemRuntime.h @@ -16,12 +16,12 @@ // Project includes #include -#include "lldb/Core/ConstString.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/StructuredData.h" #include "lldb/Target/QueueItem.h" #include "lldb/Target/QueueList.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" #include "lldb/lldb-public.h" Index: lldb/trunk/include/lldb/Target/UnixSignals.h =================================================================== --- lldb/trunk/include/lldb/Target/UnixSignals.h +++ lldb/trunk/include/lldb/Target/UnixSignals.h @@ -17,7 +17,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/include/lldb/Utility/ConstString.h =================================================================== --- lldb/trunk/include/lldb/Utility/ConstString.h +++ lldb/trunk/include/lldb/Utility/ConstString.h @@ -0,0 +1,479 @@ +//===-- ConstString.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_ConstString_h_ +#define liblldb_ConstString_h_ + +// C Includes +// C++ Includes +// Other libraries and framework includes +#include "llvm/ADT/StringRef.h" + +// Project includes +#include "lldb/lldb-private.h" + +namespace lldb_private { + +//---------------------------------------------------------------------- +/// @class ConstString ConstString.h "lldb/Utility/ConstString.h" +/// @brief A uniqued constant string class. +/// +/// Provides an efficient way to store strings as uniqued strings. After +/// the strings are uniqued, finding strings that are equal to one +/// another is very fast as just the pointers need to be compared. It +/// also allows for many common strings from many different sources to +/// be shared to keep the memory footprint low. +/// +/// No reference counting is done on strings that are added to the +/// string pool, once strings are added they are in the string pool for +/// the life of the program. +//---------------------------------------------------------------------- +class ConstString { +public: + //------------------------------------------------------------------ + /// Default constructor + /// + /// Initializes the string to an empty string. + //------------------------------------------------------------------ + ConstString() : m_string(nullptr) {} + + //------------------------------------------------------------------ + /// Copy constructor + /// + /// Copies the string value in \a rhs into this object. + /// + /// @param[in] rhs + /// Another string object to copy. + //------------------------------------------------------------------ + ConstString(const ConstString &rhs) : m_string(rhs.m_string) {} + + explicit ConstString(const llvm::StringRef &s); + + //------------------------------------------------------------------ + /// Construct with C String value + /// + /// Constructs this object with a C string by looking to see if the + /// C string already exists in the global string pool. If it doesn't + /// exist, it is added to the string pool. + /// + /// @param[in] cstr + /// A NULL terminated C string to add to the string pool. + //------------------------------------------------------------------ + explicit ConstString(const char *cstr); + + //------------------------------------------------------------------ + /// Construct with C String value with max length + /// + /// Constructs this object with a C string with a length. If + /// \a max_cstr_len is greater than the actual length of the string, + /// the string length will be truncated. This allows substrings to + /// be created without the need to NULL terminate the string as it + /// is passed into this function. + /// + /// @param[in] cstr + /// A pointer to the first character in the C string. The C + /// string can be NULL terminated in a buffer that contains + /// more characters than the length of the string, or the + /// string can be part of another string and a new substring + /// can be created. + /// + /// @param[in] max_cstr_len + /// The max length of \a cstr. If the string length of \a cstr + /// is less than \a max_cstr_len, then the string will be + /// truncated. If the string length of \a cstr is greater than + /// \a max_cstr_len, then only max_cstr_len bytes will be used + /// from \a cstr. + //------------------------------------------------------------------ + explicit ConstString(const char *cstr, size_t max_cstr_len); + + //------------------------------------------------------------------ + /// Destructor + /// + /// Since constant string values are currently not reference counted, + /// there isn't much to do here. + //------------------------------------------------------------------ + ~ConstString() = default; + + //---------------------------------------------------------------------- + /// C string equality binary predicate function object for ConstString + /// objects. + //---------------------------------------------------------------------- + struct StringIsEqual { + //-------------------------------------------------------------- + /// C equality test. + /// + /// Two C strings are equal when they are contained in ConstString + /// objects when their pointer values are equal to each other. + /// + /// @return + /// Returns \b true if the C string in \a lhs is equal to + /// the C string value in \a rhs, \b false otherwise. + //-------------------------------------------------------------- + bool operator()(const char *lhs, const char *rhs) const { + return lhs == rhs; + } + }; + + //------------------------------------------------------------------ + /// Convert to bool operator. + /// + /// This allows code to check a ConstString object to see if it + /// contains a valid string using code such as: + /// + /// @code + /// ConstString str(...); + /// if (str) + /// { ... + /// @endcode + /// + /// @return + /// /b True this object contains a valid non-empty C string, \b + /// false otherwise. + //------------------------------------------------------------------ + explicit operator bool() const { return m_string && m_string[0]; } + + //------------------------------------------------------------------ + /// Assignment operator + /// + /// Assigns the string in this object with the value from \a rhs. + /// + /// @param[in] rhs + /// Another string object to copy into this object. + /// + /// @return + /// A const reference to this object. + //------------------------------------------------------------------ + const ConstString &operator=(const ConstString &rhs) { + m_string = rhs.m_string; + return *this; + } + + //------------------------------------------------------------------ + /// Equal to operator + /// + /// Returns true if this string is equal to the string in \a rhs. + /// This operation is very fast as it results in a pointer + /// comparison since all strings are in a uniqued in a global string + /// pool. + /// + /// @param[in] rhs + /// Another string object to compare this object to. + /// + /// @return + /// @li \b true if this object is equal to \a rhs. + /// @li \b false if this object is not equal to \a rhs. + //------------------------------------------------------------------ + bool operator==(const ConstString &rhs) const { + // We can do a pointer compare to compare these strings since they + // must come from the same pool in order to be equal. + return m_string == rhs.m_string; + } + + //------------------------------------------------------------------ + /// Not equal to operator + /// + /// Returns true if this string is not equal to the string in \a rhs. + /// This operation is very fast as it results in a pointer + /// comparison since all strings are in a uniqued in a global string + /// pool. + /// + /// @param[in] rhs + /// Another string object to compare this object to. + /// + /// @return + /// @li \b true if this object is not equal to \a rhs. + /// @li \b false if this object is equal to \a rhs. + //------------------------------------------------------------------ + bool operator!=(const ConstString &rhs) const { + return m_string != rhs.m_string; + } + + bool operator<(const ConstString &rhs) const; + + //------------------------------------------------------------------ + /// Get the string value as a C string. + /// + /// Get the value of the contained string as a NULL terminated C + /// string value. + /// + /// If \a value_if_empty is nullptr, then nullptr will be returned. + /// + /// @return + /// Returns \a value_if_empty if the string is empty, otherwise + /// the C string value contained in this object. + //------------------------------------------------------------------ + const char *AsCString(const char *value_if_empty = nullptr) const { + return (IsEmpty() ? value_if_empty : m_string); + } + + //------------------------------------------------------------------ + /// Get the string value as a llvm::StringRef + /// + /// @return + /// Returns a new llvm::StringRef object filled in with the + /// needed data. + //------------------------------------------------------------------ + llvm::StringRef GetStringRef() const { + return llvm::StringRef(m_string, GetLength()); + } + + //------------------------------------------------------------------ + /// Get the string value as a C string. + /// + /// Get the value of the contained string as a NULL terminated C + /// string value. Similar to the ConstString::AsCString() function, + /// yet this function will always return nullptr if the string is not + /// valid. So this function is a direct accessor to the string + /// pointer value. + /// + /// @return + /// Returns nullptr the string is invalid, otherwise the C string + /// value contained in this object. + //------------------------------------------------------------------ + const char *GetCString() const { return m_string; } + + //------------------------------------------------------------------ + /// Get the length in bytes of string value. + /// + /// The string pool stores the length of the string, so we can avoid + /// calling strlen() on the pointer value with this function. + /// + /// @return + /// Returns the number of bytes that this string occupies in + /// memory, not including the NULL termination byte. + //------------------------------------------------------------------ + size_t GetLength() const; + + //------------------------------------------------------------------ + /// Clear this object's state. + /// + /// Clear any contained string and reset the value to the an empty + /// string value. + //------------------------------------------------------------------ + void Clear() { m_string = nullptr; } + + //------------------------------------------------------------------ + /// Equal to operator + /// + /// Returns true if this string is equal to the string in \a rhs. + /// If case sensitive equality is tested, this operation is very + /// fast as it results in a pointer comparison since all strings + /// are in a uniqued in a global string pool. + /// + /// @param[in] rhs + /// The Left Hand Side const ConstString object reference. + /// + /// @param[in] rhs + /// The Right Hand Side const ConstString object reference. + /// + /// @param[in] case_sensitive + /// Case sensitivity. If true, case sensitive equality + /// will be tested, otherwise character case will be ignored + /// + /// @return + /// @li \b true if this object is equal to \a rhs. + /// @li \b false if this object is not equal to \a rhs. + //------------------------------------------------------------------ + static bool Equals(const ConstString &lhs, const ConstString &rhs, + const bool case_sensitive = true); + + //------------------------------------------------------------------ + /// Compare two string objects. + /// + /// Compares the C string values contained in \a lhs and \a rhs and + /// returns an integer result. + /// + /// NOTE: only call this function when you want a true string + /// comparison. If you want string equality use the, use the == + /// operator as it is much more efficient. Also if you want string + /// inequality, use the != operator for the same reasons. + /// + /// @param[in] lhs + /// The Left Hand Side const ConstString object reference. + /// + /// @param[in] rhs + /// The Right Hand Side const ConstString object reference. + /// + /// @param[in] case_sensitive + /// Case sensitivity of compare. If true, case sensitive compare + /// will be performed, otherwise character case will be ignored + /// + /// @return + /// @li -1 if lhs < rhs + /// @li 0 if lhs == rhs + /// @li 1 if lhs > rhs + //------------------------------------------------------------------ + static int Compare(const ConstString &lhs, const ConstString &rhs, + const bool case_sensitive = true); + + //------------------------------------------------------------------ + /// Dump the object description to a stream. + /// + /// Dump the string value to the stream \a s. If the contained string + /// is empty, print \a value_if_empty to the stream instead. If + /// \a value_if_empty is nullptr, then nothing will be dumped to the + /// stream. + /// + /// @param[in] s + /// The stream that will be used to dump the object description. + /// + /// @param[in] value_if_empty + /// The value to dump if the string is empty. If nullptr, nothing + /// will be output to the stream. + //------------------------------------------------------------------ + void Dump(Stream *s, const char *value_if_empty = nullptr) const; + + //------------------------------------------------------------------ + /// Dump the object debug description to a stream. + /// + /// @param[in] s + /// The stream that will be used to dump the object description. + //------------------------------------------------------------------ + void DumpDebug(Stream *s) const; + + //------------------------------------------------------------------ + /// Test for empty string. + /// + /// @return + /// @li \b true if the contained string is empty. + /// @li \b false if the contained string is not empty. + //------------------------------------------------------------------ + bool IsEmpty() const { return m_string == nullptr || m_string[0] == '\0'; } + + //------------------------------------------------------------------ + /// Set the C string value. + /// + /// Set the string value in the object by uniquing the \a cstr + /// string value in our global string pool. + /// + /// If the C string already exists in the global string pool, it + /// finds the current entry and returns the existing value. If it + /// doesn't exist, it is added to the string pool. + /// + /// @param[in] cstr + /// A NULL terminated C string to add to the string pool. + //------------------------------------------------------------------ + void SetCString(const char *cstr); + + void SetString(const llvm::StringRef &s); + + //------------------------------------------------------------------ + /// Set the C string value and its mangled counterpart. + /// + /// Object files and debug symbols often use mangled string to + /// represent the linkage name for a symbol, function or global. + /// The string pool can efficiently store these values and their + /// counterparts so when we run into another instance of a mangled + /// name, we can avoid calling the name demangler over and over on + /// the same strings and then trying to unique them. + /// + /// @param[in] demangled + /// The demangled C string to correlate with the \a mangled + /// name. + /// + /// @param[in] mangled + /// The already uniqued mangled ConstString to correlate the + /// soon to be uniqued version of \a demangled. + //------------------------------------------------------------------ + void SetCStringWithMangledCounterpart(const char *demangled, + const ConstString &mangled); + + //------------------------------------------------------------------ + /// Retrieve the mangled or demangled counterpart for a mangled + /// or demangled ConstString. + /// + /// Object files and debug symbols often use mangled string to + /// represent the linkage name for a symbol, function or global. + /// The string pool can efficiently store these values and their + /// counterparts so when we run into another instance of a mangled + /// name, we can avoid calling the name demangler over and over on + /// the same strings and then trying to unique them. + /// + /// @param[in] counterpart + /// A reference to a ConstString object that might get filled in + /// with the demangled/mangled counterpart. + /// + /// @return + /// /b True if \a counterpart was filled in with the counterpart + /// /b false otherwise. + //------------------------------------------------------------------ + bool GetMangledCounterpart(ConstString &counterpart) const; + + //------------------------------------------------------------------ + /// Set the C string value with length. + /// + /// Set the string value in the object by uniquing \a cstr_len bytes + /// starting at the \a cstr string value in our global string pool. + /// If trim is true, then \a cstr_len indicates a maximum length of + /// the CString and if the actual length of the string is less, then + /// it will be trimmed. + /// + /// If the C string already exists in the global string pool, it + /// finds the current entry and returns the existing value. If it + /// doesn't exist, it is added to the string pool. + /// + /// @param[in] cstr + /// A NULL terminated C string to add to the string pool. + /// + /// @param[in] cstr_len + /// The maximum length of the C string. + //------------------------------------------------------------------ + void SetCStringWithLength(const char *cstr, size_t cstr_len); + + //------------------------------------------------------------------ + /// Set the C string value with the minimum length between + /// \a fixed_cstr_len and the actual length of the C string. This + /// can be used for data structures that have a fixed length to + /// store a C string where the string might not be NULL terminated + /// if the string takes the entire buffer. + //------------------------------------------------------------------ + void SetTrimmedCStringWithLength(const char *cstr, size_t fixed_cstr_len); + + //------------------------------------------------------------------ + /// Get the memory cost of this object. + /// + /// Return the size in bytes that this object takes in memory. This + /// returns the size in bytes of this object, which does not include + /// any the shared string values it may refer to. + /// + /// @return + /// The number of bytes that this object occupies in memory. + /// + /// @see ConstString::StaticMemorySize () + //------------------------------------------------------------------ + size_t MemorySize() const { return sizeof(ConstString); } + + //------------------------------------------------------------------ + /// Get the size in bytes of the current global string pool. + /// + /// Reports the size in bytes of all shared C string values, + /// containers and any other values as a byte size for the + /// entire string pool. + /// + /// @return + /// The number of bytes that the global string pool occupies + /// in memory. + //------------------------------------------------------------------ + static size_t StaticMemorySize(); + +protected: + //------------------------------------------------------------------ + // Member variables + //------------------------------------------------------------------ + const char *m_string; +}; + +//------------------------------------------------------------------ +/// Stream the string value \a str to the stream \a s +//------------------------------------------------------------------ +Stream &operator<<(Stream &s, const ConstString &str); + +} // namespace lldb_private + +#endif // liblldb_ConstString_h_ Index: lldb/trunk/include/lldb/Utility/Error.h =================================================================== --- lldb/trunk/include/lldb/Utility/Error.h +++ lldb/trunk/include/lldb/Utility/Error.h @@ -0,0 +1,315 @@ +//===-- Error.h -------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef __DCError_h__ +#define __DCError_h__ +#if defined(__cplusplus) + +#include "llvm/Support/DataTypes.h" +#include "llvm/Support/FormatVariadic.h" + +#include +#include +#include + +#include "lldb/lldb-private.h" + +#include "llvm/Support/FormatVariadic.h" + +namespace lldb_private { + +class Log; + +//---------------------------------------------------------------------- +/// @class Error Error.h "lldb/Utility/Error.h" +/// @brief An error handling class. +/// +/// This class is designed to be able to hold any error code that can be +/// encountered on a given platform. The errors are stored as a value +/// of type Error::ValueType. This value should be large enough to hold +/// any and all errors that the class supports. Each error has an +/// associated type that is of type lldb::ErrorType. New types +/// can be added to support new error types, and architecture specific +/// types can be enabled. In the future we may wish to switch to a +/// registration mechanism where new error types can be registered at +/// runtime instead of a hard coded scheme. +/// +/// All errors in this class also know how to generate a string +/// representation of themselves for printing results and error codes. +/// The string value will be fetched on demand and its string value will +/// be cached until the error is cleared of the value of the error +/// changes. +//---------------------------------------------------------------------- +class Error { +public: + //------------------------------------------------------------------ + /// Every error value that this object can contain needs to be able + /// to fit into ValueType. + //------------------------------------------------------------------ + typedef uint32_t ValueType; + + //------------------------------------------------------------------ + /// Default constructor. + /// + /// Initialize the error object with a generic success value. + /// + /// @param[in] err + /// An error code. + /// + /// @param[in] type + /// The type for \a err. + //------------------------------------------------------------------ + Error(); + + explicit Error(ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric); + + explicit Error(const char *format, ...) __attribute__((format(printf, 2, 3))); + + Error(const Error &rhs); + //------------------------------------------------------------------ + /// Assignment operator. + /// + /// @param[in] err + /// An error code. + /// + /// @return + /// A const reference to this object. + //------------------------------------------------------------------ + const Error &operator=(const Error &rhs); + + //------------------------------------------------------------------ + /// Assignment operator from a kern_return_t. + /// + /// Sets the type to \c MachKernel and the error code to \a err. + /// + /// @param[in] err + /// A mach error code. + /// + /// @return + /// A const reference to this object. + //------------------------------------------------------------------ + const Error &operator=(uint32_t err); + + ~Error(); + + //------------------------------------------------------------------ + /// Get the error string associated with the current error. + // + /// Gets the error value as a NULL terminated C string. The error + /// string will be fetched and cached on demand. The error string + /// will be retrieved from a callback that is appropriate for the + /// type of the error and will be cached until the error value is + /// changed or cleared. + /// + /// @return + /// The error as a NULL terminated C string value if the error + /// is valid and is able to be converted to a string value, + /// NULL otherwise. + //------------------------------------------------------------------ + const char *AsCString(const char *default_error_str = "unknown error") const; + + //------------------------------------------------------------------ + /// Clear the object state. + /// + /// Reverts the state of this object to contain a generic success + /// value and frees any cached error string value. + //------------------------------------------------------------------ + void Clear(); + + //------------------------------------------------------------------ + /// Test for error condition. + /// + /// @return + /// \b true if this object contains an error, \b false + /// otherwise. + //------------------------------------------------------------------ + bool Fail() const; + + //------------------------------------------------------------------ + /// Access the error value. + /// + /// @return + /// The error value. + //------------------------------------------------------------------ + ValueType GetError() const; + + //------------------------------------------------------------------ + /// Access the error type. + /// + /// @return + /// The error type enumeration value. + //------------------------------------------------------------------ + lldb::ErrorType GetType() const; + + //------------------------------------------------------------------ + /// Log an error to Log(). + /// + /// Log the error given a formatted string \a format. If the this + /// object contains an error code, update the error string to + /// contain the prefix "error: ", followed by the formatted string, + /// followed by the error value and any string that describes the + /// error value. This allows more context to be given to an error + /// string that remains cached in this object. Logging always occurs + /// even when the error code contains a non-error value. + /// + /// @param[in] format + /// A printf style format string. + /// + /// @param[in] ... + /// Variable arguments that are needed for the printf style + /// format string \a format. + //------------------------------------------------------------------ + void PutToLog(Log *log, const char *format, ...) + __attribute__((format(printf, 3, 4))); + + //------------------------------------------------------------------ + /// Log an error to Log() if the error value is an error. + /// + /// Log the error given a formatted string \a format only if the + /// error value in this object describes an error condition. If the + /// this object contains an error, update the error string to + /// contain the prefix "error: " followed by the formatted string, + /// followed by the error value and any string that describes the + /// error value. This allows more context to be given to an error + /// string that remains cached in this object. + /// + /// @param[in] format + /// A printf style format string. + /// + /// @param[in] ... + /// Variable arguments that are needed for the printf style + /// format string \a format. + //------------------------------------------------------------------ + void LogIfError(Log *log, const char *format, ...) + __attribute__((format(printf, 3, 4))); + + //------------------------------------------------------------------ + /// Set accessor from a kern_return_t. + /// + /// Set accesssor for the error value to \a err and the error type + /// to \c MachKernel. + /// + /// @param[in] err + /// A mach error code. + //------------------------------------------------------------------ + void SetMachError(uint32_t err); + + void SetExpressionError(lldb::ExpressionResults, const char *mssg); + + int SetExpressionErrorWithFormat(lldb::ExpressionResults, const char *format, + ...) __attribute__((format(printf, 3, 4))); + + //------------------------------------------------------------------ + /// Set accesssor with an error value and type. + /// + /// Set accesssor for the error value to \a err and the error type + /// to \a type. + /// + /// @param[in] err + /// A mach error code. + /// + /// @param[in] type + /// The type for \a err. + //------------------------------------------------------------------ + void SetError(ValueType err, lldb::ErrorType type); + + //------------------------------------------------------------------ + /// Set the current error to errno. + /// + /// Update the error value to be \c errno and update the type to + /// be \c Error::POSIX. + //------------------------------------------------------------------ + void SetErrorToErrno(); + + //------------------------------------------------------------------ + /// Set the current error to a generic error. + /// + /// Update the error value to be \c LLDB_GENERIC_ERROR and update the + /// type to be \c Error::Generic. + //------------------------------------------------------------------ + void SetErrorToGenericError(); + + //------------------------------------------------------------------ + /// Set the current error string to \a err_str. + /// + /// Set accessor for the error string value for a generic errors, + /// or to supply additional details above and beyond the standard + /// error strings that the standard type callbacks typically + /// provide. This allows custom strings to be supplied as an + /// error explanation. The error string value will remain until the + /// error value is cleared or a new error value/type is assigned. + /// + /// @param err_str + /// The new custom error string to copy and cache. + //------------------------------------------------------------------ + void SetErrorString(llvm::StringRef err_str); + + //------------------------------------------------------------------ + /// Set the current error string to a formatted error string. + /// + /// @param format + /// A printf style format string + //------------------------------------------------------------------ + int SetErrorStringWithFormat(const char *format, ...) + __attribute__((format(printf, 2, 3))); + + int SetErrorStringWithVarArg(const char *format, va_list args); + + template + void SetErrorStringWithFormatv(const char *format, Args &&... args) { + SetErrorString(llvm::formatv(format, std::forward(args)...).str()); + } + + //------------------------------------------------------------------ + /// Test for success condition. + /// + /// Returns true if the error code in this object is considered a + /// successful return value. + /// + /// @return + /// \b true if this object contains an value that describes + /// success (non-erro), \b false otherwise. + //------------------------------------------------------------------ + bool Success() const; + + //------------------------------------------------------------------ + /// Test for a failure due to a generic interrupt. + /// + /// Returns true if the error code in this object was caused by an interrupt. + /// At present only supports Posix EINTR. + /// + /// @return + /// \b true if this object contains an value that describes + /// failure due to interrupt, \b false otherwise. + //------------------------------------------------------------------ + bool WasInterrupted() const; + +protected: + //------------------------------------------------------------------ + /// Member variables + //------------------------------------------------------------------ + ValueType m_code; ///< Error code as an integer value. + lldb::ErrorType m_type; ///< The type of the above error code. + mutable std::string m_string; ///< A string representation of the error code. +}; + +} // namespace lldb_private + +namespace llvm { +template <> struct format_provider { + static void format(const lldb_private::Error &error, llvm::raw_ostream &OS, + llvm::StringRef Options) { + llvm::format_provider::format(error.AsCString(), OS, + Options); + } +}; +} + +#endif // #if defined(__cplusplus) +#endif // #ifndef __DCError_h__ Index: lldb/trunk/include/lldb/Utility/JSON.h =================================================================== --- lldb/trunk/include/lldb/Utility/JSON.h +++ lldb/trunk/include/lldb/Utility/JSON.h @@ -10,7 +10,7 @@ #ifndef utility_JSON_h_ #define utility_JSON_h_ -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include "lldb/Utility/StringExtractor.h" #include Index: lldb/trunk/include/lldb/Utility/ProcessStructReader.h =================================================================== --- lldb/trunk/include/lldb/Utility/ProcessStructReader.h +++ lldb/trunk/include/lldb/Utility/ProcessStructReader.h @@ -14,11 +14,11 @@ #include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include #include Index: lldb/trunk/include/lldb/Utility/RegularExpression.h =================================================================== --- lldb/trunk/include/lldb/Utility/RegularExpression.h +++ lldb/trunk/include/lldb/Utility/RegularExpression.h @@ -0,0 +1,217 @@ +//===-- RegularExpression.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_RegularExpression_h_ +#define liblldb_RegularExpression_h_ + +#ifdef _WIN32 +#include "../lib/Support/regex_impl.h" + +typedef llvm_regmatch_t regmatch_t; +typedef llvm_regex_t regex_t; + +inline int regcomp(llvm_regex_t *a, const char *b, int c) { + return llvm_regcomp(a, b, c); +} + +inline size_t regerror(int a, const llvm_regex_t *b, char *c, size_t d) { + return llvm_regerror(a, b, c, d); +} + +inline int regexec(const llvm_regex_t *a, const char *b, size_t c, + llvm_regmatch_t d[], int e) { + return llvm_regexec(a, b, c, d, e); +} + +inline void regfree(llvm_regex_t *a) { llvm_regfree(a); } +#else +#ifdef __ANDROID__ +#include +#endif +#include +#endif +#include + +#include +#include + +namespace llvm { +class StringRef; +} // namespace llvm + +namespace lldb_private { + +//---------------------------------------------------------------------- +/// @class RegularExpression RegularExpression.h +/// "lldb/Utility/RegularExpression.h" +/// @brief A C++ wrapper class for regex. +/// +/// This regular expression class wraps the posix regex functions +/// \c regcomp(), \c regerror(), \c regexec(), and \c regfree() from +/// the header file in \c /usr/include/regex\.h. +//---------------------------------------------------------------------- +class RegularExpression { +public: + class Match { + public: + Match(uint32_t max_matches) : m_matches() { + if (max_matches > 0) + m_matches.resize(max_matches + 1); + } + + void Clear() { + const size_t num_matches = m_matches.size(); + regmatch_t invalid_match = {-1, -1}; + for (size_t i = 0; i < num_matches; ++i) + m_matches[i] = invalid_match; + } + + size_t GetSize() const { return m_matches.size(); } + + regmatch_t *GetData() { + return (m_matches.empty() ? nullptr : m_matches.data()); + } + + bool GetMatchAtIndex(llvm::StringRef s, uint32_t idx, + std::string &match_str) const; + + bool GetMatchAtIndex(llvm::StringRef s, uint32_t idx, + llvm::StringRef &match_str) const; + + bool GetMatchSpanningIndices(llvm::StringRef s, uint32_t idx1, + uint32_t idx2, + llvm::StringRef &match_str) const; + + protected: + std::vector + m_matches; ///< Where parenthesized subexpressions results are stored + }; + + //------------------------------------------------------------------ + /// Default constructor. + /// + /// The default constructor that initializes the object state such + /// that it contains no compiled regular expression. + //------------------------------------------------------------------ + RegularExpression(); + + explicit RegularExpression(llvm::StringRef string); + + //------------------------------------------------------------------ + /// Destructor. + /// + /// Any previously compiled regular expression contained in this + /// object will be freed. + //------------------------------------------------------------------ + ~RegularExpression(); + + RegularExpression(const RegularExpression &rhs); + + const RegularExpression &operator=(const RegularExpression &rhs); + + //------------------------------------------------------------------ + /// Compile a regular expression. + /// + /// Compile a regular expression using the supplied regular + /// expression text. The compiled regular expression lives + /// in this object so that it can be readily used for regular + /// expression matches. Execute() can be called after the regular + /// expression is compiled. Any previously compiled regular + /// expression contained in this object will be freed. + /// + /// @param[in] re + /// A NULL terminated C string that represents the regular + /// expression to compile. + /// + /// @return + /// \b true if the regular expression compiles successfully, + /// \b false otherwise. + //------------------------------------------------------------------ + bool Compile(llvm::StringRef string); + bool Compile(const char *) = delete; + + //------------------------------------------------------------------ + /// Executes a regular expression. + /// + /// Execute a regular expression match using the compiled regular + /// expression that is already in this object against the match + /// string \a s. If any parens are used for regular expression + /// matches \a match_count should indicate the number of regmatch_t + /// values that are present in \a match_ptr. + /// + /// @param[in] string + /// The string to match against the compile regular expression. + /// + /// @param[in] match + /// A pointer to a RegularExpression::Match structure that was + /// properly initialized with the desired number of maximum + /// matches, or nullptr if no parenthesized matching is needed. + /// + /// @return + /// \b true if \a string matches the compiled regular + /// expression, \b false otherwise. + //------------------------------------------------------------------ + bool Execute(llvm::StringRef string, Match *match = nullptr) const; + bool Execute(const char *, Match * = nullptr) = delete; + + size_t GetErrorAsCString(char *err_str, size_t err_str_max_len) const; + + //------------------------------------------------------------------ + /// Free the compiled regular expression. + /// + /// If this object contains a valid compiled regular expression, + /// this function will free any resources it was consuming. + //------------------------------------------------------------------ + void Free(); + + //------------------------------------------------------------------ + /// Access the regular expression text. + /// + /// Returns the text that was used to compile the current regular + /// expression. + /// + /// @return + /// The NULL terminated C string that was used to compile the + /// current regular expression + //------------------------------------------------------------------ + llvm::StringRef GetText() const; + + //------------------------------------------------------------------ + /// Test if valid. + /// + /// Test if this object contains a valid regular expression. + /// + /// @return + /// \b true if the regular expression compiled and is ready + /// for execution, \b false otherwise. + //------------------------------------------------------------------ + bool IsValid() const; + + void Clear() { + Free(); + m_re.clear(); + m_comp_err = 1; + } + + int GetErrorCode() const { return m_comp_err; } + + bool operator<(const RegularExpression &rhs) const; + +private: + //------------------------------------------------------------------ + // Member variables + //------------------------------------------------------------------ + std::string m_re; ///< A copy of the original regular expression text + int m_comp_err; ///< Error code for the regular expression compilation + regex_t m_preg; ///< The compiled regular expression +}; + +} // namespace lldb_private + +#endif // liblldb_RegularExpression_h_ Index: lldb/trunk/include/lldb/Utility/Stream.h =================================================================== --- lldb/trunk/include/lldb/Utility/Stream.h +++ lldb/trunk/include/lldb/Utility/Stream.h @@ -0,0 +1,548 @@ +//===-- Stream.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_Stream_h_ +#define liblldb_Stream_h_ + +// C Includes +#include + +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/Core/Flags.h" +#include "lldb/lldb-private.h" + +#include "llvm/Support/FormatVariadic.h" + +namespace lldb_private { + +//---------------------------------------------------------------------- +/// @class Stream Stream.h "lldb/Utility/Stream.h" +/// @brief A stream class that can stream formatted output to a file. +//---------------------------------------------------------------------- +class Stream { +public: + //------------------------------------------------------------------ + /// \a m_flags bit values. + //------------------------------------------------------------------ + enum { + eBinary = (1 << 0) ///< Get and put data as binary instead of as the default + /// string mode. + }; + + //------------------------------------------------------------------ + /// Construct with flags and address size and byte order. + /// + /// Construct with dump flags \a flags and the default address + /// size. \a flags can be any of the above enumeration logical OR'ed + /// together. + //------------------------------------------------------------------ + Stream(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); + + //------------------------------------------------------------------ + /// Construct a default Stream, not binary, host byte order and + /// host addr size. + /// + //------------------------------------------------------------------ + Stream(); + + //------------------------------------------------------------------ + /// Destructor + //------------------------------------------------------------------ + virtual ~Stream(); + + //------------------------------------------------------------------ + // Subclasses must override these methods + //------------------------------------------------------------------ + + //------------------------------------------------------------------ + /// Flush the stream. + /// + /// Subclasses should flush the stream to make any output appear + /// if the stream has any buffering. + //------------------------------------------------------------------ + virtual void Flush() = 0; + + //------------------------------------------------------------------ + /// Output character bytes to the stream. + /// + /// Appends \a src_len characters from the buffer \a src to the + /// stream. + /// + /// @param[in] src + /// A buffer containing at least \a src_len bytes of data. + /// + /// @param[in] src_len + /// A number of bytes to append to the stream. + /// + /// @return + /// The number of bytes that were appended to the stream. + //------------------------------------------------------------------ + virtual size_t Write(const void *src, size_t src_len) = 0; + + //------------------------------------------------------------------ + // Member functions + //------------------------------------------------------------------ + size_t PutChar(char ch); + + //------------------------------------------------------------------ + /// Set the byte_order value. + /// + /// Sets the byte order of the data to extract. Extracted values + /// will be swapped if necessary when decoding. + /// + /// @param[in] byte_order + /// The byte order value to use when extracting data. + /// + /// @return + /// The old byte order value. + //------------------------------------------------------------------ + lldb::ByteOrder SetByteOrder(lldb::ByteOrder byte_order); + + //------------------------------------------------------------------ + /// Format a C string from a printf style format and variable + /// arguments and encode and append the resulting C string as hex + /// bytes. + /// + /// @param[in] format + /// A printf style format string. + /// + /// @param[in] ... + /// Any additional arguments needed for the printf format string. + /// + /// @return + /// The number of bytes that were appended to the stream. + //------------------------------------------------------------------ + size_t PrintfAsRawHex8(const char *format, ...) + __attribute__((__format__(__printf__, 2, 3))); + + //------------------------------------------------------------------ + /// Format a C string from a printf style format and variable + /// arguments and encode and append the resulting C string as hex + /// bytes. + /// + /// @param[in] format + /// A printf style format string. + /// + /// @param[in] ... + /// Any additional arguments needed for the printf format string. + /// + /// @return + /// The number of bytes that were appended to the stream. + //------------------------------------------------------------------ + size_t PutHex8(uint8_t uvalue); + + size_t PutNHex8(size_t n, uint8_t uvalue); + + size_t PutHex16(uint16_t uvalue, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + + size_t PutHex32(uint32_t uvalue, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + + size_t PutHex64(uint64_t uvalue, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + + size_t PutMaxHex64(uint64_t uvalue, size_t byte_size, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + size_t PutFloat(float f, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + + size_t PutDouble(double d, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + + size_t PutLongDouble(long double ld, + lldb::ByteOrder byte_order = lldb::eByteOrderInvalid); + + size_t PutPointer(void *ptr); + + // Append \a src_len bytes from \a src to the stream as hex characters + // (two ascii characters per byte of input data) + size_t + PutBytesAsRawHex8(const void *src, size_t src_len, + lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid, + lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid); + + // Append \a src_len bytes from \a s to the stream as binary data. + size_t PutRawBytes(const void *s, size_t src_len, + lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid, + lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid); + + size_t PutCStringAsRawHex8(const char *s); + + //------------------------------------------------------------------ + /// Output a NULL terminated C string \a cstr to the stream \a s. + /// + /// @param[in] cstr + /// A NULL terminated C string. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(const char *cstr); + + Stream &operator<<(llvm::StringRef str); + + //------------------------------------------------------------------ + /// Output a pointer value \a p to the stream \a s. + /// + /// @param[in] p + /// A void pointer. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(const void *p); + + //------------------------------------------------------------------ + /// Output a character \a ch to the stream \a s. + /// + /// @param[in] ch + /// A printable character value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(char ch); + + //------------------------------------------------------------------ + /// Output a uint8_t \a uval to the stream \a s. + /// + /// @param[in] uval + /// A uint8_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(uint8_t uval); + + //------------------------------------------------------------------ + /// Output a uint16_t \a uval to the stream \a s. + /// + /// @param[in] uval + /// A uint16_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(uint16_t uval); + + //------------------------------------------------------------------ + /// Output a uint32_t \a uval to the stream \a s. + /// + /// @param[in] uval + /// A uint32_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(uint32_t uval); + + //------------------------------------------------------------------ + /// Output a uint64_t \a uval to the stream \a s. + /// + /// @param[in] uval + /// A uint64_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(uint64_t uval); + + //------------------------------------------------------------------ + /// Output a int8_t \a sval to the stream \a s. + /// + /// @param[in] sval + /// A int8_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(int8_t sval); + + //------------------------------------------------------------------ + /// Output a int16_t \a sval to the stream \a s. + /// + /// @param[in] sval + /// A int16_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(int16_t sval); + + //------------------------------------------------------------------ + /// Output a int32_t \a sval to the stream \a s. + /// + /// @param[in] sval + /// A int32_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(int32_t sval); + + //------------------------------------------------------------------ + /// Output a int64_t \a sval to the stream \a s. + /// + /// @param[in] sval + /// A int64_t value. + /// + /// @return + /// A reference to this class so multiple things can be streamed + /// in one statement. + //------------------------------------------------------------------ + Stream &operator<<(int64_t sval); + + //------------------------------------------------------------------ + /// Output an address value to this stream. + /// + /// Put an address \a addr out to the stream with optional \a prefix + /// and \a suffix strings. + /// + /// @param[in] addr + /// An address value. + /// + /// @param[in] addr_size + /// Size in bytes of the address, used for formatting. + /// + /// @param[in] prefix + /// A prefix C string. If nullptr, no prefix will be output. + /// + /// @param[in] suffix + /// A suffix C string. If nullptr, no suffix will be output. + //------------------------------------------------------------------ + void Address(uint64_t addr, uint32_t addr_size, const char *prefix = nullptr, + const char *suffix = nullptr); + + //------------------------------------------------------------------ + /// Output an address range to this stream. + /// + /// Put an address range \a lo_addr - \a hi_addr out to the stream + /// with optional \a prefix and \a suffix strings. + /// + /// @param[in] lo_addr + /// The start address of the address range. + /// + /// @param[in] hi_addr + /// The end address of the address range. + /// + /// @param[in] addr_size + /// Size in bytes of the address, used for formatting. + /// + /// @param[in] prefix + /// A prefix C string. If nullptr, no prefix will be output. + /// + /// @param[in] suffix + /// A suffix C string. If nullptr, no suffix will be output. + //------------------------------------------------------------------ + void AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, + const char *prefix = nullptr, const char *suffix = nullptr); + + //------------------------------------------------------------------ + /// Output a C string to the stream. + /// + /// Print a C string \a cstr to the stream. + /// + /// @param[in] cstr + /// The string to be output to the stream. + //------------------------------------------------------------------ + size_t PutCString(llvm::StringRef cstr); + + //------------------------------------------------------------------ + /// Output and End of Line character to the stream. + //------------------------------------------------------------------ + size_t EOL(); + + //------------------------------------------------------------------ + /// Get the address size in bytes. + /// + /// @return + /// The size of an address in bytes that is used when outputting + /// address and pointer values to the stream. + //------------------------------------------------------------------ + uint32_t GetAddressByteSize() const; + + //------------------------------------------------------------------ + /// The flags accessor. + /// + /// @return + /// A reference to the Flags member variable. + //------------------------------------------------------------------ + Flags &GetFlags(); + + //------------------------------------------------------------------ + /// The flags const accessor. + /// + /// @return + /// A const reference to the Flags member variable. + //------------------------------------------------------------------ + const Flags &GetFlags() const; + + //------------------------------------------------------------------ + //// The byte order accessor. + //// + //// @return + //// The byte order. + //------------------------------------------------------------------ + lldb::ByteOrder GetByteOrder() const; + + //------------------------------------------------------------------ + /// Get the current indentation level. + /// + /// @return + /// The current indentation level as an integer. + //------------------------------------------------------------------ + int GetIndentLevel() const; + + //------------------------------------------------------------------ + /// Indent the current line in the stream. + /// + /// Indent the current line using the current indentation level and + /// print an optional string following the indentation spaces. + /// + /// @param[in] s + /// A C string to print following the indentation. If nullptr, just + /// output the indentation characters. + //------------------------------------------------------------------ + size_t Indent(const char *s = nullptr); + size_t Indent(llvm::StringRef s); + + //------------------------------------------------------------------ + /// Decrement the current indentation level. + //------------------------------------------------------------------ + void IndentLess(int amount = 2); + + //------------------------------------------------------------------ + /// Increment the current indentation level. + //------------------------------------------------------------------ + void IndentMore(int amount = 2); + + //------------------------------------------------------------------ + /// Output an offset value. + /// + /// Put an offset \a uval out to the stream using the printf format + /// in \a format. + /// + /// @param[in] offset + /// The offset value. + /// + /// @param[in] format + /// The printf style format to use when outputting the offset. + //------------------------------------------------------------------ + void Offset(uint32_t offset, const char *format = "0x%8.8x: "); + + //------------------------------------------------------------------ + /// Output printf formatted output to the stream. + /// + /// Print some formatted output to the stream. + /// + /// @param[in] format + /// A printf style format string. + /// + /// @param[in] ... + /// Variable arguments that are needed for the printf style + /// format string \a format. + //------------------------------------------------------------------ + size_t Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); + + size_t PrintfVarArg(const char *format, va_list args); + + template void Format(const char *format, Args &&... args) { + PutCString(llvm::formatv(format, std::forward(args)...).str()); + } + + //------------------------------------------------------------------ + /// Output a quoted C string value to the stream. + /// + /// Print a double quoted NULL terminated C string to the stream + /// using the printf format in \a format. + /// + /// @param[in] cstr + /// A NULL terminated C string value. + /// + /// @param[in] format + /// The optional C string format that can be overridden. + //------------------------------------------------------------------ + void QuotedCString(const char *cstr, const char *format = "\"%s\""); + + //------------------------------------------------------------------ + /// Set the address size in bytes. + /// + /// @param[in] addr_size + /// The new size in bytes of an address to use when outputting + /// address and pointer values. + //------------------------------------------------------------------ + void SetAddressByteSize(uint32_t addr_size); + + //------------------------------------------------------------------ + /// Set the current indentation level. + /// + /// @param[in] level + /// The new indentation level. + //------------------------------------------------------------------ + void SetIndentLevel(int level); + + //------------------------------------------------------------------ + /// Output a SLEB128 number to the stream. + /// + /// Put an SLEB128 \a uval out to the stream using the printf format + /// in \a format. + /// + /// @param[in] uval + /// A uint64_t value that was extracted as a SLEB128 value. + /// + /// @param[in] format + /// The optional printf format that can be overridden. + //------------------------------------------------------------------ + size_t PutSLEB128(int64_t uval); + + //------------------------------------------------------------------ + /// Output a ULEB128 number to the stream. + /// + /// Put an ULEB128 \a uval out to the stream using the printf format + /// in \a format. + /// + /// @param[in] uval + /// A uint64_t value that was extracted as a ULEB128 value. + /// + /// @param[in] format + /// The optional printf format that can be overridden. + //------------------------------------------------------------------ + size_t PutULEB128(uint64_t uval); + + static void UnitTest(Stream *s); + +protected: + //------------------------------------------------------------------ + // Member variables + //------------------------------------------------------------------ + Flags m_flags; ///< Dump flags. + uint32_t m_addr_size; ///< Size of an address in bytes. + lldb::ByteOrder + m_byte_order; ///< Byte order to use when encoding scalar types. + int m_indent_level; ///< Indention level. + + size_t _PutHex8(uint8_t uvalue, bool add_prefix); +}; + +} // namespace lldb_private + +#endif // liblldb_Stream_h_ Index: lldb/trunk/include/lldb/Utility/StreamString.h =================================================================== --- lldb/trunk/include/lldb/Utility/StreamString.h +++ lldb/trunk/include/lldb/Utility/StreamString.h @@ -0,0 +1,51 @@ +//===-- StreamString.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_StreamString_h_ +#define liblldb_StreamString_h_ + +#include + +#include "lldb/Utility/Stream.h" + +namespace lldb_private { + +class StreamString : public Stream { +public: + StreamString(); + + StreamString(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); + + ~StreamString() override; + + void Flush() override; + + size_t Write(const void *s, size_t length) override; + + void Clear(); + + bool Empty() const; + + size_t GetSize() const; + + size_t GetSizeOfLastLine() const; + + llvm::StringRef GetString() const; + + const char *GetData() const { return m_packet.c_str(); } + + void FillLastLineToColumn(uint32_t column, char fill_char); + +protected: + std::string m_packet; +}; + +} // namespace lldb_private + +#endif // liblldb_StreamString_h_ Index: lldb/trunk/include/lldb/Utility/StreamTee.h =================================================================== --- lldb/trunk/include/lldb/Utility/StreamTee.h +++ lldb/trunk/include/lldb/Utility/StreamTee.h @@ -0,0 +1,141 @@ +//===-- StreamTee.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_StreamTee_h_ +#define liblldb_StreamTee_h_ + +#include + +#include + +#include "lldb/Utility/Stream.h" + +namespace lldb_private { + +class StreamTee : public Stream { +public: + StreamTee() : Stream(), m_streams_mutex(), m_streams() {} + + StreamTee(lldb::StreamSP &stream_sp) + : Stream(), m_streams_mutex(), m_streams() { + // No need to lock mutex during construction + if (stream_sp) + m_streams.push_back(stream_sp); + } + + StreamTee(lldb::StreamSP &stream_sp, lldb::StreamSP &stream_2_sp) + : Stream(), m_streams_mutex(), m_streams() { + // No need to lock mutex during construction + if (stream_sp) + m_streams.push_back(stream_sp); + if (stream_2_sp) + m_streams.push_back(stream_2_sp); + } + + StreamTee(const StreamTee &rhs) + : Stream(rhs), m_streams_mutex(), m_streams() { + // Don't copy until we lock down "rhs" + std::lock_guard guard(rhs.m_streams_mutex); + m_streams = rhs.m_streams; + } + + ~StreamTee() override {} + + StreamTee &operator=(const StreamTee &rhs) { + if (this != &rhs) { + Stream::operator=(rhs); + std::lock_guard lhs_locker(m_streams_mutex); + std::lock_guard rhs_locker(rhs.m_streams_mutex); + m_streams = rhs.m_streams; + } + return *this; + } + + void Flush() override { + std::lock_guard guard(m_streams_mutex); + collection::iterator pos, end; + for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos) { + // Allow for our collection to contain NULL streams. This allows + // the StreamTee to be used with hard coded indexes for clients + // that might want N total streams with only a few that are set + // to valid values. + Stream *strm = pos->get(); + if (strm) + strm->Flush(); + } + } + + size_t Write(const void *s, size_t length) override { + std::lock_guard guard(m_streams_mutex); + if (m_streams.empty()) + return 0; + + size_t min_bytes_written = SIZE_MAX; + collection::iterator pos, end; + for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos) { + // Allow for our collection to contain NULL streams. This allows + // the StreamTee to be used with hard coded indexes for clients + // that might want N total streams with only a few that are set + // to valid values. + Stream *strm = pos->get(); + if (strm) { + const size_t bytes_written = strm->Write(s, length); + if (min_bytes_written > bytes_written) + min_bytes_written = bytes_written; + } + } + if (min_bytes_written == SIZE_MAX) + return 0; + return min_bytes_written; + } + + size_t AppendStream(const lldb::StreamSP &stream_sp) { + size_t new_idx = m_streams.size(); + std::lock_guard guard(m_streams_mutex); + m_streams.push_back(stream_sp); + return new_idx; + } + + size_t GetNumStreams() const { + size_t result = 0; + { + std::lock_guard guard(m_streams_mutex); + result = m_streams.size(); + } + return result; + } + + lldb::StreamSP GetStreamAtIndex(uint32_t idx) { + lldb::StreamSP stream_sp; + std::lock_guard guard(m_streams_mutex); + if (idx < m_streams.size()) + stream_sp = m_streams[idx]; + return stream_sp; + } + + void SetStreamAtIndex(uint32_t idx, const lldb::StreamSP &stream_sp) { + std::lock_guard guard(m_streams_mutex); + // Resize our stream vector as necessary to fit as many streams + // as needed. This also allows this class to be used with hard + // coded indexes that can be used contain many streams, not all + // of which are valid. + if (idx >= m_streams.size()) + m_streams.resize(idx + 1); + m_streams[idx] = stream_sp; + } + +protected: + typedef std::vector collection; + mutable std::recursive_mutex m_streams_mutex; + collection m_streams; +}; + +} // namespace lldb_private + +#endif // liblldb_StreamTee_h_ Index: lldb/trunk/include/lldb/lldb-private-enumerations.h =================================================================== --- lldb/trunk/include/lldb/lldb-private-enumerations.h +++ lldb/trunk/include/lldb/lldb-private-enumerations.h @@ -268,10 +268,13 @@ switch (V) { case lldb_private::eVoteNo: Stream << "no"; + return; case lldb_private::eVoteNoOpinion: Stream << "no opinion"; + return; case lldb_private::eVoteYes: Stream << "yes"; + return; } Stream << "invalid"; } Index: lldb/trunk/source/API/SBAddress.cpp =================================================================== --- lldb/trunk/source/API/SBAddress.cpp +++ lldb/trunk/source/API/SBAddress.cpp @@ -14,9 +14,9 @@ #include "lldb/Core/Address.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/LineEntry.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBBreakpoint.cpp =================================================================== --- lldb/trunk/source/API/SBBreakpoint.cpp +++ lldb/trunk/source/API/SBBreakpoint.cpp @@ -27,7 +27,6 @@ #include "lldb/Core/Address.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/ScriptInterpreter.h" @@ -36,6 +35,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-enumerations.h" Index: lldb/trunk/source/API/SBBreakpointLocation.cpp =================================================================== --- lldb/trunk/source/API/SBBreakpointLocation.cpp +++ lldb/trunk/source/API/SBBreakpointLocation.cpp @@ -17,13 +17,13 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/ScriptInterpreter.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" Index: lldb/trunk/source/API/SBCommandReturnObject.cpp =================================================================== --- lldb/trunk/source/API/SBCommandReturnObject.cpp +++ lldb/trunk/source/API/SBCommandReturnObject.cpp @@ -15,9 +15,9 @@ #include "lldb/API/SBError.h" #include "lldb/API/SBStream.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBData.cpp =================================================================== --- lldb/trunk/source/API/SBData.cpp +++ lldb/trunk/source/API/SBData.cpp @@ -16,7 +16,7 @@ #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBDeclaration.cpp =================================================================== --- lldb/trunk/source/API/SBDeclaration.cpp +++ lldb/trunk/source/API/SBDeclaration.cpp @@ -11,8 +11,8 @@ #include "lldb/API/SBDeclaration.h" #include "lldb/API/SBStream.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Declaration.h" +#include "lldb/Utility/Stream.h" #include Index: lldb/trunk/source/API/SBError.cpp =================================================================== --- lldb/trunk/source/API/SBError.cpp +++ lldb/trunk/source/API/SBError.cpp @@ -9,8 +9,8 @@ #include "lldb/API/SBError.h" #include "lldb/API/SBStream.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" +#include "lldb/Utility/Error.h" #include Index: lldb/trunk/source/API/SBEvent.cpp =================================================================== --- lldb/trunk/source/API/SBEvent.cpp +++ lldb/trunk/source/API/SBEvent.cpp @@ -12,12 +12,12 @@ #include "lldb/API/SBStream.h" #include "lldb/Breakpoint/Breakpoint.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Event.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBFileSpec.cpp =================================================================== --- lldb/trunk/source/API/SBFileSpec.cpp +++ lldb/trunk/source/API/SBFileSpec.cpp @@ -13,8 +13,8 @@ #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBStream.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/SmallString.h" Index: lldb/trunk/source/API/SBFileSpecList.cpp =================================================================== --- lldb/trunk/source/API/SBFileSpecList.cpp +++ lldb/trunk/source/API/SBFileSpecList.cpp @@ -14,8 +14,8 @@ #include "lldb/API/SBStream.h" #include "lldb/Core/FileSpecList.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBFrame.cpp =================================================================== --- lldb/trunk/source/API/SBFrame.cpp +++ lldb/trunk/source/API/SBFrame.cpp @@ -21,9 +21,7 @@ #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h" #include "lldb/Core/Address.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/ValueObjectRegister.h" #include "lldb/Core/ValueObjectVariable.h" @@ -42,6 +40,8 @@ #include "lldb/Target/StackID.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBDebugger.h" Index: lldb/trunk/source/API/SBInstructionList.cpp =================================================================== --- lldb/trunk/source/API/SBInstructionList.cpp +++ lldb/trunk/source/API/SBInstructionList.cpp @@ -12,8 +12,8 @@ #include "lldb/API/SBStream.h" #include "lldb/Core/Disassembler.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBLineEntry.cpp =================================================================== --- lldb/trunk/source/API/SBLineEntry.cpp +++ lldb/trunk/source/API/SBLineEntry.cpp @@ -12,8 +12,8 @@ #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBStream.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/LineEntry.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBListener.cpp =================================================================== --- lldb/trunk/source/API/SBListener.cpp +++ lldb/trunk/source/API/SBListener.cpp @@ -16,7 +16,7 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Listener.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBMemoryRegionInfo.cpp =================================================================== --- lldb/trunk/source/API/SBMemoryRegionInfo.cpp +++ lldb/trunk/source/API/SBMemoryRegionInfo.cpp @@ -11,8 +11,8 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBError.h" #include "lldb/API/SBStream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/MemoryRegionInfo.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBModule.cpp =================================================================== --- lldb/trunk/source/API/SBModule.cpp +++ lldb/trunk/source/API/SBModule.cpp @@ -17,7 +17,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectList.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Symbol/ObjectFile.h" @@ -27,6 +26,7 @@ #include "lldb/Symbol/TypeSystem.h" #include "lldb/Symbol/VariableList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBModuleSpec.cpp =================================================================== --- lldb/trunk/source/API/SBModuleSpec.cpp +++ lldb/trunk/source/API/SBModuleSpec.cpp @@ -11,9 +11,9 @@ #include "lldb/API/SBStream.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/Host.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBPlatform.cpp =================================================================== --- lldb/trunk/source/API/SBPlatform.cpp +++ lldb/trunk/source/API/SBPlatform.cpp @@ -13,11 +13,11 @@ #include "lldb/API/SBLaunchInfo.h" #include "lldb/API/SBUnixSignals.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Host/File.h" #include "lldb/Interpreter/Args.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include Index: lldb/trunk/source/API/SBProcess.cpp =================================================================== --- lldb/trunk/source/API/SBProcess.cpp +++ lldb/trunk/source/API/SBProcess.cpp @@ -20,7 +20,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Interpreter/Args.h" #include "lldb/Target/MemoryRegionInfo.h" @@ -29,6 +28,7 @@ #include "lldb/Target/SystemRuntime.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Stream.h" // Project includes Index: lldb/trunk/source/API/SBSection.cpp =================================================================== --- lldb/trunk/source/API/SBSection.cpp +++ lldb/trunk/source/API/SBSection.cpp @@ -15,8 +15,8 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBSourceManager.cpp =================================================================== --- lldb/trunk/source/API/SBSourceManager.cpp +++ lldb/trunk/source/API/SBSourceManager.cpp @@ -15,8 +15,8 @@ #include "lldb/API/SBFileSpec.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/SourceManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" +#include "lldb/Utility/Stream.h" #include "lldb/Target/Target.h" Index: lldb/trunk/source/API/SBStream.cpp =================================================================== --- lldb/trunk/source/API/SBStream.cpp +++ lldb/trunk/source/API/SBStream.cpp @@ -9,10 +9,10 @@ #include "lldb/API/SBStream.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBStructuredData.cpp =================================================================== --- lldb/trunk/source/API/SBStructuredData.cpp +++ lldb/trunk/source/API/SBStructuredData.cpp @@ -10,11 +10,11 @@ #include "lldb/API/SBStructuredData.h" #include "lldb/API/SBStream.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Event.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StructuredData.h" #include "lldb/Target/StructuredDataPlugin.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBTarget.cpp =================================================================== --- lldb/trunk/source/API/SBTarget.cpp +++ lldb/trunk/source/API/SBTarget.cpp @@ -37,7 +37,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/STLUtils.h" #include "lldb/Core/SearchFilter.h" #include "lldb/Core/Section.h" @@ -61,6 +60,7 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/TargetList.h" +#include "lldb/Utility/RegularExpression.h" #include "../source/Commands/CommandObjectBreakpoint.h" #include "lldb/Interpreter/CommandReturnObject.h" Index: lldb/trunk/source/API/SBThread.cpp =================================================================== --- lldb/trunk/source/API/SBThread.cpp +++ lldb/trunk/source/API/SBThread.cpp @@ -15,7 +15,6 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/StructuredData.h" #include "lldb/Core/ValueObject.h" @@ -34,6 +33,7 @@ #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Target/ThreadPlanStepRange.h" #include "lldb/Target/UnixSignals.h" +#include "lldb/Utility/Stream.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBDebugger.h" Index: lldb/trunk/source/API/SBThreadPlan.cpp =================================================================== --- lldb/trunk/source/API/SBThreadPlan.cpp +++ lldb/trunk/source/API/SBThreadPlan.cpp @@ -15,7 +15,6 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/StructuredData.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -34,6 +33,7 @@ #include "lldb/Target/ThreadPlanStepInstruction.h" #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Target/ThreadPlanStepRange.h" +#include "lldb/Utility/Stream.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBDebugger.h" Index: lldb/trunk/source/API/SBType.cpp =================================================================== --- lldb/trunk/source/API/SBType.cpp +++ lldb/trunk/source/API/SBType.cpp @@ -11,13 +11,13 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBTypeEnumMember.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Mangled.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Type.h" #include "lldb/Symbol/TypeSystem.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/APSInt.h" Index: lldb/trunk/source/API/SBTypeEnumMember.cpp =================================================================== --- lldb/trunk/source/API/SBTypeEnumMember.cpp +++ lldb/trunk/source/API/SBTypeEnumMember.cpp @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "lldb/API/SBType.h" +#include "lldb/API/SBTypeEnumMember.h" #include "lldb/API/SBDefines.h" #include "lldb/API/SBStream.h" -#include "lldb/API/SBTypeEnumMember.h" -#include "lldb/Core/Stream.h" +#include "lldb/API/SBType.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Type.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/API/SBValue.cpp =================================================================== --- lldb/trunk/source/API/SBValue.cpp +++ lldb/trunk/source/API/SBValue.cpp @@ -22,7 +22,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/Value.h" #include "lldb/Core/ValueObject.h" @@ -39,6 +38,7 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Stream.h" #include "lldb/API/SBDebugger.h" #include "lldb/API/SBExpressionOptions.h" Index: lldb/trunk/source/API/SBWatchpoint.cpp =================================================================== --- lldb/trunk/source/API/SBWatchpoint.cpp +++ lldb/trunk/source/API/SBWatchpoint.cpp @@ -17,10 +17,10 @@ #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Breakpoint/WatchpointList.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" Index: lldb/trunk/source/Breakpoint/Breakpoint.cpp =================================================================== --- lldb/trunk/source/Breakpoint/Breakpoint.cpp +++ lldb/trunk/source/Breakpoint/Breakpoint.cpp @@ -24,13 +24,13 @@ #include "lldb/Core/ModuleList.h" #include "lldb/Core/SearchFilter.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointID.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointID.cpp +++ lldb/trunk/source/Breakpoint/BreakpointID.cpp @@ -15,8 +15,8 @@ // Project includes #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointID.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointLocation.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointLocation.cpp +++ lldb/trunk/source/Breakpoint/BreakpointLocation.cpp @@ -17,7 +17,6 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/ExpressionVariable.h" @@ -29,6 +28,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointOptions.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointOptions.cpp +++ lldb/trunk/source/Breakpoint/BreakpointOptions.cpp @@ -14,7 +14,6 @@ #include "lldb/Breakpoint/BreakpointOptions.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Core/Value.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -22,6 +21,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/STLExtras.h" Index: lldb/trunk/source/Breakpoint/BreakpointResolver.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointResolver.cpp +++ lldb/trunk/source/Breakpoint/BreakpointResolver.cpp @@ -25,12 +25,12 @@ #include "lldb/Core/Log.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/SearchFilter.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; using namespace lldb; Index: lldb/trunk/source/Breakpoint/BreakpointResolverAddress.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointResolverAddress.cpp +++ lldb/trunk/source/Breakpoint/BreakpointResolverAddress.cpp @@ -18,9 +18,9 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp +++ lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp @@ -16,9 +16,9 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointResolverFileRegex.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointResolverFileRegex.cpp +++ lldb/trunk/source/Breakpoint/BreakpointResolverFileRegex.cpp @@ -16,9 +16,9 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Log.h" #include "lldb/Core/SourceManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp +++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp @@ -18,11 +18,11 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointSite.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointSite.cpp +++ lldb/trunk/source/Breakpoint/BreakpointSite.cpp @@ -18,7 +18,7 @@ #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSiteList.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/BreakpointSiteList.cpp =================================================================== --- lldb/trunk/source/Breakpoint/BreakpointSiteList.cpp +++ lldb/trunk/source/Breakpoint/BreakpointSiteList.cpp @@ -13,7 +13,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include using namespace lldb; Index: lldb/trunk/source/Breakpoint/Watchpoint.cpp =================================================================== --- lldb/trunk/source/Breakpoint/Watchpoint.cpp +++ lldb/trunk/source/Breakpoint/Watchpoint.cpp @@ -14,7 +14,6 @@ #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Value.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectMemory.h" @@ -23,6 +22,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Breakpoint/WatchpointOptions.cpp =================================================================== --- lldb/trunk/source/Breakpoint/WatchpointOptions.cpp +++ lldb/trunk/source/Breakpoint/WatchpointOptions.cpp @@ -14,12 +14,12 @@ #include "lldb/Breakpoint/WatchpointOptions.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Core/Value.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp @@ -18,8 +18,6 @@ #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointIDList.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -33,6 +31,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Commands/CommandObjectFrame.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectFrame.cpp +++ lldb/trunk/source/Commands/CommandObjectFrame.cpp @@ -17,7 +17,6 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/Value.h" #include "lldb/Core/ValueObject.h" @@ -47,6 +46,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Commands/CommandObjectLog.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectLog.cpp +++ lldb/trunk/source/Commands/CommandObjectLog.cpp @@ -16,8 +16,6 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/Timer.h" #include "lldb/Host/FileSpec.h" @@ -32,6 +30,8 @@ #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Commands/CommandObjectMemory.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectMemory.cpp +++ lldb/trunk/source/Commands/CommandObjectMemory.cpp @@ -22,7 +22,6 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectMemory.h" #include "lldb/DataFormatters/ValueObjectPrinter.h" #include "lldb/Host/StringConvert.h" @@ -42,6 +41,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" Index: lldb/trunk/source/Commands/CommandObjectType.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectType.cpp +++ lldb/trunk/source/Commands/CommandObjectType.cpp @@ -16,10 +16,8 @@ #include // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/IOHandler.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/State.h" #include "lldb/Core/StringList.h" #include "lldb/DataFormatters/DataVisualization.h" @@ -38,6 +36,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadList.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RegularExpression.h" // Other libraries and framework includes #include "llvm/ADT/STLExtras.h" Index: lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp +++ lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp @@ -20,7 +20,6 @@ // Project includes #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Breakpoint/WatchpointList.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Host/StringConvert.h" @@ -31,6 +30,7 @@ #include "lldb/Symbol/VariableList.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/AddressRange.cpp =================================================================== --- lldb/trunk/source/Core/AddressRange.cpp +++ lldb/trunk/source/Core/AddressRange.cpp @@ -9,9 +9,9 @@ #include "lldb/Core/AddressRange.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/AddressResolver.cpp =================================================================== --- lldb/trunk/source/Core/AddressResolver.cpp +++ lldb/trunk/source/Core/AddressResolver.cpp @@ -15,10 +15,10 @@ #include "lldb/Core/Log.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/SearchFilter.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Core/AddressResolverFileLine.cpp =================================================================== --- lldb/trunk/source/Core/AddressResolverFileLine.cpp +++ lldb/trunk/source/Core/AddressResolverFileLine.cpp @@ -11,9 +11,9 @@ // Project includes #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/AddressResolverName.cpp =================================================================== --- lldb/trunk/source/Core/AddressResolverName.cpp +++ lldb/trunk/source/Core/AddressResolverName.cpp @@ -15,10 +15,10 @@ // Project includes #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/ArchSpec.cpp =================================================================== --- lldb/trunk/source/Core/ArchSpec.cpp +++ lldb/trunk/source/Core/ArchSpec.cpp @@ -24,7 +24,6 @@ // Project includes #include "Plugins/Process/Utility/ARMDefines.h" #include "Plugins/Process/Utility/InstructionUtils.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/StringList.h" #include "lldb/Host/Endian.h" #include "lldb/Host/HostInfo.h" @@ -33,6 +32,7 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/NameMatches.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/SafeMachO.h" using namespace lldb; Index: lldb/trunk/source/Core/Baton.cpp =================================================================== --- lldb/trunk/source/Core/Baton.cpp +++ lldb/trunk/source/Core/Baton.cpp @@ -13,7 +13,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/Broadcaster.cpp =================================================================== --- lldb/trunk/source/Core/Broadcaster.cpp +++ lldb/trunk/source/Core/Broadcaster.cpp @@ -16,7 +16,7 @@ #include "lldb/Core/Event.h" #include "lldb/Core/Listener.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/CMakeLists.txt =================================================================== --- lldb/trunk/source/Core/CMakeLists.txt +++ lldb/trunk/source/Core/CMakeLists.txt @@ -9,7 +9,6 @@ Broadcaster.cpp Communication.cpp Connection.cpp - ConstString.cpp DataBufferHeap.cpp DataBufferMemoryMap.cpp DataEncoder.cpp @@ -18,7 +17,6 @@ Disassembler.cpp DynamicLoader.cpp EmulateInstruction.cpp - Error.cpp Event.cpp FastDemangle.cpp FileLineResolver.cpp @@ -36,18 +34,15 @@ Opcode.cpp PluginManager.cpp RegisterValue.cpp - RegularExpression.cpp Scalar.cpp SearchFilter.cpp Section.cpp SourceManager.cpp State.cpp - Stream.cpp StreamAsynchronousIO.cpp StreamCallback.cpp StreamFile.cpp StreamGDBRemote.cpp - StreamString.cpp StringList.cpp StructuredData.cpp Timer.cpp Index: lldb/trunk/source/Core/ConstString.cpp =================================================================== --- lldb/trunk/source/Core/ConstString.cpp +++ lldb/trunk/source/Core/ConstString.cpp @@ -1,336 +0,0 @@ -//===-- ConstString.cpp -----------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Core/ConstString.h" - -// C Includes -// C++ Includes -#include -#include - -// Other libraries and framework includes -#include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/Support/RWMutex.h" - -// Project includes -#include "lldb/Core/Stream.h" - -using namespace lldb_private; - -class Pool { -public: - typedef const char *StringPoolValueType; - typedef llvm::StringMap - StringPool; - typedef llvm::StringMapEntry StringPoolEntryType; - - static StringPoolEntryType & - GetStringMapEntryFromKeyData(const char *keyData) { - char *ptr = const_cast(keyData) - sizeof(StringPoolEntryType); - return *reinterpret_cast(ptr); - } - - size_t GetConstCStringLength(const char *ccstr) const { - if (ccstr != nullptr) { - const uint8_t h = hash(llvm::StringRef(ccstr)); - llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); - const StringPoolEntryType &entry = GetStringMapEntryFromKeyData(ccstr); - return entry.getKey().size(); - } - return 0; - } - - StringPoolValueType GetMangledCounterpart(const char *ccstr) const { - if (ccstr != nullptr) { - const uint8_t h = hash(llvm::StringRef(ccstr)); - llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); - return GetStringMapEntryFromKeyData(ccstr).getValue(); - } - return nullptr; - } - - bool SetMangledCounterparts(const char *key_ccstr, const char *value_ccstr) { - if (key_ccstr != nullptr && value_ccstr != nullptr) { - { - const uint8_t h = hash(llvm::StringRef(key_ccstr)); - llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); - GetStringMapEntryFromKeyData(key_ccstr).setValue(value_ccstr); - } - { - const uint8_t h = hash(llvm::StringRef(value_ccstr)); - llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); - GetStringMapEntryFromKeyData(value_ccstr).setValue(key_ccstr); - } - return true; - } - return false; - } - - const char *GetConstCString(const char *cstr) { - if (cstr != nullptr) - return GetConstCStringWithLength(cstr, strlen(cstr)); - return nullptr; - } - - const char *GetConstCStringWithLength(const char *cstr, size_t cstr_len) { - if (cstr != nullptr) - return GetConstCStringWithStringRef(llvm::StringRef(cstr, cstr_len)); - return nullptr; - } - - const char *GetConstCStringWithStringRef(const llvm::StringRef &string_ref) { - if (string_ref.data()) { - const uint8_t h = hash(string_ref); - - { - llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); - auto it = m_string_pools[h].m_string_map.find(string_ref); - if (it != m_string_pools[h].m_string_map.end()) - return it->getKeyData(); - } - - llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); - StringPoolEntryType &entry = - *m_string_pools[h] - .m_string_map.insert(std::make_pair(string_ref, nullptr)) - .first; - return entry.getKeyData(); - } - return nullptr; - } - - const char * - GetConstCStringAndSetMangledCounterPart(const char *demangled_cstr, - const char *mangled_ccstr) { - if (demangled_cstr != nullptr) { - const char *demangled_ccstr = nullptr; - - { - llvm::StringRef string_ref(demangled_cstr); - const uint8_t h = hash(string_ref); - llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); - - // Make string pool entry with the mangled counterpart already set - StringPoolEntryType &entry = - *m_string_pools[h] - .m_string_map.insert(std::make_pair(string_ref, mangled_ccstr)) - .first; - - // Extract the const version of the demangled_cstr - demangled_ccstr = entry.getKeyData(); - } - - { - // Now assign the demangled const string as the counterpart of the - // mangled const string... - const uint8_t h = hash(llvm::StringRef(mangled_ccstr)); - llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); - GetStringMapEntryFromKeyData(mangled_ccstr).setValue(demangled_ccstr); - } - - // Return the constant demangled C string - return demangled_ccstr; - } - return nullptr; - } - - const char *GetConstTrimmedCStringWithLength(const char *cstr, - size_t cstr_len) { - if (cstr != nullptr) { - const size_t trimmed_len = std::min(strlen(cstr), cstr_len); - return GetConstCStringWithLength(cstr, trimmed_len); - } - return nullptr; - } - - //------------------------------------------------------------------ - // Return the size in bytes that this object and any items in its - // collection of uniqued strings + data count values takes in - // memory. - //------------------------------------------------------------------ - size_t MemorySize() const { - size_t mem_size = sizeof(Pool); - for (const auto &pool : m_string_pools) { - llvm::sys::SmartScopedReader rlock(pool.m_mutex); - for (const auto &entry : pool.m_string_map) - mem_size += sizeof(StringPoolEntryType) + entry.getKey().size(); - } - return mem_size; - } - -protected: - uint8_t hash(const llvm::StringRef &s) const { - uint32_t h = llvm::HashString(s); - return ((h >> 24) ^ (h >> 16) ^ (h >> 8) ^ h) & 0xff; - } - - struct PoolEntry { - mutable llvm::sys::SmartRWMutex m_mutex; - StringPool m_string_map; - }; - - std::array m_string_pools; -}; - -//---------------------------------------------------------------------- -// Frameworks and dylibs aren't supposed to have global C++ -// initializers so we hide the string pool in a static function so -// that it will get initialized on the first call to this static -// function. -// -// Note, for now we make the string pool a pointer to the pool, because -// we can't guarantee that some objects won't get destroyed after the -// global destructor chain is run, and trying to make sure no destructors -// touch ConstStrings is difficult. So we leak the pool instead. -//---------------------------------------------------------------------- -static Pool &StringPool() { - static std::once_flag g_pool_initialization_flag; - static Pool *g_string_pool = nullptr; - - std::call_once(g_pool_initialization_flag, - []() { g_string_pool = new Pool(); }); - - return *g_string_pool; -} - -ConstString::ConstString(const char *cstr) - : m_string(StringPool().GetConstCString(cstr)) {} - -ConstString::ConstString(const char *cstr, size_t cstr_len) - : m_string(StringPool().GetConstCStringWithLength(cstr, cstr_len)) {} - -ConstString::ConstString(const llvm::StringRef &s) - : m_string(StringPool().GetConstCStringWithLength(s.data(), s.size())) {} - -bool ConstString::operator<(const ConstString &rhs) const { - if (m_string == rhs.m_string) - return false; - - llvm::StringRef lhs_string_ref(m_string, - StringPool().GetConstCStringLength(m_string)); - llvm::StringRef rhs_string_ref( - rhs.m_string, StringPool().GetConstCStringLength(rhs.m_string)); - - // If both have valid C strings, then return the comparison - if (lhs_string_ref.data() && rhs_string_ref.data()) - return lhs_string_ref < rhs_string_ref; - - // Else one of them was nullptr, so if LHS is nullptr then it is less than - return lhs_string_ref.data() == nullptr; -} - -Stream &lldb_private::operator<<(Stream &s, const ConstString &str) { - const char *cstr = str.GetCString(); - if (cstr != nullptr) - s << cstr; - - return s; -} - -size_t ConstString::GetLength() const { - return StringPool().GetConstCStringLength(m_string); -} - -bool ConstString::Equals(const ConstString &lhs, const ConstString &rhs, - const bool case_sensitive) { - if (lhs.m_string == rhs.m_string) - return true; - - // Since the pointers weren't equal, and identical ConstStrings always have - // identical pointers, - // the result must be false for case sensitive equality test. - if (case_sensitive) - return false; - - // perform case insensitive equality test - llvm::StringRef lhs_string_ref( - lhs.m_string, StringPool().GetConstCStringLength(lhs.m_string)); - llvm::StringRef rhs_string_ref( - rhs.m_string, StringPool().GetConstCStringLength(rhs.m_string)); - return lhs_string_ref.equals_lower(rhs_string_ref); -} - -int ConstString::Compare(const ConstString &lhs, const ConstString &rhs, - const bool case_sensitive) { - // If the iterators are the same, this is the same string - const char *lhs_cstr = lhs.m_string; - const char *rhs_cstr = rhs.m_string; - if (lhs_cstr == rhs_cstr) - return 0; - if (lhs_cstr && rhs_cstr) { - llvm::StringRef lhs_string_ref( - lhs_cstr, StringPool().GetConstCStringLength(lhs_cstr)); - llvm::StringRef rhs_string_ref( - rhs_cstr, StringPool().GetConstCStringLength(rhs_cstr)); - - if (case_sensitive) { - return lhs_string_ref.compare(rhs_string_ref); - } else { - return lhs_string_ref.compare_lower(rhs_string_ref); - } - } - - if (lhs_cstr) - return +1; // LHS isn't nullptr but RHS is - else - return -1; // LHS is nullptr but RHS isn't -} - -void ConstString::Dump(Stream *s, const char *fail_value) const { - if (s != nullptr) { - const char *cstr = AsCString(fail_value); - if (cstr != nullptr) - s->PutCString(cstr); - } -} - -void ConstString::DumpDebug(Stream *s) const { - const char *cstr = GetCString(); - size_t cstr_len = GetLength(); - // Only print the parens if we have a non-nullptr string - const char *parens = cstr ? "\"" : ""; - s->Printf("%*p: ConstString, string = %s%s%s, length = %" PRIu64, - static_cast(sizeof(void *) * 2), - static_cast(this), parens, cstr, parens, - static_cast(cstr_len)); -} - -void ConstString::SetCString(const char *cstr) { - m_string = StringPool().GetConstCString(cstr); -} - -void ConstString::SetString(const llvm::StringRef &s) { - m_string = StringPool().GetConstCStringWithLength(s.data(), s.size()); -} - -void ConstString::SetCStringWithMangledCounterpart(const char *demangled, - const ConstString &mangled) { - m_string = StringPool().GetConstCStringAndSetMangledCounterPart( - demangled, mangled.m_string); -} - -bool ConstString::GetMangledCounterpart(ConstString &counterpart) const { - counterpart.m_string = StringPool().GetMangledCounterpart(m_string); - return (bool)counterpart; -} - -void ConstString::SetCStringWithLength(const char *cstr, size_t cstr_len) { - m_string = StringPool().GetConstCStringWithLength(cstr, cstr_len); -} - -void ConstString::SetTrimmedCStringWithLength(const char *cstr, - size_t cstr_len) { - m_string = StringPool().GetConstTrimmedCStringWithLength(cstr, cstr_len); -} - -size_t ConstString::StaticMemorySize() { - // Get the size of the static string pool - return StringPool().MemorySize(); -} Index: lldb/trunk/source/Core/DataBufferMemoryMap.cpp =================================================================== --- lldb/trunk/source/Core/DataBufferMemoryMap.cpp +++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp @@ -46,11 +46,11 @@ // Project includes #include "lldb/Core/DataBufferMemoryMap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Host/File.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/DataExtractor.cpp =================================================================== --- lldb/trunk/source/Core/DataExtractor.cpp +++ lldb/trunk/source/Core/DataExtractor.cpp @@ -32,8 +32,6 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Disassembler.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/UUID.h" #include "lldb/Core/dwarf.h" #include "lldb/Host/Endian.h" @@ -42,6 +40,8 @@ #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/Debugger.cpp =================================================================== --- lldb/trunk/source/Core/Debugger.cpp +++ lldb/trunk/source/Core/Debugger.cpp @@ -28,7 +28,6 @@ #include "lldb/Core/StreamAsynchronousIO.h" #include "lldb/Core/StreamCallback.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StructuredData.h" #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObject.h" @@ -59,6 +58,7 @@ #include "lldb/Target/TargetList.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/AnsiTerminal.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" using namespace lldb; Index: lldb/trunk/source/Core/Disassembler.cpp =================================================================== --- lldb/trunk/source/Core/Disassembler.cpp +++ lldb/trunk/source/Core/Disassembler.cpp @@ -20,10 +20,8 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Timer.h" #include "lldb/Host/FileSystem.h" #include "lldb/Interpreter/OptionValue.h" @@ -39,6 +37,8 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/lldb-private.h" #define DEFAULT_DISASM_BYTE_SIZE 32 Index: lldb/trunk/source/Core/EmulateInstruction.cpp =================================================================== --- lldb/trunk/source/Core/EmulateInstruction.cpp +++ lldb/trunk/source/Core/EmulateInstruction.cpp @@ -17,17 +17,17 @@ // Project includes #include "lldb/Core/Address.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Endian.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/Error.cpp =================================================================== --- lldb/trunk/source/Core/Error.cpp +++ lldb/trunk/source/Core/Error.cpp @@ -1,336 +0,0 @@ -//===-- Error.cpp -----------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// C Includes -#ifdef __APPLE__ -#include -#endif - -// C++ Includes -#include -#include - -// Other libraries and framework includes -#include "llvm/ADT/SmallVector.h" - -// Project includes -#include "lldb/Core/Error.h" -#include "lldb/Core/Log.h" -#include "lldb/Host/PosixApi.h" - -using namespace lldb; -using namespace lldb_private; - -Error::Error() : m_code(0), m_type(eErrorTypeInvalid), m_string() {} - -Error::Error(ValueType err, ErrorType type) - : m_code(err), m_type(type), m_string() {} - -Error::Error(const Error &rhs) = default; - -Error::Error(const char *format, ...) - : m_code(0), m_type(eErrorTypeInvalid), m_string() { - va_list args; - va_start(args, format); - SetErrorToGenericError(); - SetErrorStringWithVarArg(format, args); - va_end(args); -} - -//---------------------------------------------------------------------- -// Assignment operator -//---------------------------------------------------------------------- -const Error &Error::operator=(const Error &rhs) { - if (this != &rhs) { - m_code = rhs.m_code; - m_type = rhs.m_type; - m_string = rhs.m_string; - } - return *this; -} - -//---------------------------------------------------------------------- -// Assignment operator -//---------------------------------------------------------------------- -const Error &Error::operator=(uint32_t err) { - m_code = err; - m_type = eErrorTypeMachKernel; - m_string.clear(); - return *this; -} - -Error::~Error() = default; - -//---------------------------------------------------------------------- -// Get the error value as a NULL C string. The error string will be -// fetched and cached on demand. The cached error string value will -// remain until the error value is changed or cleared. -//---------------------------------------------------------------------- -const char *Error::AsCString(const char *default_error_str) const { - if (Success()) - return nullptr; - - if (m_string.empty()) { - const char *s = nullptr; - switch (m_type) { - case eErrorTypeMachKernel: -#if defined(__APPLE__) - s = ::mach_error_string(m_code); -#endif - break; - - case eErrorTypePOSIX: - s = ::strerror(m_code); - break; - - default: - break; - } - if (s != nullptr) - m_string.assign(s); - } - if (m_string.empty()) { - if (default_error_str) - m_string.assign(default_error_str); - else - return nullptr; // User wanted a nullptr string back... - } - return m_string.c_str(); -} - -//---------------------------------------------------------------------- -// Clear the error and any cached error string that it might contain. -//---------------------------------------------------------------------- -void Error::Clear() { - m_code = 0; - m_type = eErrorTypeInvalid; - m_string.clear(); -} - -//---------------------------------------------------------------------- -// Access the error value. -//---------------------------------------------------------------------- -Error::ValueType Error::GetError() const { return m_code; } - -//---------------------------------------------------------------------- -// Access the error type. -//---------------------------------------------------------------------- -ErrorType Error::GetType() const { return m_type; } - -//---------------------------------------------------------------------- -// Returns true if this object contains a value that describes an -// error or otherwise non-success result. -//---------------------------------------------------------------------- -bool Error::Fail() const { return m_code != 0; } - -//---------------------------------------------------------------------- -// Log the error given a string with format. If the this object -// contains an error code, update the error string to contain the -// "error: " followed by the formatted string, followed by the error -// value and any string that describes the current error. This -// allows more context to be given to an error string that remains -// cached in this object. Logging always occurs even when the error -// code contains a non-error value. -//---------------------------------------------------------------------- -void Error::PutToLog(Log *log, const char *format, ...) { - char *arg_msg = nullptr; - va_list args; - va_start(args, format); - ::vasprintf(&arg_msg, format, args); - va_end(args); - - if (arg_msg != nullptr) { - if (Fail()) { - const char *err_str = AsCString(); - if (err_str == nullptr) - err_str = "???"; - - SetErrorStringWithFormat("error: %s err = %s (0x%8.8x)", arg_msg, err_str, - m_code); - if (log != nullptr) - log->Error("%s", m_string.c_str()); - } else { - if (log != nullptr) - log->Printf("%s err = 0x%8.8x", arg_msg, m_code); - } - ::free(arg_msg); - } -} - -//---------------------------------------------------------------------- -// Log the error given a string with format. If the this object -// contains an error code, update the error string to contain the -// "error: " followed by the formatted string, followed by the error -// value and any string that describes the current error. This -// allows more context to be given to an error string that remains -// cached in this object. Logging only occurs even when the error -// code contains a error value. -//---------------------------------------------------------------------- -void Error::LogIfError(Log *log, const char *format, ...) { - if (Fail()) { - char *arg_msg = nullptr; - va_list args; - va_start(args, format); - ::vasprintf(&arg_msg, format, args); - va_end(args); - - if (arg_msg != nullptr) { - const char *err_str = AsCString(); - if (err_str == nullptr) - err_str = "???"; - - SetErrorStringWithFormat("%s err = %s (0x%8.8x)", arg_msg, err_str, - m_code); - if (log != nullptr) - log->Error("%s", m_string.c_str()); - - ::free(arg_msg); - } - } -} - -//---------------------------------------------------------------------- -// Set accesssor for the error value to "err" and the type to -// "eErrorTypeMachKernel" -//---------------------------------------------------------------------- -void Error::SetMachError(uint32_t err) { - m_code = err; - m_type = eErrorTypeMachKernel; - m_string.clear(); -} - -void Error::SetExpressionError(lldb::ExpressionResults result, - const char *mssg) { - m_code = result; - m_type = eErrorTypeExpression; - m_string = mssg; -} - -int Error::SetExpressionErrorWithFormat(lldb::ExpressionResults result, - const char *format, ...) { - int length = 0; - - if (format != nullptr && format[0]) { - va_list args; - va_start(args, format); - length = SetErrorStringWithVarArg(format, args); - va_end(args); - } else { - m_string.clear(); - } - m_code = result; - m_type = eErrorTypeExpression; - return length; -} - -//---------------------------------------------------------------------- -// Set accesssor for the error value and type. -//---------------------------------------------------------------------- -void Error::SetError(ValueType err, ErrorType type) { - m_code = err; - m_type = type; - m_string.clear(); -} - -//---------------------------------------------------------------------- -// Update the error value to be "errno" and update the type to -// be "POSIX". -//---------------------------------------------------------------------- -void Error::SetErrorToErrno() { - m_code = errno; - m_type = eErrorTypePOSIX; - m_string.clear(); -} - -//---------------------------------------------------------------------- -// Update the error value to be LLDB_GENERIC_ERROR and update the type -// to be "Generic". -//---------------------------------------------------------------------- -void Error::SetErrorToGenericError() { - m_code = LLDB_GENERIC_ERROR; - m_type = eErrorTypeGeneric; - m_string.clear(); -} - -//---------------------------------------------------------------------- -// Set accessor for the error string value for a specific error. -// This allows any string to be supplied as an error explanation. -// The error string value will remain until the error value is -// cleared or a new error value/type is assigned. -//---------------------------------------------------------------------- -void Error::SetErrorString(llvm::StringRef err_str) { - if (!err_str.empty()) { - // If we have an error string, we should always at least have an error - // set to a generic value. - if (Success()) - SetErrorToGenericError(); - } - m_string = err_str; -} - -//------------------------------------------------------------------ -/// Set the current error string to a formatted error string. -/// -/// @param format -/// A printf style format string -//------------------------------------------------------------------ -int Error::SetErrorStringWithFormat(const char *format, ...) { - if (format != nullptr && format[0]) { - va_list args; - va_start(args, format); - int length = SetErrorStringWithVarArg(format, args); - va_end(args); - return length; - } else { - m_string.clear(); - } - return 0; -} - -int Error::SetErrorStringWithVarArg(const char *format, va_list args) { - if (format != nullptr && format[0]) { - // If we have an error string, we should always at least have - // an error set to a generic value. - if (Success()) - SetErrorToGenericError(); - - // Try and fit our error into a 1024 byte buffer first... - llvm::SmallVector buf; - buf.resize(1024); - // Copy in case our first call to vsnprintf doesn't fit into our - // allocated buffer above - va_list copy_args; - va_copy(copy_args, args); - unsigned length = ::vsnprintf(buf.data(), buf.size(), format, args); - if (length >= buf.size()) { - // The error formatted string didn't fit into our buffer, resize it - // to the exact needed size, and retry - buf.resize(length + 1); - length = ::vsnprintf(buf.data(), buf.size(), format, copy_args); - va_end(copy_args); - assert(length < buf.size()); - } - m_string.assign(buf.data(), length); - va_end(args); - return length; - } else { - m_string.clear(); - } - return 0; -} - -//---------------------------------------------------------------------- -// Returns true if the error code in this object is considered a -// successful return value. -//---------------------------------------------------------------------- -bool Error::Success() const { return m_code == 0; } - -bool Error::WasInterrupted() const { - return (m_type == eErrorTypePOSIX && m_code == EINTR); -} Index: lldb/trunk/source/Core/Event.cpp =================================================================== --- lldb/trunk/source/Core/Event.cpp +++ lldb/trunk/source/Core/Event.cpp @@ -18,9 +18,9 @@ #include "lldb/Core/Event.h" #include "lldb/Core/Log.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/Endian.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/FileLineResolver.cpp =================================================================== --- lldb/trunk/source/Core/FileLineResolver.cpp +++ lldb/trunk/source/Core/FileLineResolver.cpp @@ -11,9 +11,9 @@ // Project includes #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/LineTable.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/FileSpecList.cpp =================================================================== --- lldb/trunk/source/Core/FileSpecList.cpp +++ lldb/trunk/source/Core/FileSpecList.cpp @@ -15,7 +15,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; using namespace std; Index: lldb/trunk/source/Core/FormatEntity.cpp =================================================================== --- lldb/trunk/source/Core/FormatEntity.cpp +++ lldb/trunk/source/Core/FormatEntity.cpp @@ -19,8 +19,6 @@ #include "lldb/Core/Address.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/DataFormatters/DataVisualization.h" @@ -45,6 +43,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/AnsiTerminal.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/History.cpp =================================================================== --- lldb/trunk/source/Core/History.cpp +++ lldb/trunk/source/Core/History.cpp @@ -14,7 +14,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/Listener.cpp =================================================================== --- lldb/trunk/source/Core/Listener.cpp +++ lldb/trunk/source/Core/Listener.cpp @@ -18,7 +18,7 @@ #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Event.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/Log.cpp =================================================================== --- lldb/trunk/source/Core/Log.cpp +++ lldb/trunk/source/Core/Log.cpp @@ -11,11 +11,11 @@ #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Host.h" #include "lldb/Host/ThisThread.h" #include "lldb/Interpreter/Args.h" #include "lldb/Utility/NameMatches.h" +#include "lldb/Utility/StreamString.h" // Other libraries and framework includes #include "llvm/ADT/SmallString.h" Index: lldb/trunk/source/Core/Mangled.cpp =================================================================== --- lldb/trunk/source/Core/Mangled.cpp +++ lldb/trunk/source/Core/Mangled.cpp @@ -28,13 +28,13 @@ #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" #include "Plugins/Language/ObjC/ObjCLanguage.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Logging.h" #include "lldb/Core/Mangled.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" #include #include #include Index: lldb/trunk/source/Core/Module.cpp =================================================================== --- lldb/trunk/source/Core/Module.cpp +++ lldb/trunk/source/Core/Module.cpp @@ -21,14 +21,11 @@ #include "lldb/Core/AddressResolverFileLine.h" #include "lldb/Core/DataBuffer.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" @@ -46,6 +43,9 @@ #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/StreamString.h" #include "Plugins/ObjectFile/JIT/ObjectFileJIT.h" Index: lldb/trunk/source/Core/Opcode.cpp =================================================================== --- lldb/trunk/source/Core/Opcode.cpp +++ lldb/trunk/source/Core/Opcode.cpp @@ -18,8 +18,8 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/Endian.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/PluginManager.cpp =================================================================== --- lldb/trunk/source/Core/PluginManager.cpp +++ lldb/trunk/source/Core/PluginManager.cpp @@ -22,11 +22,11 @@ // Project includes #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Interpreter/OptionValueProperties.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/RegisterValue.cpp =================================================================== --- lldb/trunk/source/Core/RegisterValue.cpp +++ lldb/trunk/source/Core/RegisterValue.cpp @@ -19,12 +19,12 @@ // Project includes #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/RegularExpression.cpp =================================================================== --- lldb/trunk/source/Core/RegularExpression.cpp +++ lldb/trunk/source/Core/RegularExpression.cpp @@ -1,208 +0,0 @@ -//===-- RegularExpression.cpp -----------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Core/RegularExpression.h" - -// C Includes -// C++ Includes -#include - -// Other libraries and framework includes -#include "llvm/ADT/StringRef.h" - -// Project includes -#include "lldb/Core/Error.h" - -//---------------------------------------------------------------------- -// Enable enhanced mode if it is available. This allows for things like -// \d for digit, \s for space, and many more, but it isn't available -// everywhere. -//---------------------------------------------------------------------- -#if defined(REG_ENHANCED) -#define DEFAULT_COMPILE_FLAGS (REG_ENHANCED | REG_EXTENDED) -#else -#define DEFAULT_COMPILE_FLAGS (REG_EXTENDED) -#endif - -using namespace lldb_private; - -RegularExpression::RegularExpression() : m_re(), m_comp_err(1), m_preg() { - memset(&m_preg, 0, sizeof(m_preg)); -} - -//---------------------------------------------------------------------- -// Constructor that compiles "re" using "flags" and stores the -// resulting compiled regular expression into this object. -//---------------------------------------------------------------------- -RegularExpression::RegularExpression(llvm::StringRef str) - : m_re(), m_comp_err(1), m_preg() { - memset(&m_preg, 0, sizeof(m_preg)); - Compile(str); -} - -RegularExpression::RegularExpression(const RegularExpression &rhs) { - memset(&m_preg, 0, sizeof(m_preg)); - Compile(rhs.GetText()); -} - -const RegularExpression &RegularExpression:: -operator=(const RegularExpression &rhs) { - if (&rhs != this) - Compile(rhs.GetText()); - return *this; -} - -//---------------------------------------------------------------------- -// Destructor -// -// Any previously compiled regular expression contained in this -// object will be freed. -//---------------------------------------------------------------------- -RegularExpression::~RegularExpression() { Free(); } - -//---------------------------------------------------------------------- -// Compile a regular expression using the supplied regular -// expression text and flags. The compiled regular expression lives -// in this object so that it can be readily used for regular -// expression matches. Execute() can be called after the regular -// expression is compiled. Any previously compiled regular -// expression contained in this object will be freed. -// -// RETURNS -// True if the regular expression compiles successfully, false -// otherwise. -//---------------------------------------------------------------------- -bool RegularExpression::Compile(llvm::StringRef str) { - Free(); - - if (!str.empty()) { - m_re = str; - m_comp_err = ::regcomp(&m_preg, m_re.c_str(), DEFAULT_COMPILE_FLAGS); - } else { - // No valid regular expression - m_comp_err = 1; - } - - return m_comp_err == 0; -} - -//---------------------------------------------------------------------- -// Execute a regular expression match using the compiled regular -// expression that is already in this object against the match -// string "s". If any parens are used for regular expression -// matches "match_count" should indicate the number of regmatch_t -// values that are present in "match_ptr". The regular expression -// will be executed using the "execute_flags". -//--------------------------------------------------------------------- -bool RegularExpression::Execute(llvm::StringRef str, Match *match) const { - int err = 1; - if (m_comp_err == 0) { - // Argument to regexec must be null-terminated. - std::string reg_str = str; - if (match) { - err = ::regexec(&m_preg, reg_str.c_str(), match->GetSize(), - match->GetData(), 0); - } else { - err = ::regexec(&m_preg, reg_str.c_str(), 0, nullptr, 0); - } - } - - if (err != 0) { - // The regular expression didn't compile, so clear the matches - if (match) - match->Clear(); - return false; - } - return true; -} - -bool RegularExpression::Match::GetMatchAtIndex(llvm::StringRef s, uint32_t idx, - std::string &match_str) const { - llvm::StringRef match_str_ref; - if (GetMatchAtIndex(s, idx, match_str_ref)) { - match_str = match_str_ref.str(); - return true; - } - return false; -} - -bool RegularExpression::Match::GetMatchAtIndex( - llvm::StringRef s, uint32_t idx, llvm::StringRef &match_str) const { - if (idx < m_matches.size()) { - if (m_matches[idx].rm_eo == -1 && m_matches[idx].rm_so == -1) - return false; - - if (m_matches[idx].rm_eo == m_matches[idx].rm_so) { - // Matched the empty string... - match_str = llvm::StringRef(); - return true; - } else if (m_matches[idx].rm_eo > m_matches[idx].rm_so) { - match_str = s.substr(m_matches[idx].rm_so, - m_matches[idx].rm_eo - m_matches[idx].rm_so); - return true; - } - } - return false; -} - -bool RegularExpression::Match::GetMatchSpanningIndices( - llvm::StringRef s, uint32_t idx1, uint32_t idx2, - llvm::StringRef &match_str) const { - if (idx1 < m_matches.size() && idx2 < m_matches.size()) { - if (m_matches[idx1].rm_so == m_matches[idx2].rm_eo) { - // Matched the empty string... - match_str = llvm::StringRef(); - return true; - } else if (m_matches[idx1].rm_so < m_matches[idx2].rm_eo) { - match_str = s.substr(m_matches[idx1].rm_so, - m_matches[idx2].rm_eo - m_matches[idx1].rm_so); - return true; - } - } - return false; -} - -//---------------------------------------------------------------------- -// Returns true if the regular expression compiled and is ready -// for execution. -//---------------------------------------------------------------------- -bool RegularExpression::IsValid() const { return m_comp_err == 0; } - -//---------------------------------------------------------------------- -// Returns the text that was used to compile the current regular -// expression. -//---------------------------------------------------------------------- -llvm::StringRef RegularExpression::GetText() const { return m_re; } - -//---------------------------------------------------------------------- -// Free any contained compiled regular expressions. -//---------------------------------------------------------------------- -void RegularExpression::Free() { - if (m_comp_err == 0) { - m_re.clear(); - regfree(&m_preg); - // Set a compile error since we no longer have a valid regex - m_comp_err = 1; - } -} - -size_t RegularExpression::GetErrorAsCString(char *err_str, - size_t err_str_max_len) const { - if (m_comp_err == 0) { - if (err_str && err_str_max_len) - *err_str = '\0'; - return 0; - } - - return ::regerror(m_comp_err, &m_preg, err_str, err_str_max_len); -} - -bool RegularExpression::operator<(const RegularExpression &rhs) const { - return (m_re < rhs.m_re); -} Index: lldb/trunk/source/Core/Scalar.cpp =================================================================== --- lldb/trunk/source/Core/Scalar.cpp +++ lldb/trunk/source/Core/Scalar.cpp @@ -20,11 +20,11 @@ // Project includes #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/Endian.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" #include "Plugins/Process/Utility/InstructionUtils.h" Index: lldb/trunk/source/Core/SourceManager.cpp =================================================================== --- lldb/trunk/source/Core/SourceManager.cpp +++ lldb/trunk/source/Core/SourceManager.cpp @@ -16,14 +16,14 @@ #include "lldb/Core/DataBuffer.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/FileSystem.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Target.h" #include "lldb/Utility/AnsiTerminal.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/Stream.cpp =================================================================== --- lldb/trunk/source/Core/Stream.cpp +++ lldb/trunk/source/Core/Stream.cpp @@ -1,612 +0,0 @@ -//===-- Stream.cpp ----------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Core/Stream.h" -#include "lldb/Host/Endian.h" -#include "lldb/Host/PosixApi.h" -#include -#include -#include -#include - -#include - -using namespace lldb; -using namespace lldb_private; - -Stream::Stream(uint32_t flags, uint32_t addr_size, ByteOrder byte_order) - : m_flags(flags), m_addr_size(addr_size), m_byte_order(byte_order), - m_indent_level(0) {} - -Stream::Stream() - : m_flags(0), m_addr_size(4), m_byte_order(endian::InlHostByteOrder()), - m_indent_level(0) {} - -//------------------------------------------------------------------ -// Destructor -//------------------------------------------------------------------ -Stream::~Stream() {} - -ByteOrder Stream::SetByteOrder(ByteOrder byte_order) { - ByteOrder old_byte_order = m_byte_order; - m_byte_order = byte_order; - return old_byte_order; -} - -//------------------------------------------------------------------ -// Put an offset "uval" out to the stream using the printf format -// in "format". -//------------------------------------------------------------------ -void Stream::Offset(uint32_t uval, const char *format) { Printf(format, uval); } - -//------------------------------------------------------------------ -// Put an SLEB128 "uval" out to the stream using the printf format -// in "format". -//------------------------------------------------------------------ -size_t Stream::PutSLEB128(int64_t sval) { - size_t bytes_written = 0; - if (m_flags.Test(eBinary)) { - bool more = true; - while (more) { - uint8_t byte = sval & 0x7fu; - sval >>= 7; - /* sign bit of byte is 2nd high order bit (0x40) */ - if ((sval == 0 && !(byte & 0x40)) || (sval == -1 && (byte & 0x40))) - more = false; - else - // more bytes to come - byte |= 0x80u; - bytes_written += Write(&byte, 1); - } - } else { - bytes_written = Printf("0x%" PRIi64, sval); - } - - return bytes_written; -} - -//------------------------------------------------------------------ -// Put an ULEB128 "uval" out to the stream using the printf format -// in "format". -//------------------------------------------------------------------ -size_t Stream::PutULEB128(uint64_t uval) { - size_t bytes_written = 0; - if (m_flags.Test(eBinary)) { - do { - - uint8_t byte = uval & 0x7fu; - uval >>= 7; - if (uval != 0) { - // more bytes to come - byte |= 0x80u; - } - bytes_written += Write(&byte, 1); - } while (uval != 0); - } else { - bytes_written = Printf("0x%" PRIx64, uval); - } - return bytes_written; -} - -//------------------------------------------------------------------ -// Print a raw NULL terminated C string to the stream. -//------------------------------------------------------------------ -size_t Stream::PutCString(llvm::StringRef str) { - size_t bytes_written = 0; - bytes_written = Write(str.data(), str.size()); - - // when in binary mode, emit the NULL terminator - if (m_flags.Test(eBinary)) - bytes_written += PutChar('\0'); - return bytes_written; -} - -//------------------------------------------------------------------ -// Print a double quoted NULL terminated C string to the stream -// using the printf format in "format". -//------------------------------------------------------------------ -void Stream::QuotedCString(const char *cstr, const char *format) { - Printf(format, cstr); -} - -//------------------------------------------------------------------ -// Put an address "addr" out to the stream with optional prefix -// and suffix strings. -//------------------------------------------------------------------ -void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix, - const char *suffix) { - if (prefix == NULL) - prefix = ""; - if (suffix == NULL) - suffix = ""; - // int addr_width = m_addr_size << 1; - // Printf ("%s0x%0*" PRIx64 "%s", prefix, addr_width, addr, suffix); - Printf("%s0x%0*" PRIx64 "%s", prefix, addr_size * 2, (uint64_t)addr, suffix); -} - -//------------------------------------------------------------------ -// Put an address range out to the stream with optional prefix -// and suffix strings. -//------------------------------------------------------------------ -void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, - uint32_t addr_size, const char *prefix, - const char *suffix) { - if (prefix && prefix[0]) - PutCString(prefix); - Address(lo_addr, addr_size, "["); - Address(hi_addr, addr_size, "-", ")"); - if (suffix && suffix[0]) - PutCString(suffix); -} - -size_t Stream::PutChar(char ch) { return Write(&ch, 1); } - -//------------------------------------------------------------------ -// Print some formatted output to the stream. -//------------------------------------------------------------------ -size_t Stream::Printf(const char *format, ...) { - va_list args; - va_start(args, format); - size_t result = PrintfVarArg(format, args); - va_end(args); - return result; -} - -//------------------------------------------------------------------ -// Print some formatted output to the stream. -//------------------------------------------------------------------ -size_t Stream::PrintfVarArg(const char *format, va_list args) { - char str[1024]; - va_list args_copy; - - va_copy(args_copy, args); - - size_t bytes_written = 0; - // Try and format our string into a fixed buffer first and see if it fits - size_t length = ::vsnprintf(str, sizeof(str), format, args); - if (length < sizeof(str)) { - // Include the NULL termination byte for binary output - if (m_flags.Test(eBinary)) - length += 1; - // The formatted string fit into our stack based buffer, so we can just - // append that to our packet - bytes_written = Write(str, length); - } else { - // Our stack buffer wasn't big enough to contain the entire formatted - // string, so lets let vasprintf create the string for us! - char *str_ptr = NULL; - length = ::vasprintf(&str_ptr, format, args_copy); - if (str_ptr) { - // Include the NULL termination byte for binary output - if (m_flags.Test(eBinary)) - length += 1; - bytes_written = Write(str_ptr, length); - ::free(str_ptr); - } - } - va_end(args_copy); - return bytes_written; -} - -//------------------------------------------------------------------ -// Print and End of Line character to the stream -//------------------------------------------------------------------ -size_t Stream::EOL() { return PutChar('\n'); } - -//------------------------------------------------------------------ -// Indent the current line using the current indentation level and -// print an optional string following the indentation spaces. -//------------------------------------------------------------------ -size_t Stream::Indent(const char *s) { - return Printf("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : ""); -} - -size_t Stream::Indent(llvm::StringRef str) { - return Printf("%*.*s%s", m_indent_level, m_indent_level, "", str.str().c_str()); -} - -//------------------------------------------------------------------ -// Stream a character "ch" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(char ch) { - PutChar(ch); - return *this; -} - -//------------------------------------------------------------------ -// Stream the NULL terminated C string out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(const char *s) { - Printf("%s", s); - return *this; -} - -Stream &Stream::operator<<(llvm::StringRef str) { - Write(str.data(), str.size()); - return *this; -} - -//------------------------------------------------------------------ -// Stream the pointer value out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(const void *p) { - Printf("0x%.*tx", (int)sizeof(const void *) * 2, (ptrdiff_t)p); - return *this; -} - -//------------------------------------------------------------------ -// Stream a uint8_t "uval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(uint8_t uval) { - PutHex8(uval); - return *this; -} - -//------------------------------------------------------------------ -// Stream a uint16_t "uval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(uint16_t uval) { - PutHex16(uval, m_byte_order); - return *this; -} - -//------------------------------------------------------------------ -// Stream a uint32_t "uval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(uint32_t uval) { - PutHex32(uval, m_byte_order); - return *this; -} - -//------------------------------------------------------------------ -// Stream a uint64_t "uval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(uint64_t uval) { - PutHex64(uval, m_byte_order); - return *this; -} - -//------------------------------------------------------------------ -// Stream a int8_t "sval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(int8_t sval) { - Printf("%i", (int)sval); - return *this; -} - -//------------------------------------------------------------------ -// Stream a int16_t "sval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(int16_t sval) { - Printf("%i", (int)sval); - return *this; -} - -//------------------------------------------------------------------ -// Stream a int32_t "sval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(int32_t sval) { - Printf("%i", (int)sval); - return *this; -} - -//------------------------------------------------------------------ -// Stream a int64_t "sval" out to this stream. -//------------------------------------------------------------------ -Stream &Stream::operator<<(int64_t sval) { - Printf("%" PRIi64, sval); - return *this; -} - -//------------------------------------------------------------------ -// Get the current indentation level -//------------------------------------------------------------------ -int Stream::GetIndentLevel() const { return m_indent_level; } - -//------------------------------------------------------------------ -// Set the current indentation level -//------------------------------------------------------------------ -void Stream::SetIndentLevel(int indent_level) { m_indent_level = indent_level; } - -//------------------------------------------------------------------ -// Increment the current indentation level -//------------------------------------------------------------------ -void Stream::IndentMore(int amount) { m_indent_level += amount; } - -//------------------------------------------------------------------ -// Decrement the current indentation level -//------------------------------------------------------------------ -void Stream::IndentLess(int amount) { - if (m_indent_level >= amount) - m_indent_level -= amount; - else - m_indent_level = 0; -} - -//------------------------------------------------------------------ -// Get the address size in bytes -//------------------------------------------------------------------ -uint32_t Stream::GetAddressByteSize() const { return m_addr_size; } - -//------------------------------------------------------------------ -// Set the address size in bytes -//------------------------------------------------------------------ -void Stream::SetAddressByteSize(uint32_t addr_size) { m_addr_size = addr_size; } - -//------------------------------------------------------------------ -// The flags get accessor -//------------------------------------------------------------------ -Flags &Stream::GetFlags() { return m_flags; } - -//------------------------------------------------------------------ -// The flags const get accessor -//------------------------------------------------------------------ -const Flags &Stream::GetFlags() const { return m_flags; } - -//------------------------------------------------------------------ -// The byte order get accessor -//------------------------------------------------------------------ - -lldb::ByteOrder Stream::GetByteOrder() const { return m_byte_order; } - -size_t Stream::PrintfAsRawHex8(const char *format, ...) { - va_list args; - va_list args_copy; - va_start(args, format); - va_copy(args_copy, args); // Copy this so we - - char str[1024]; - size_t bytes_written = 0; - // Try and format our string into a fixed buffer first and see if it fits - size_t length = ::vsnprintf(str, sizeof(str), format, args); - if (length < sizeof(str)) { - // The formatted string fit into our stack based buffer, so we can just - // append that to our packet - for (size_t i = 0; i < length; ++i) - bytes_written += _PutHex8(str[i], false); - } else { - // Our stack buffer wasn't big enough to contain the entire formatted - // string, so lets let vasprintf create the string for us! - char *str_ptr = NULL; - length = ::vasprintf(&str_ptr, format, args_copy); - if (str_ptr) { - for (size_t i = 0; i < length; ++i) - bytes_written += _PutHex8(str_ptr[i], false); - ::free(str_ptr); - } - } - va_end(args); - va_end(args_copy); - - return bytes_written; -} - -size_t Stream::PutNHex8(size_t n, uint8_t uvalue) { - size_t bytes_written = 0; - for (size_t i = 0; i < n; ++i) - bytes_written += _PutHex8(uvalue, false); - return bytes_written; -} - -size_t Stream::_PutHex8(uint8_t uvalue, bool add_prefix) { - size_t bytes_written = 0; - if (m_flags.Test(eBinary)) { - bytes_written = Write(&uvalue, 1); - } else { - if (add_prefix) - PutCString("0x"); - - static char g_hex_to_ascii_hex_char[16] = {'0', '1', '2', '3', '4', '5', - '6', '7', '8', '9', 'a', 'b', - 'c', 'd', 'e', 'f'}; - char nibble_chars[2]; - nibble_chars[0] = g_hex_to_ascii_hex_char[(uvalue >> 4) & 0xf]; - nibble_chars[1] = g_hex_to_ascii_hex_char[(uvalue >> 0) & 0xf]; - bytes_written = Write(nibble_chars, sizeof(nibble_chars)); - } - return bytes_written; -} - -size_t Stream::PutHex8(uint8_t uvalue) { return _PutHex8(uvalue, false); } - -size_t Stream::PutHex16(uint16_t uvalue, ByteOrder byte_order) { - if (byte_order == eByteOrderInvalid) - byte_order = m_byte_order; - - size_t bytes_written = 0; - if (byte_order == eByteOrderLittle) { - for (size_t byte = 0; byte < sizeof(uvalue); ++byte) - bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); - } else { - for (size_t byte = sizeof(uvalue) - 1; byte < sizeof(uvalue); --byte) - bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); - } - return bytes_written; -} - -size_t Stream::PutHex32(uint32_t uvalue, ByteOrder byte_order) { - if (byte_order == eByteOrderInvalid) - byte_order = m_byte_order; - - size_t bytes_written = 0; - if (byte_order == eByteOrderLittle) { - for (size_t byte = 0; byte < sizeof(uvalue); ++byte) - bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); - } else { - for (size_t byte = sizeof(uvalue) - 1; byte < sizeof(uvalue); --byte) - bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); - } - return bytes_written; -} - -size_t Stream::PutHex64(uint64_t uvalue, ByteOrder byte_order) { - if (byte_order == eByteOrderInvalid) - byte_order = m_byte_order; - - size_t bytes_written = 0; - if (byte_order == eByteOrderLittle) { - for (size_t byte = 0; byte < sizeof(uvalue); ++byte) - bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); - } else { - for (size_t byte = sizeof(uvalue) - 1; byte < sizeof(uvalue); --byte) - bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); - } - return bytes_written; -} - -size_t Stream::PutMaxHex64(uint64_t uvalue, size_t byte_size, - lldb::ByteOrder byte_order) { - switch (byte_size) { - case 1: - return PutHex8((uint8_t)uvalue); - case 2: - return PutHex16((uint16_t)uvalue); - case 4: - return PutHex32((uint32_t)uvalue); - case 8: - return PutHex64(uvalue); - } - return 0; -} - -size_t Stream::PutPointer(void *ptr) { - return PutRawBytes(&ptr, sizeof(ptr), endian::InlHostByteOrder(), - endian::InlHostByteOrder()); -} - -size_t Stream::PutFloat(float f, ByteOrder byte_order) { - if (byte_order == eByteOrderInvalid) - byte_order = m_byte_order; - - return PutRawBytes(&f, sizeof(f), endian::InlHostByteOrder(), byte_order); -} - -size_t Stream::PutDouble(double d, ByteOrder byte_order) { - if (byte_order == eByteOrderInvalid) - byte_order = m_byte_order; - - return PutRawBytes(&d, sizeof(d), endian::InlHostByteOrder(), byte_order); -} - -size_t Stream::PutLongDouble(long double ld, ByteOrder byte_order) { - if (byte_order == eByteOrderInvalid) - byte_order = m_byte_order; - - return PutRawBytes(&ld, sizeof(ld), endian::InlHostByteOrder(), byte_order); -} - -size_t Stream::PutRawBytes(const void *s, size_t src_len, - ByteOrder src_byte_order, ByteOrder dst_byte_order) { - if (src_byte_order == eByteOrderInvalid) - src_byte_order = m_byte_order; - - if (dst_byte_order == eByteOrderInvalid) - dst_byte_order = m_byte_order; - - size_t bytes_written = 0; - const uint8_t *src = (const uint8_t *)s; - bool binary_was_set = m_flags.Test(eBinary); - if (!binary_was_set) - m_flags.Set(eBinary); - if (src_byte_order == dst_byte_order) { - for (size_t i = 0; i < src_len; ++i) - bytes_written += _PutHex8(src[i], false); - } else { - for (size_t i = src_len - 1; i < src_len; --i) - bytes_written += _PutHex8(src[i], false); - } - if (!binary_was_set) - m_flags.Clear(eBinary); - - return bytes_written; -} - -size_t Stream::PutBytesAsRawHex8(const void *s, size_t src_len, - ByteOrder src_byte_order, - ByteOrder dst_byte_order) { - if (src_byte_order == eByteOrderInvalid) - src_byte_order = m_byte_order; - - if (dst_byte_order == eByteOrderInvalid) - dst_byte_order = m_byte_order; - - size_t bytes_written = 0; - const uint8_t *src = (const uint8_t *)s; - bool binary_is_set = m_flags.Test(eBinary); - m_flags.Clear(eBinary); - if (src_byte_order == dst_byte_order) { - for (size_t i = 0; i < src_len; ++i) - bytes_written += _PutHex8(src[i], false); - } else { - for (size_t i = src_len - 1; i < src_len; --i) - bytes_written += _PutHex8(src[i], false); - } - if (binary_is_set) - m_flags.Set(eBinary); - - return bytes_written; -} - -size_t Stream::PutCStringAsRawHex8(const char *s) { - size_t bytes_written = 0; - bool binary_is_set = m_flags.Test(eBinary); - m_flags.Clear(eBinary); - do { - bytes_written += _PutHex8(*s, false); - ++s; - } while (*s); - if (binary_is_set) - m_flags.Set(eBinary); - return bytes_written; -} - -void Stream::UnitTest(Stream *s) { - s->PutHex8(0x12); - - s->PutChar(' '); - s->PutHex16(0x3456, endian::InlHostByteOrder()); - s->PutChar(' '); - s->PutHex16(0x3456, eByteOrderBig); - s->PutChar(' '); - s->PutHex16(0x3456, eByteOrderLittle); - - s->PutChar(' '); - s->PutHex32(0x789abcde, endian::InlHostByteOrder()); - s->PutChar(' '); - s->PutHex32(0x789abcde, eByteOrderBig); - s->PutChar(' '); - s->PutHex32(0x789abcde, eByteOrderLittle); - - s->PutChar(' '); - s->PutHex64(0x1122334455667788ull, endian::InlHostByteOrder()); - s->PutChar(' '); - s->PutHex64(0x1122334455667788ull, eByteOrderBig); - s->PutChar(' '); - s->PutHex64(0x1122334455667788ull, eByteOrderLittle); - - const char *hola = "Hello World!!!"; - s->PutChar(' '); - s->PutCString(hola); - - s->PutChar(' '); - s->Write(hola, 5); - - s->PutChar(' '); - s->PutCStringAsRawHex8(hola); - - s->PutChar(' '); - s->PutCStringAsRawHex8("01234"); - - s->PutChar(' '); - s->Printf("pid=%i", 12733); - - s->PutChar(' '); - s->PrintfAsRawHex8("pid=%i", 12733); - s->PutChar('\n'); -} Index: lldb/trunk/source/Core/StreamFile.cpp =================================================================== --- lldb/trunk/source/Core/StreamFile.cpp +++ lldb/trunk/source/Core/StreamFile.cpp @@ -14,7 +14,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/StreamString.cpp =================================================================== --- lldb/trunk/source/Core/StreamString.cpp +++ lldb/trunk/source/Core/StreamString.cpp @@ -1,65 +0,0 @@ -//===-- StreamString.cpp ----------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lldb/Core/StreamString.h" -#include - -using namespace lldb; -using namespace lldb_private; - -StreamString::StreamString() : Stream(0, 4, eByteOrderBig) {} - -StreamString::StreamString(uint32_t flags, uint32_t addr_size, - ByteOrder byte_order) - : Stream(flags, addr_size, byte_order), m_packet() {} - -StreamString::~StreamString() {} - -void StreamString::Flush() { - // Nothing to do when flushing a buffer based stream... -} - -size_t StreamString::Write(const void *s, size_t length) { - m_packet.append(reinterpret_cast(s), length); - return length; -} - -void StreamString::Clear() { m_packet.clear(); } - -bool StreamString::Empty() const { return GetSize() == 0; } - -size_t StreamString::GetSize() const { return m_packet.size(); } - -size_t StreamString::GetSizeOfLastLine() const { - const size_t length = m_packet.size(); - size_t last_line_begin_pos = m_packet.find_last_of("\r\n"); - if (last_line_begin_pos == std::string::npos) { - return length; - } else { - ++last_line_begin_pos; - return length - last_line_begin_pos; - } -} - -llvm::StringRef StreamString::GetString() const { return m_packet; } - -void StreamString::FillLastLineToColumn(uint32_t column, char fill_char) { - const size_t length = m_packet.size(); - size_t last_line_begin_pos = m_packet.find_last_of("\r\n"); - if (last_line_begin_pos == std::string::npos) { - last_line_begin_pos = 0; - } else { - ++last_line_begin_pos; - } - - const size_t line_columns = length - last_line_begin_pos; - if (column > line_columns) { - m_packet.append(column - line_columns, fill_char); - } -} Index: lldb/trunk/source/Core/StringList.cpp =================================================================== --- lldb/trunk/source/Core/StringList.cpp +++ lldb/trunk/source/Core/StringList.cpp @@ -10,8 +10,8 @@ #include "lldb/Core/StringList.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/source/Core/StructuredData.cpp =================================================================== --- lldb/trunk/source/Core/StructuredData.cpp +++ lldb/trunk/source/Core/StructuredData.cpp @@ -14,12 +14,12 @@ #include #include "lldb/Core/DataBuffer.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/File.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/JSON.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Core/Timer.cpp =================================================================== --- lldb/trunk/source/Core/Timer.cpp +++ lldb/trunk/source/Core/Timer.cpp @@ -13,8 +13,8 @@ #include #include -#include "lldb/Core/Stream.h" #include "lldb/Host/Host.h" +#include "lldb/Utility/Stream.h" #include Index: lldb/trunk/source/Core/UUID.cpp =================================================================== --- lldb/trunk/source/Core/UUID.cpp +++ lldb/trunk/source/Core/UUID.cpp @@ -18,7 +18,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { Index: lldb/trunk/source/Core/UserID.cpp =================================================================== --- lldb/trunk/source/Core/UserID.cpp +++ lldb/trunk/source/Core/UserID.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/UserID.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include Index: lldb/trunk/source/Core/UserSettingsController.cpp =================================================================== --- lldb/trunk/source/Core/UserSettingsController.cpp +++ lldb/trunk/source/Core/UserSettingsController.cpp @@ -11,14 +11,14 @@ #include #include -#include "lldb/Core/Error.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/UserSettingsController.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/OptionValueProperties.h" #include "lldb/Interpreter/OptionValueString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/VMRange.cpp =================================================================== --- lldb/trunk/source/Core/VMRange.cpp +++ lldb/trunk/source/Core/VMRange.cpp @@ -9,8 +9,8 @@ #include "lldb/lldb-private.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/VMRange.h" +#include "lldb/Utility/Stream.h" #include using namespace lldb; Index: lldb/trunk/source/Core/Value.cpp =================================================================== --- lldb/trunk/source/Core/Value.cpp +++ lldb/trunk/source/Core/Value.cpp @@ -17,7 +17,6 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Module.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" @@ -28,6 +27,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Core/ValueObject.cpp =================================================================== --- lldb/trunk/source/Core/ValueObject.cpp +++ lldb/trunk/source/Core/ValueObject.cpp @@ -21,7 +21,6 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectCast.h" #include "lldb/Core/ValueObjectChild.h" #include "lldb/Core/ValueObjectConstResult.h" @@ -29,6 +28,7 @@ #include "lldb/Core/ValueObjectList.h" #include "lldb/Core/ValueObjectMemory.h" #include "lldb/Core/ValueObjectSyntheticFilter.h" +#include "lldb/Utility/StreamString.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/DataFormatters/StringPrinter.h" Index: lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp =================================================================== --- lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp +++ lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp @@ -9,10 +9,10 @@ #include "lldb/DataFormatters/CXXFunctionPointer.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" #include Index: lldb/trunk/source/DataFormatters/FormattersHelpers.cpp =================================================================== --- lldb/trunk/source/DataFormatters/FormattersHelpers.cpp +++ lldb/trunk/source/DataFormatters/FormattersHelpers.cpp @@ -17,11 +17,11 @@ // Project includes #include "lldb/DataFormatters/FormattersHelpers.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RegularExpression.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/DataFormatters/StringPrinter.cpp =================================================================== --- lldb/trunk/source/DataFormatters/StringPrinter.cpp +++ lldb/trunk/source/DataFormatters/StringPrinter.cpp @@ -11,11 +11,11 @@ #include "lldb/DataFormatters/StringPrinter.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/ValueObject.h" #include "lldb/Target/Language.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "llvm/Support/ConvertUTF.h" Index: lldb/trunk/source/DataFormatters/TypeFormat.cpp =================================================================== --- lldb/trunk/source/DataFormatters/TypeFormat.cpp +++ lldb/trunk/source/DataFormatters/TypeFormat.cpp @@ -19,13 +19,13 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-public.h" -#include "lldb/Core/StreamString.h" #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/TypeList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/DataFormatters/TypeSummary.cpp =================================================================== --- lldb/trunk/source/DataFormatters/TypeSummary.cpp +++ lldb/trunk/source/DataFormatters/TypeSummary.cpp @@ -20,13 +20,13 @@ #include "lldb/lldb-public.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/ValueObjectPrinter.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/DataFormatters/TypeSynthetic.cpp =================================================================== --- lldb/trunk/source/DataFormatters/TypeSynthetic.cpp +++ lldb/trunk/source/DataFormatters/TypeSynthetic.cpp @@ -19,12 +19,12 @@ #include "lldb/lldb-public.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/StreamString.h" #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/ScriptInterpreter.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/DataFormatters/TypeValidator.cpp =================================================================== --- lldb/trunk/source/DataFormatters/TypeValidator.cpp +++ lldb/trunk/source/DataFormatters/TypeValidator.cpp @@ -15,7 +15,7 @@ // Project includes #include "lldb/DataFormatters/TypeValidator.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp =================================================================== --- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp +++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp @@ -13,12 +13,12 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Target/Language.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Expression/DWARFExpression.cpp =================================================================== --- lldb/trunk/source/Expression/DWARFExpression.cpp +++ lldb/trunk/source/Expression/DWARFExpression.cpp @@ -19,10 +19,10 @@ #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/VMRange.h" #include "lldb/Core/Value.h" #include "lldb/Core/dwarf.h" +#include "lldb/Utility/StreamString.h" #include "Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h" #include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h" Index: lldb/trunk/source/Expression/DiagnosticManager.cpp =================================================================== --- lldb/trunk/source/Expression/DiagnosticManager.cpp +++ lldb/trunk/source/Expression/DiagnosticManager.cpp @@ -12,7 +12,7 @@ #include "llvm/Support/ErrorHandling.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Expression/ExpressionSourceCode.cpp =================================================================== --- lldb/trunk/source/Expression/ExpressionSourceCode.cpp +++ lldb/trunk/source/Expression/ExpressionSourceCode.cpp @@ -11,7 +11,6 @@ #include "Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h" #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/DebugMacros.h" @@ -22,6 +21,7 @@ #include "lldb/Target/Platform.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Expression/IRDynamicChecks.cpp =================================================================== --- lldb/trunk/source/Expression/IRDynamicChecks.cpp +++ lldb/trunk/source/Expression/IRDynamicChecks.cpp @@ -21,7 +21,6 @@ // Project includes #include "lldb/Expression/IRDynamicChecks.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Expression/UtilityFunction.h" #include "lldb/Target/ExecutionContext.h" @@ -29,6 +28,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" using namespace llvm; using namespace lldb_private; Index: lldb/trunk/source/Expression/IRInterpreter.cpp =================================================================== --- lldb/trunk/source/Expression/IRInterpreter.cpp +++ lldb/trunk/source/Expression/IRInterpreter.cpp @@ -8,19 +8,19 @@ //===----------------------------------------------------------------------===// #include "lldb/Expression/IRInterpreter.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/IRExecutionUnit.h" #include "lldb/Expression/IRMemoryMap.h" #include "lldb/Host/Endian.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "lldb/Target/ABI.h" #include "lldb/Target/ExecutionContext.h" Index: lldb/trunk/source/Expression/IRMemoryMap.cpp =================================================================== --- lldb/trunk/source/Expression/IRMemoryMap.cpp +++ lldb/trunk/source/Expression/IRMemoryMap.cpp @@ -10,12 +10,12 @@ #include "lldb/Expression/IRMemoryMap.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Scalar.h" #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" using namespace lldb_private; Index: lldb/trunk/source/Expression/LLVMUserExpression.cpp =================================================================== --- lldb/trunk/source/Expression/LLVMUserExpression.cpp +++ lldb/trunk/source/Expression/LLVMUserExpression.cpp @@ -12,11 +12,9 @@ // Project includes #include "lldb/Expression/LLVMUserExpression.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/ExpressionSourceCode.h" @@ -38,6 +36,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanCallUserExpression.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Expression/UserExpression.cpp =================================================================== --- lldb/trunk/source/Expression/UserExpression.cpp +++ lldb/trunk/source/Expression/UserExpression.cpp @@ -17,11 +17,9 @@ #include #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/ExpressionSourceCode.h" @@ -43,6 +41,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanCallUserExpression.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Expression/UtilityFunction.cpp =================================================================== --- lldb/trunk/source/Expression/UtilityFunction.cpp +++ lldb/trunk/source/Expression/UtilityFunction.cpp @@ -15,10 +15,8 @@ // C++ Includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/ExpressionSourceCode.h" @@ -29,6 +27,8 @@ #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; using namespace lldb; Index: lldb/trunk/source/Host/common/Editline.cpp =================================================================== --- lldb/trunk/source/Host/common/Editline.cpp +++ lldb/trunk/source/Host/common/Editline.cpp @@ -11,16 +11,16 @@ #include #include -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StringList.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Editline.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/SelectHelper.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; using namespace lldb_private::line_editor; Index: lldb/trunk/source/Host/common/File.cpp =================================================================== --- lldb/trunk/source/Host/common/File.cpp +++ lldb/trunk/source/Host/common/File.cpp @@ -26,11 +26,11 @@ #include "llvm/Support/Process.h" // for llvm::sys::Process::FileDescriptorHasColors() #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Host/Config.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Host/common/FileSpec.cpp =================================================================== --- lldb/trunk/source/Host/common/FileSpec.cpp +++ lldb/trunk/source/Host/common/FileSpec.cpp @@ -28,14 +28,14 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataBufferMemoryMap.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/File.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Utility/CleanUp.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/source/Host/common/Host.cpp =================================================================== --- lldb/trunk/source/Host/common/Host.cpp +++ lldb/trunk/source/Host/common/Host.cpp @@ -50,7 +50,6 @@ // Project includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" @@ -65,6 +64,7 @@ #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/UnixSignals.h" #include "lldb/Utility/CleanUp.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/FileSystem.h" Index: lldb/trunk/source/Host/common/HostInfoBase.cpp =================================================================== --- lldb/trunk/source/Host/common/HostInfoBase.cpp +++ lldb/trunk/source/Host/common/HostInfoBase.cpp @@ -11,11 +11,11 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/HostInfoBase.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/Triple.h" Index: lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp =================================================================== --- lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp +++ lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/MonitoringProcessLauncher.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -16,6 +15,7 @@ #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Host/common/NativeBreakpoint.cpp =================================================================== --- lldb/trunk/source/Host/common/NativeBreakpoint.cpp +++ lldb/trunk/source/Host/common/NativeBreakpoint.cpp @@ -9,8 +9,8 @@ #include "lldb/Host/common/NativeBreakpoint.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-defines.h" using namespace lldb_private; Index: lldb/trunk/source/Host/common/Socket.cpp =================================================================== --- lldb/trunk/source/Host/common/Socket.cpp +++ lldb/trunk/source/Host/common/Socket.cpp @@ -10,13 +10,13 @@ #include "lldb/Host/Socket.h" #include "lldb/Core/Log.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Host/Config.h" #include "lldb/Host/Host.h" #include "lldb/Host/SocketAddress.h" #include "lldb/Host/StringConvert.h" #include "lldb/Host/common/TCPSocket.h" #include "lldb/Host/common/UDPSocket.h" +#include "lldb/Utility/RegularExpression.h" #ifndef LLDB_DISABLE_POSIX #include "lldb/Host/posix/DomainSocket.h" Index: lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp =================================================================== --- lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp +++ lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp @@ -9,9 +9,9 @@ #include "lldb/Host/common/SoftwareBreakpoint.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Host/Debug.h" +#include "lldb/Utility/Error.h" #include "lldb/Host/common/NativeProcessProtocol.h" Index: lldb/trunk/source/Host/common/Symbols.cpp =================================================================== --- lldb/trunk/source/Host/common/Symbols.cpp +++ lldb/trunk/source/Host/common/Symbols.cpp @@ -14,12 +14,12 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/UUID.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Target.h" #include "lldb/Utility/SafeMachO.h" +#include "lldb/Utility/StreamString.h" #include "llvm/Support/FileSystem.h" Index: lldb/trunk/source/Host/common/ThisThread.cpp =================================================================== --- lldb/trunk/source/Host/common/ThisThread.cpp +++ lldb/trunk/source/Host/common/ThisThread.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/ThisThread.h" -#include "lldb/Core/Error.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/STLExtras.h" Index: lldb/trunk/source/Host/freebsd/Host.cpp =================================================================== --- lldb/trunk/source/Host/freebsd/Host.cpp +++ lldb/trunk/source/Host/freebsd/Host.cpp @@ -27,16 +27,16 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" Index: lldb/trunk/source/Host/linux/Host.cpp =================================================================== --- lldb/trunk/source/Host/linux/Host.cpp +++ lldb/trunk/source/Host/linux/Host.cpp @@ -21,9 +21,9 @@ // Other libraries and framework includes #include "llvm/Support/ScopedPrinter.h" // Project includes -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" Index: lldb/trunk/source/Host/macosx/Symbols.cpp =================================================================== --- lldb/trunk/source/Host/macosx/Symbols.cpp +++ lldb/trunk/source/Host/macosx/Symbols.cpp @@ -29,13 +29,13 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/UUID.h" #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/CleanUp.h" +#include "lldb/Utility/StreamString.h" #include "mach/machine.h" using namespace lldb; Index: lldb/trunk/source/Host/netbsd/Host.cpp =================================================================== --- lldb/trunk/source/Host/netbsd/Host.cpp +++ lldb/trunk/source/Host/netbsd/Host.cpp @@ -28,16 +28,16 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" Index: lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -44,12 +44,12 @@ // Project includes #include "lldb/Core/Communication.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Host/Socket.h" #include "lldb/Host/common/TCPSocket.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Host/posix/FileSystem.cpp =================================================================== --- lldb/trunk/source/Host/posix/FileSystem.cpp +++ lldb/trunk/source/Host/posix/FileSystem.cpp @@ -25,9 +25,9 @@ #endif // lldb Includes -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Host.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Host/posix/HostThreadPosix.cpp =================================================================== --- lldb/trunk/source/Host/posix/HostThreadPosix.cpp +++ lldb/trunk/source/Host/posix/HostThreadPosix.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/posix/HostThreadPosix.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include #include Index: lldb/trunk/source/Host/posix/MainLoopPosix.cpp =================================================================== --- lldb/trunk/source/Host/posix/MainLoopPosix.cpp +++ lldb/trunk/source/Host/posix/MainLoopPosix.cpp @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/posix/MainLoopPosix.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include #include #include #include -#include #include +#include using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp =================================================================== --- lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp +++ lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/windows/ConnectionGenericFileWindows.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/source/Host/windows/Host.cpp =================================================================== --- lldb/trunk/source/Host/windows/Host.cpp +++ lldb/trunk/source/Host/windows/Host.cpp @@ -15,9 +15,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" Index: lldb/trunk/source/Host/windows/HostThreadWindows.cpp =================================================================== --- lldb/trunk/source/Host/windows/HostThreadWindows.cpp +++ lldb/trunk/source/Host/windows/HostThreadWindows.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/Host/windows/HostThreadWindows.h" #include "lldb/Host/windows/windows.h" Index: lldb/trunk/source/Host/windows/ThisThread.cpp =================================================================== --- lldb/trunk/source/Host/windows/ThisThread.cpp +++ lldb/trunk/source/Host/windows/ThisThread.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/Host/ThisThread.h" #include "lldb/Host/windows/windows.h" Index: lldb/trunk/source/Interpreter/Args.cpp =================================================================== --- lldb/trunk/source/Interpreter/Args.cpp +++ lldb/trunk/source/Interpreter/Args.cpp @@ -12,9 +12,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" @@ -24,6 +22,8 @@ #include "lldb/Target/Process.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" Index: lldb/trunk/source/Interpreter/CommandAlias.cpp =================================================================== --- lldb/trunk/source/Interpreter/CommandAlias.cpp +++ lldb/trunk/source/Interpreter/CommandAlias.cpp @@ -11,11 +11,11 @@ #include "llvm/Support/ErrorHandling.h" -#include "lldb/Core/StreamString.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/CommandInterpreter.cpp =================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp @@ -45,9 +45,9 @@ #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/Timer.h" +#include "lldb/Utility/Stream.h" #ifndef LLDB_DISABLE_LIBEDIT #include "lldb/Host/Editline.h" Index: lldb/trunk/source/Interpreter/CommandReturnObject.cpp =================================================================== --- lldb/trunk/source/Interpreter/CommandReturnObject.cpp +++ lldb/trunk/source/Interpreter/CommandReturnObject.cpp @@ -13,8 +13,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionGroupVariable.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionGroupVariable.cpp +++ lldb/trunk/source/Interpreter/OptionGroupVariable.cpp @@ -13,10 +13,10 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueArray.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueArray.cpp +++ lldb/trunk/source/Interpreter/OptionValueArray.cpp @@ -13,9 +13,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueBoolean.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueBoolean.cpp +++ lldb/trunk/source/Interpreter/OptionValueBoolean.cpp @@ -13,10 +13,10 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Host/PosixApi.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/STLExtras.h" using namespace lldb; Index: lldb/trunk/source/Interpreter/OptionValueChar.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueChar.cpp +++ lldb/trunk/source/Interpreter/OptionValueChar.cpp @@ -13,9 +13,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/STLExtras.h" using namespace lldb; Index: lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp +++ lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp @@ -13,9 +13,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueFormat.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueFormat.cpp +++ lldb/trunk/source/Interpreter/OptionValueFormat.cpp @@ -13,9 +13,9 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueFormatEntity.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueFormatEntity.cpp +++ lldb/trunk/source/Interpreter/OptionValueFormatEntity.cpp @@ -14,9 +14,9 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueLanguage.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueLanguage.cpp +++ lldb/trunk/source/Interpreter/OptionValueLanguage.cpp @@ -13,10 +13,10 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Interpreter/Args.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp +++ lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp @@ -13,10 +13,10 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueProperties.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueProperties.cpp +++ lldb/trunk/source/Interpreter/OptionValueProperties.cpp @@ -14,12 +14,12 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Flags.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Core/UserSettingsController.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/OptionValues.h" #include "lldb/Interpreter/Property.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueRegex.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueRegex.cpp +++ lldb/trunk/source/Interpreter/OptionValueRegex.cpp @@ -13,7 +13,7 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueSInt64.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueSInt64.cpp +++ lldb/trunk/source/Interpreter/OptionValueSInt64.cpp @@ -13,8 +13,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueString.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueString.cpp +++ lldb/trunk/source/Interpreter/OptionValueString.cpp @@ -14,8 +14,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueUInt64.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueUInt64.cpp +++ lldb/trunk/source/Interpreter/OptionValueUInt64.cpp @@ -14,8 +14,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/OptionValueUUID.cpp =================================================================== --- lldb/trunk/source/Interpreter/OptionValueUUID.cpp +++ lldb/trunk/source/Interpreter/OptionValueUUID.cpp @@ -14,9 +14,9 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/Options.cpp =================================================================== --- lldb/trunk/source/Interpreter/Options.cpp +++ lldb/trunk/source/Interpreter/Options.cpp @@ -18,12 +18,12 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/StreamString.h" #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Interpreter/ScriptInterpreter.cpp =================================================================== --- lldb/trunk/source/Interpreter/ScriptInterpreter.cpp +++ lldb/trunk/source/Interpreter/ScriptInterpreter.cpp @@ -13,11 +13,11 @@ #include #include -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StringList.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/PseudoTerminal.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp @@ -18,8 +18,6 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/RegisterValue.h" @@ -31,6 +29,8 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Utility/ARMDefines.h" #include "Utility/ARM_DWARF_Registers.h" Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h =================================================================== --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -14,8 +14,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Target/ABI.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" class ABIMacOSX_arm64 : public lldb_private::ABI { Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -17,8 +17,6 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Triple.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -32,6 +30,8 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "Utility/ARM64_DWARF_Registers.h" Index: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp @@ -18,8 +18,6 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/RegisterValue.h" @@ -30,6 +28,8 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp @@ -18,8 +18,6 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/RegisterValue.h" @@ -31,6 +29,8 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Utility/ARMDefines.h" #include "Utility/ARM_DWARF_Registers.h" Index: lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp @@ -18,8 +18,6 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -32,6 +30,8 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "Utility/ARM64_DWARF_Registers.h" Index: lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -16,9 +16,7 @@ #include "llvm/IR/DerivedTypes.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp =================================================================== --- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -16,9 +16,7 @@ #include "llvm/ADT/Triple.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp =================================================================== --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -34,7 +34,6 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" @@ -42,8 +41,9 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" -#include "lldb/Core/RegularExpression.h" +#include "lldb/Utility/RegularExpression.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp =================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp @@ -11,13 +11,13 @@ // C++ Includes // Other libraries and framework includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Process.h" Index: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp =================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -11,7 +11,6 @@ // C++ Includes // Other libraries and framework includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/ObjectFile.h" @@ -20,6 +19,7 @@ #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "llvm/Support/Path.h" Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.h =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.h +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.h @@ -13,7 +13,7 @@ #include "clang/AST/DeclVisitor.h" #include "clang/AST/TypeVisitor.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/DenseSet.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -15,7 +15,6 @@ #include "ClangPersistentVariables.h" #include "lldb/Core/Address.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -45,6 +44,7 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h @@ -12,9 +12,9 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/ClangForward.h" -#include "lldb/Core/Error.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/ExpressionParser.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-public.h" #include Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -72,9 +72,7 @@ #include "lldb/Core/Disassembler.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StringList.h" #include "lldb/Expression/IRDynamicChecks.h" #include "lldb/Expression/IRExecutionUnit.h" @@ -90,6 +88,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlanCallFunction.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace clang; using namespace llvm; Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h @@ -25,10 +25,10 @@ // Project includes #include "lldb/Core/ClangForward.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Value.h" #include "lldb/Expression/ExpressionVariable.h" #include "lldb/Symbol/TaggedASTType.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-public.h" namespace llvm { Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp @@ -9,13 +9,13 @@ #include "ClangExpressionVariable.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Value.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "clang/AST/ASTContext.h" using namespace lldb_private; Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp @@ -26,13 +26,13 @@ #include "ClangModulesDeclVendor.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Target/Target.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp @@ -11,8 +11,8 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Value.h" +#include "lldb/Utility/StreamString.h" #include "clang/AST/Decl.h" Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -25,12 +25,10 @@ #include "ClangModulesDeclVendor.h" #include "ClangPersistentVariables.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Expression/ExpressionSourceCode.h" #include "lldb/Expression/IRExecutionUnit.h" @@ -51,6 +49,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanCallUserExpression.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp @@ -19,16 +19,16 @@ // C++ Includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Expression/ExpressionSourceCode.h" #include "lldb/Expression/IRExecutionUnit.h" #include "lldb/Host/Host.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.h =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.h +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.h @@ -11,11 +11,11 @@ #ifndef liblldb_IRForTarget_h_ #define liblldb_IRForTarget_h_ -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/TaggedASTType.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-public.h" #include "llvm/Pass.h" Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp @@ -25,11 +25,9 @@ #include "clang/AST/ASTContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Log.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/dwarf.h" #include "lldb/Expression/IRExecutionUnit.h" #include "lldb/Expression/IRInterpreter.h" @@ -37,6 +35,8 @@ #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangUtil.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/source/Plugins/ExpressionParser/Go/GoParser.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Go/GoParser.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Go/GoParser.cpp @@ -12,7 +12,7 @@ #include "GoParser.h" #include "Plugins/ExpressionParser/Go/GoAST.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/SmallString.h" using namespace lldb_private; Index: lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp =================================================================== --- lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp +++ lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp @@ -26,14 +26,12 @@ // Project includes #include "GoUserExpression.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataEncoder.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Core/ValueObjectRegister.h" #include "lldb/Expression/DiagnosticManager.h" @@ -49,6 +47,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanCallUserExpression.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" #include "Plugins/ExpressionParser/Go/GoAST.h" Index: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h =================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h @@ -11,9 +11,9 @@ #define lldb_EmulateInstructionARM_h_ #include "Plugins/Process/Utility/ARMDefines.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp =================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -13,13 +13,13 @@ #include "EmulationStateARM.h" #include "lldb/Core/Address.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/PosixApi.h" #include "lldb/Interpreter/OptionValueArray.h" #include "lldb/Interpreter/OptionValueDictionary.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "Plugins/Process/Utility/ARMDefines.h" #include "Plugins/Process/Utility/ARMUtils.h" Index: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h =================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h @@ -16,8 +16,8 @@ // Project includes #include "Plugins/Process/Utility/ARMDefines.h" #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/Error.h" class EmulateInstructionARM64 : public lldb_private::EmulateInstruction { public: Index: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp =================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -13,10 +13,10 @@ #include "lldb/Core/Address.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "Plugins/Process/Utility/ARMDefines.h" #include "Plugins/Process/Utility/ARMUtils.h" Index: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h =================================================================== --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -22,8 +22,8 @@ } #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/Error.h" class EmulateInstructionMIPS : public lldb_private::EmulateInstruction { public: Index: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp =================================================================== --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -14,13 +14,13 @@ #include "lldb/Core/Address.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Opcode.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "llvm-c/Disassembler.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" Index: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h =================================================================== --- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h +++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h @@ -15,8 +15,8 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/Error.h" namespace llvm { class MCDisassembler; Index: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp =================================================================== --- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -14,13 +14,13 @@ #include "lldb/Core/Address.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Opcode.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/PosixApi.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include "llvm-c/Disassembler.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" Index: lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp +++ lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp @@ -14,8 +14,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/UserExpression.h" @@ -25,6 +23,8 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/StringSwitch.h" Index: lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp +++ lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp @@ -15,8 +15,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/UserExpression.h" @@ -30,6 +28,8 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp =================================================================== --- lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -18,7 +18,6 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Interpreter/OptionValueProperties.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/SymbolVendor.h" @@ -26,6 +25,7 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" #include "JITLoaderGDB.h" Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h @@ -19,8 +19,8 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -23,16 +23,16 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/FastDemangle.h" #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/DataFormatters/CXXFunctionPointer.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/VectorType.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RegularExpression.h" #include "BlockPointer.h" #include "CxxStringTypes.h" Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.h =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.h +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.h @@ -11,9 +11,9 @@ #ifndef liblldb_CxxStringTypes_h_ #define liblldb_CxxStringTypes_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp @@ -12,8 +12,6 @@ #include "llvm/Support/ConvertUTF.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -25,7 +23,9 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/ProcessStructReader.h" +#include "lldb/Utility/Stream.h" #include Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h @@ -11,10 +11,10 @@ #ifndef liblldb_LibCxx_h_ #define liblldb_LibCxx_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp @@ -15,9 +15,7 @@ // Project includes #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/FormatEntity.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -27,7 +25,9 @@ #include "lldb/Host/Endian.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/ProcessStructReader.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h @@ -11,10 +11,10 @@ #ifndef liblldb_LibCxxAtomic_h_ #define liblldb_LibCxxAtomic_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp @@ -13,9 +13,9 @@ // Project includes #include "LibCxx.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormattersHelpers.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp @@ -14,14 +14,14 @@ #include "LibCxx.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Host/Endian.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp @@ -14,14 +14,14 @@ #include "LibCxx.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Host/Endian.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp @@ -14,14 +14,14 @@ #include "LibCxx.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Host/Endian.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp @@ -13,9 +13,9 @@ // Project includes #include "LibCxx.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormattersHelpers.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.h =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.h +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.h @@ -10,10 +10,10 @@ #ifndef liblldb_LibStdCpp_h_ #define liblldb_LibStdCpp_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp @@ -14,8 +14,6 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/StringPrinter.h" @@ -23,6 +21,8 @@ #include "lldb/Host/Endian.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp @@ -9,10 +9,10 @@ #include "LibStdcpp.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/ConstString.h" #include #include Index: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp @@ -9,10 +9,10 @@ #include "LibStdcpp.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/ConstString.h" #include #include Index: lldb/trunk/source/Plugins/Language/Go/GoFormatterFunctions.h =================================================================== --- lldb/trunk/source/Plugins/Language/Go/GoFormatterFunctions.h +++ lldb/trunk/source/Plugins/Language/Go/GoFormatterFunctions.h @@ -21,12 +21,12 @@ // Project includes #include "lldb/lldb-forward.h" -#include "lldb/Core/ConstString.h" #include "lldb/DataFormatters/FormatClasses.h" #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/Go/GoLanguage.h =================================================================== --- lldb/trunk/source/Plugins/Language/Go/GoLanguage.h +++ lldb/trunk/source/Plugins/Language/Go/GoLanguage.h @@ -18,8 +18,8 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Language/Go/GoLanguage.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/Go/GoLanguage.cpp +++ lldb/trunk/source/Plugins/Language/Go/GoLanguage.cpp @@ -19,10 +19,10 @@ // Project includes #include "GoLanguage.h" #include "Plugins/Language/Go/GoFormatterFunctions.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Symbol/GoASTContext.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/Java/JavaLanguage.h =================================================================== --- lldb/trunk/source/Plugins/Language/Java/JavaLanguage.h +++ lldb/trunk/source/Plugins/Language/Java/JavaLanguage.h @@ -18,8 +18,8 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Language/Java/JavaLanguage.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/Java/JavaLanguage.cpp +++ lldb/trunk/source/Plugins/Language/Java/JavaLanguage.cpp @@ -19,11 +19,11 @@ // Project includes #include "JavaFormatterFunctions.h" #include "JavaLanguage.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Symbol/JavaASTContext.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h =================================================================== --- lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h +++ lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h @@ -19,8 +19,8 @@ #include "llvm/ADT/StringRef.h" // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp +++ lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp @@ -19,11 +19,11 @@ // Project includes #include "OCamlLanguage.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Symbol/OCamlASTContext.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/ObjC/CF.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/CF.h +++ lldb/trunk/source/Plugins/Language/ObjC/CF.h @@ -10,9 +10,9 @@ #ifndef liblldb_CF_h_ #define liblldb_CF_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/ObjC/CF.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/CF.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/CF.cpp @@ -11,8 +11,6 @@ #include "CF.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -22,6 +20,8 @@ #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h +++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h @@ -11,11 +11,11 @@ #ifndef liblldb_Cocoa_h_ #define liblldb_Cocoa_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Target/ObjCLanguageRuntime.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp @@ -14,9 +14,7 @@ #include "Cocoa.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Mangled.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -29,7 +27,9 @@ #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/ProcessStructReader.h" +#include "lldb/Utility/Stream.h" #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" Index: lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.h +++ lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.h @@ -11,9 +11,9 @@ #ifndef liblldb_CoreMedia_h_ #define liblldb_CoreMedia_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp @@ -17,8 +17,6 @@ #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -28,6 +26,8 @@ #include "lldb/Target/Language.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h +++ lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h @@ -11,11 +11,11 @@ #ifndef liblldb_NSDictionary_h_ #define liblldb_NSDictionary_h_ -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" #include #include Index: lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp @@ -18,8 +18,6 @@ #include "NSDictionary.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -29,6 +27,8 @@ #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp @@ -16,8 +16,6 @@ #include "Cocoa.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -25,6 +23,8 @@ #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" #include "lldb/Utility/ProcessStructReader.h" Index: lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp @@ -16,8 +16,6 @@ #include "Cocoa.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -25,6 +23,8 @@ #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" #include "lldb/Utility/ProcessStructReader.h" Index: lldb/trunk/source/Plugins/Language/ObjC/NSSet.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSSet.h +++ lldb/trunk/source/Plugins/Language/ObjC/NSSet.h @@ -11,11 +11,11 @@ #ifndef liblldb_NSSet_h_ #define liblldb_NSSet_h_ -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp @@ -14,8 +14,6 @@ #include "NSSet.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -24,6 +22,8 @@ #include "lldb/Target/Language.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/ObjC/NSString.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSString.h +++ lldb/trunk/source/Plugins/Language/ObjC/NSString.h @@ -11,10 +11,10 @@ #ifndef liblldb_NSString_h_ #define liblldb_NSString_h_ -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/Target/ObjCLanguageRuntime.h" +#include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { Index: lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp @@ -11,8 +11,6 @@ #include "NSString.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -21,7 +19,9 @@ #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/Language.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/ProcessStructReader.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h +++ lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h @@ -17,8 +17,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Target/Language.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp +++ lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp @@ -15,9 +15,7 @@ // Project includes #include "ObjCLanguage.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/DataVisualization.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -25,6 +23,8 @@ #include "lldb/Symbol/CompilerType.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" #include "CF.h" #include "Cocoa.h" Index: lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp =================================================================== --- lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp +++ lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp @@ -10,8 +10,8 @@ #include "ObjCPlusPlusLanguage.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -11,8 +11,6 @@ #include "ItaniumABILanguageRuntime.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Mangled.h" #include "lldb/Core/Module.h" @@ -33,6 +31,8 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include Index: lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp @@ -11,8 +11,6 @@ #include "GoLanguageRuntime.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -29,6 +27,8 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/Twine.h" #include Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -14,15 +14,12 @@ #include "clang/AST/Type.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" @@ -34,6 +31,9 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -15,13 +15,10 @@ #include "clang/AST/Type.h" #include "lldb/Breakpoint/BreakpointLocation.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Expression/FunctionCaller.h" #include "lldb/Expression/UtilityFunction.h" #include "lldb/Symbol/ClangASTContext.h" @@ -31,6 +28,9 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -24,16 +24,12 @@ #include "lldb/lldb-enumerations.h" #include "lldb/Core/ClangForward.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Expression/DiagnosticManager.h" @@ -55,6 +51,10 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "AppleObjCClassDescriptorV2.h" #include "AppleObjCDeclVendor.h" Index: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -17,7 +17,6 @@ #include "AppleThreadPlanStepThroughObjCTrampoline.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" @@ -38,6 +37,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanRunToAddress.h" +#include "lldb/Utility/ConstString.h" #include "llvm/ADT/STLExtras.h" Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -17,12 +17,9 @@ #include "RenderScriptScriptGroup.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/DataFormatters/DumpValueObjectOptions.h" #include "lldb/Expression/UserExpression.h" @@ -41,6 +38,9 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/RegularExpression.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp =================================================================== --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp @@ -8,9 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Breakpoint/StoppointCallbackContext.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/StringConvert.h" @@ -24,6 +22,8 @@ #include "lldb/Symbol/VariableList.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "RenderScriptRuntime.h" #include "RenderScriptScriptGroup.h" Index: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h =================================================================== --- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -12,10 +12,10 @@ // Project includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Host/FileSpec.h" #include "lldb/Symbol/ObjectContainer.h" +#include "lldb/Utility/ConstString.h" // Other libraries and framework includes #include "llvm/Support/Chrono.h" Index: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -32,10 +32,10 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" #include "lldb/Host/FileSystem.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -13,9 +13,9 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp @@ -11,7 +11,7 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include "ELFHeader.h" Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -15,19 +15,19 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBuffer.h" -#include "lldb/Core/Error.h" #include "lldb/Core/FileSpecList.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" #include "lldb/Symbol/DWARFCallFrameInfo.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -23,7 +23,6 @@ #include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" @@ -33,6 +32,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" #ifndef __APPLE__ #include "Utility/UuidCompatibility.h" Index: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -20,7 +20,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBuffer.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/FileSpecList.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" @@ -29,7 +28,6 @@ #include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" @@ -44,6 +42,8 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadList.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "lldb/Utility/SafeMachO.h" Index: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp =================================================================== --- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -21,7 +21,6 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" @@ -29,6 +28,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" #define IMAGE_DOS_SIGNATURE 0x5A4D // MZ #define IMAGE_NT_SIGNATURE 0x00004550 // PE00 Index: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp =================================================================== --- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp +++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp @@ -24,7 +24,6 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/OptionGroupBoolean.h" @@ -40,6 +39,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadList.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp =================================================================== --- lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -23,7 +23,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/RegisterValue.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StructuredData.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -35,6 +34,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadList.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/Android/AdbClient.h =================================================================== --- lldb/trunk/source/Plugins/Platform/Android/AdbClient.h +++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.h @@ -10,7 +10,7 @@ #ifndef liblldb_AdbClient_h_ #define liblldb_AdbClient_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include #include #include Index: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp +++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp @@ -19,11 +19,11 @@ #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataEncoder.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/PosixApi.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -8,10 +8,10 @@ //===----------------------------------------------------------------------===// // Other libraries and framework includes -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/common/TCPSocket.h" +#include "lldb/Utility/Error.h" #include "PlatformAndroidRemoteGDBServer.h" #include "Utility/UriParser.h" Index: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@ -22,13 +22,13 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp +++ lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp @@ -15,16 +15,16 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -21,20 +21,20 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/HostInfo.h" #include "lldb/Interpreter/OptionValueProperties.h" #include "lldb/Interpreter/Property.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" // Define these constants from Linux mman.h for use when targeting // remote linux systems even when host has different values. Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp @@ -19,11 +19,11 @@ #include // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/PseudoTerminal.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp @@ -15,18 +15,18 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp @@ -15,18 +15,18 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -22,7 +22,6 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -39,6 +38,7 @@ #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/STLExtras.h" #if defined(__APPLE__) Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h @@ -10,7 +10,7 @@ #ifndef liblldb_PlatformDarwinKernel_h_ #define liblldb_PlatformDarwinKernel_h_ -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #if defined(__APPLE__) // This Plugin uses the Mac-specific // source/Host/macosx/cfcpp utilities Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -19,13 +19,11 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/OptionValueFileSpecList.h" @@ -35,6 +33,8 @@ #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -18,13 +18,11 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" @@ -32,6 +30,8 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp @@ -18,17 +18,17 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -18,17 +18,17 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -15,17 +15,17 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -16,18 +16,18 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h =================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h @@ -24,10 +24,10 @@ typedef void *id; #endif // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Interpreter/Args.h" #include "lldb/Target/ProcessLaunchInfo.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/Optional.h" Index: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -22,13 +22,13 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp +++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp @@ -19,7 +19,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/UserExpression.h" #include "lldb/Host/File.h" @@ -33,6 +32,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -22,12 +22,12 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp =================================================================== --- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -15,14 +15,12 @@ // Project includes #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" @@ -30,6 +28,8 @@ #include "lldb/Host/StringConvert.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "Utility/UriParser.h" Index: lldb/trunk/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp +++ lldb/trunk/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp @@ -30,11 +30,11 @@ // LLDB includes #include "lldb/lldb-enumerations.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/ProcessLaunchInfo.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/PseudoTerminal.h" +#include "lldb/Utility/StreamString.h" #include "CFBundle.h" #include "CFString.h" Index: lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp +++ lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp @@ -22,11 +22,11 @@ #include // LLDB includes -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/UnixSignals.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -21,9 +21,9 @@ // LLDB includes #include "lldb/Core/Log.h" #include "lldb/Core/State.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Utility/PseudoTerminal.h" +#include "lldb/Utility/StreamString.h" #include "CFBundle.h" #include "CFString.h" Index: lldb/trunk/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp +++ lldb/trunk/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp @@ -13,7 +13,7 @@ #include // LLDB includes -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include "NativeProcessDarwin.h" Index: lldb/trunk/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp +++ lldb/trunk/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp @@ -20,9 +20,9 @@ #include // LLDB includes -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" #include "lldb/lldb-enumerations.h" #include "NativeProcessDarwin.h" Index: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -21,7 +21,6 @@ // C++ Includes // Other libraries and framework includes -#include "lldb/Core/Error.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" #include "lldb/Host/Host.h" @@ -29,6 +28,7 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Thread.h" #include "lldb/Target/UnixSignals.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/PseudoTerminal.h" #include "FreeBSDThread.h" Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -24,7 +24,6 @@ // Other libraries and framework includes #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/State.h" @@ -38,6 +37,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/PseudoTerminal.h" #include "lldb/Utility/StringExtractor.h" Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp @@ -12,9 +12,9 @@ #include "NativeRegisterContextLinux_arm.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Linux/Procfs.h" #include "Plugins/Process/Utility/RegisterContextLinux_arm.h" Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -17,10 +17,10 @@ // Other libraries and framework includes #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Host/common/NativeProcessProtocol.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Linux/NativeProcessLinux.h" #include "Plugins/Process/Linux/Procfs.h" Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -21,11 +21,11 @@ #include "Plugins/Process/Utility/RegisterContextLinux_mips64.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/EmulateInstruction.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/lldb-enumerations.h" #include "lldb/lldb-private-enumerations.h" Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp @@ -12,10 +12,10 @@ #include "NativeRegisterContextLinux_s390x.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Utility/RegisterContextLinux_s390x.h" Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -12,10 +12,10 @@ #include "NativeRegisterContextLinux_x86_64.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Utility/RegisterContextLinux_i386.h" #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h" Index: lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp +++ lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp @@ -21,7 +21,7 @@ // LLDB Headers #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" using namespace lldb_private; using namespace lldb_private::process_linux; Index: lldb/trunk/source/Plugins/Process/Linux/SingleStepCheck.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ lldb/trunk/source/Plugins/Process/Linux/SingleStepCheck.cpp @@ -19,8 +19,8 @@ #include "llvm/Support/Compiler.h" #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" -#include "lldb/Core/Error.h" #include "lldb/Host/linux/Ptrace.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h =================================================================== --- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h @@ -19,14 +19,14 @@ // Other libraries and framework includes #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Broadcaster.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StringList.h" #include "lldb/Core/ThreadSafeValue.h" #include "lldb/Host/HostThread.h" #include "lldb/Target/Process.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "CommunicationKDP.h" Index: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -15,12 +15,12 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/State.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Unwind.h" +#include "lldb/Utility/StreamString.h" #include "Plugins/Process/Utility/StopInfoMachException.h" #include "ProcessKDP.h" Index: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h +++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h @@ -17,8 +17,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/StructuredData.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" class DynamicRegisterInfo { Index: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -14,11 +14,11 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/StructuredData.h" #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/StringExtractor.h" using namespace lldb; Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp @@ -16,8 +16,8 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/StreamString.h" // Project includes #include "Utility/StringExtractorGDBRemote.h" Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp @@ -15,10 +15,10 @@ // Project includes #include "DynamicRegisterInfo.h" #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Target/Process.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/Error.h" #include "lldb/Target/OperatingSystem.h" #include "lldb/Target/Process.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private.h" #include "RegisterContextThreadMemory.h" Index: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp +++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp @@ -15,7 +15,6 @@ // Project includes #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Target/DynamicLoader.h" #include "lldb/Target/ExecutionContext.h" @@ -25,6 +24,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/UnixSignals.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h =================================================================== --- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h +++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h @@ -16,11 +16,11 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Symbol/FuncUnwinders.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Unwind.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-public.h" namespace lldb_private { Index: lldb/trunk/source/Plugins/Process/Windows/Common/DebuggerThread.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/DebuggerThread.cpp +++ lldb/trunk/source/Plugins/Process/Windows/Common/DebuggerThread.cpp @@ -11,7 +11,6 @@ #include "ExceptionRecord.h" #include "IDebugDelegate.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Host/FileSpec.h" @@ -23,6 +22,7 @@ #include "lldb/Host/windows/ProcessLauncherWindows.h" #include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" +#include "lldb/Utility/Error.h" #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h" Index: lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.h =================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.h @@ -11,8 +11,8 @@ #define liblldb_Plugins_Process_Windows_Common_ProcessWindows_H_ // Other libraries and framework includes -#include "lldb/Core/Error.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-forward.h" #include "llvm/Support/Mutex.h" Index: lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp +++ lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp @@ -8,9 +8,9 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/DataBufferHeap.h" -#include "lldb/Core/Error.h" #include "lldb/Host/windows/HostThreadWindows.h" #include "lldb/Host/windows/windows.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-types.h" #include "ProcessWindowsLog.h" Index: lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp +++ lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/Error.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Host/windows/HostThreadWindows.h" #include "lldb/Host/windows/windows.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-types.h" #include "RegisterContextWindows_x64.h" Index: lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp +++ lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/Error.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Host/windows/HostThreadWindows.h" #include "lldb/Host/windows/windows.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-types.h" #include "ProcessWindowsLog.h" Index: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h =================================================================== --- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h +++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h @@ -24,9 +24,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "Plugins/ObjectFile/ELF/ELFHeader.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -17,9 +17,7 @@ // C++ Includes // Other libraries and framework includes #include "lldb/Core/Log.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" @@ -30,6 +28,8 @@ #include "lldb/Host/ThreadLauncher.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/ScopedPrinter.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -23,7 +23,6 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/State.h" #include "lldb/Core/StreamGDBRemote.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Args.h" @@ -33,6 +32,7 @@ #include "lldb/Target/UnixSignals.h" #include "lldb/Utility/JSON.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" // Project includes #include "ProcessGDBRemote.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -25,7 +25,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/StreamGDBRemote.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Config.h" #include "lldb/Host/Endian.h" #include "lldb/Host/File.h" @@ -39,6 +38,7 @@ #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Utility/JSON.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/Triple.h" // Project includes Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -25,7 +25,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/State.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Debug.h" #include "lldb/Host/Endian.h" @@ -42,6 +41,7 @@ #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Utility/JSON.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/ScopedPrinter.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -23,7 +23,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/StreamGDBRemote.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StructuredData.h" #include "lldb/Host/Config.h" #include "lldb/Host/ConnectionFileDescriptor.h" @@ -35,6 +34,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/UnixSignals.h" #include "lldb/Utility/JSON.h" +#include "lldb/Utility/StreamString.h" // Project includes #include "Utility/StringExtractorGDBRemote.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h @@ -17,9 +17,9 @@ // Other libraries and framework includes // Project includes #include "Plugins/Process/Utility/DynamicRegisterInfo.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Target/RegisterContext.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-enumerations.h" #include "lldb/lldb-private.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -16,9 +16,9 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" // Project includes #include "ProcessGDBRemote.h" #include "ProcessGDBRemoteLog.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -22,17 +22,17 @@ // Project includes #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Broadcaster.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Core/LoadedModuleInfoList.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/StringList.h" #include "lldb/Core/StructuredData.h" #include "lldb/Core/ThreadSafeValue.h" #include "lldb/Host/HostThread.h" #include "lldb/Target/Process.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" #include "lldb/Utility/StringExtractor.h" #include "lldb/lldb-private-forward.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -35,7 +35,6 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/Value.h" #include "lldb/DataFormatters/FormatManager.h" @@ -66,6 +65,7 @@ #include "lldb/Target/ThreadPlanCallFunction.h" #include "lldb/Utility/CleanUp.h" #include "lldb/Utility/PseudoTerminal.h" +#include "lldb/Utility/StreamString.h" // Project includes #include "GDBRemoteRegisterContext.h" Index: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -13,7 +13,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/State.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" @@ -22,6 +21,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/UnixSignals.h" #include "lldb/Target/Unwind.h" +#include "lldb/Utility/StreamString.h" #include "ProcessGDBRemote.h" #include "ProcessGDBRemoteLog.h" Index: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h =================================================================== --- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h +++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h @@ -17,9 +17,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" class ThreadKDP; Index: lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp =================================================================== --- lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp +++ lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp @@ -15,13 +15,13 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/State.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Unwind.h" +#include "lldb/Utility/StreamString.h" #include "ProcessMachCore.h" //#include "RegisterContextKDP_arm.h" Index: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h =================================================================== --- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h +++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h @@ -17,7 +17,7 @@ // Other libraries and framework includes #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBuffer.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" Index: lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.h =================================================================== --- lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.h +++ lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.h @@ -13,7 +13,7 @@ // Project includes // Other libraries and framework includes -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitmaskEnum.h" Index: lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.h =================================================================== --- lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.h +++ lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.h @@ -15,11 +15,11 @@ #include "MinidumpTypes.h" // Other libraries and framework includes -#include "lldb/Core/ConstString.h" -#include "lldb/Core/Error.h" #include "lldb/Target/Process.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Error.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" Index: lldb/trunk/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp =================================================================== --- lldb/trunk/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp +++ lldb/trunk/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp @@ -10,10 +10,10 @@ #include "ScriptInterpreterNone.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/StringList.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Utility/Stream.h" #include Index: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h =================================================================== --- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -19,11 +19,11 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" #include "lldb/Core/StructuredData.h" #include "lldb/Host/File.h" #include "lldb/Interpreter/OptionValue.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-defines.h" #include "llvm/ADT/ArrayRef.h" Index: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp =================================================================== --- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -17,10 +17,10 @@ #include "PythonDataObjects.h" #include "ScriptInterpreterPython.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/File.h" #include "lldb/Host/FileSystem.h" #include "lldb/Interpreter/ScriptInterpreter.h" +#include "lldb/Utility/Stream.h" #include "llvm/Support/ConvertUTF.h" Index: lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp =================================================================== --- lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -20,7 +20,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -30,6 +29,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlanCallOnFunctionExit.h" +#include "lldb/Utility/RegularExpression.h" #define DARWIN_LOG_TYPE_VALUE "DarwinLog" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -23,7 +23,6 @@ #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Value.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/Args.h" @@ -38,6 +37,7 @@ #include "lldb/Symbol/TypeMap.h" #include "lldb/Target/Language.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp @@ -2,7 +2,6 @@ #include "DWARFASTParserOCaml.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/CompileUnit.h" @@ -10,6 +9,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Type.h" #include "lldb/Symbol/TypeList.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -12,13 +12,13 @@ #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "lldb/Core/Mangled.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Host/StringConvert.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/LineTable.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "DWARFDIECollection.h" #include "DWARFDebugAbbrev.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp @@ -11,7 +11,7 @@ #include -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; using namespace std; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp @@ -9,7 +9,7 @@ #include "DWARFDebugAbbrev.h" #include "DWARFDataExtractor.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp @@ -10,7 +10,7 @@ #include "DWARFDebugArangeSet.h" #include "SymbolFileDWARF.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include using namespace lldb_private; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -15,8 +15,8 @@ #include #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" +#include "lldb/Utility/Stream.h" #include "DWARFCompileUnit.h" #include "DWARFDebugInfo.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -12,10 +12,10 @@ #include #include -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/PosixApi.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" #include "DWARFCompileUnit.h" #include "DWARFDebugAranges.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -14,9 +14,9 @@ #include #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Expression/DWARFExpression.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/Stream.h" #include "DWARFCompileUnit.h" #include "DWARFDIECollection.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp @@ -12,7 +12,7 @@ #include "DWARFDebugMacinfoEntry.h" #include "SymbolFileDWARF.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; using namespace std; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp @@ -9,7 +9,7 @@ #include "DWARFDebugMacinfoEntry.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; using namespace std; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp @@ -9,8 +9,8 @@ #include "DWARFDebugPubnames.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" +#include "lldb/Utility/Stream.h" #include "DWARFCompileUnit.h" #include "DWARFDIECollection.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp @@ -10,7 +10,7 @@ #include "DWARFDebugPubnamesSet.h" #include "lldb/Core/Log.h" -#include "lldb/Core/RegularExpression.h" +#include "lldb/Utility/RegularExpression.h" #include "SymbolFileDWARF.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp @@ -9,7 +9,7 @@ #include "DWARFDebugRanges.h" #include "SymbolFileDWARF.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" #include using namespace lldb_private; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h @@ -15,7 +15,7 @@ #include #include // Other libraries and framework includes -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" // Project includes #include "DWARFDefines.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "DWARFDefines.h" -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include #include #include Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -9,8 +9,8 @@ #include -#include "lldb/Core/Stream.h" #include "lldb/Core/dwarf.h" +#include "lldb/Utility/Stream.h" #include "DWARFCompileUnit.h" #include "DWARFFormValue.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h @@ -13,8 +13,8 @@ #include #include "lldb/Core/MappedHash.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/dwarf.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/lldb-defines.h" #include "DWARFDefines.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp @@ -8,11 +8,11 @@ //===----------------------------------------------------------------------===// #include "NameToDIE.h" -#include "lldb/Core/ConstString.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include "DWARFCompileUnit.h" #include "DWARFDebugInfo.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -22,7 +22,6 @@ // Other libraries and framework includes #include "llvm/ADT/DenseMap.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" #include "lldb/Core/RangeMap.h" #include "lldb/Core/UniqueCStringMap.h" @@ -31,6 +30,7 @@ #include "lldb/Symbol/DebugMacros.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/SymbolFile.h" +#include "lldb/Utility/ConstString.h" #include "lldb/lldb-private.h" // Project includes Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -17,13 +17,13 @@ #include "lldb/Core/ModuleList.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/Value.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/StreamString.h" #include "Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h" Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -19,9 +19,9 @@ #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/RangeMap.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Section.h" #include "lldb/Host/FileSystem.h" +#include "lldb/Utility/RegularExpression.h" //#define DEBUG_OSO_DMAP // DO NOT CHECKIN WITH THIS NOT COMMENTED OUT #if defined(DEBUG_OSO_DMAP) Index: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -10,7 +10,6 @@ #include "SymbolFileSymtab.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Timer.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" @@ -20,6 +19,7 @@ #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Symtab.h" #include "lldb/Symbol/TypeList.h" +#include "lldb/Utility/RegularExpression.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -15,11 +15,11 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Host/Symbols.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -15,12 +15,12 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Host/Symbols.h" #include "lldb/Host/XML.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h @@ -18,9 +18,9 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Expression/UtilityFunction.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-public.h" // This class will insert a UtilityFunction into the inferior process for Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -15,10 +15,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Value.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" @@ -29,6 +27,8 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h @@ -19,8 +19,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-public.h" // This class will insert a UtilityFunction into the inferior process for Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -15,10 +15,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Value.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" @@ -29,6 +27,8 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h @@ -18,8 +18,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-public.h" // This class will insert a UtilityFunction into the inferior process for Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp @@ -13,10 +13,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Value.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/FunctionCaller.h" @@ -27,6 +25,8 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h @@ -19,8 +19,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" #include "lldb/Symbol/CompilerType.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-public.h" // This class will insert a UtilityFunction into the inferior process for Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp @@ -15,10 +15,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Value.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/Expression.h" @@ -31,6 +29,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" using namespace lldb; Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h @@ -18,7 +18,6 @@ // Other libraries and framework include // Project includes -#include "lldb/Core/ConstString.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/StructuredData.h" #include "lldb/Core/UUID.h" @@ -26,6 +25,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/QueueItem.h" #include "lldb/Target/SystemRuntime.h" +#include "lldb/Utility/ConstString.h" #include "AppleGetItemInfoHandler.h" #include "AppleGetPendingItemsHandler.h" Index: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp =================================================================== --- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -16,7 +16,6 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/FileSpec.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ObjectFile.h" @@ -27,6 +26,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/ProcessStructReader.h" +#include "lldb/Utility/StreamString.h" #include "SystemRuntimeMacOSX.h" Index: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp =================================================================== --- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -14,15 +14,15 @@ #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Disassembler.h" -#include "lldb/Core/Error.h" #include "lldb/Core/FormatEntity.h" #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp =================================================================== --- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -16,7 +16,6 @@ #include "lldb/Core/Address.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Error.h" #include "lldb/Core/PluginManager.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Target/ABI.h" @@ -26,6 +25,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/UnwindAssembly.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/RegisterNumber.h" using namespace lldb; Index: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h =================================================================== --- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h @@ -17,7 +17,7 @@ #include "lldb/lldb-private.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/ConstString.h" +#include "lldb/Utility/ConstString.h" #include #include Index: lldb/trunk/source/Symbol/ClangASTContext.cpp =================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp +++ lldb/trunk/source/Symbol/ClangASTContext.cpp @@ -74,7 +74,6 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/ThreadSafeDenseMap.h" @@ -93,6 +92,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/RegularExpression.h" #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h" #include "Plugins/SymbolFile/PDB/PDBASTParser.h" Index: lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp =================================================================== --- lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp +++ lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Symbol/ClangExternalASTSourceCommon.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; Index: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp =================================================================== --- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp +++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp @@ -17,12 +17,12 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" #include "lldb/Core/Section.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/CompactUnwindInfo.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/StreamString.h" #include "llvm/Support/MathExtras.h" Index: lldb/trunk/source/Symbol/CompilerType.cpp =================================================================== --- lldb/trunk/source/Symbol/CompilerType.cpp +++ lldb/trunk/source/Symbol/CompilerType.cpp @@ -9,19 +9,19 @@ #include "lldb/Symbol/CompilerType.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangExternalASTSourceCommon.h" #include "lldb/Symbol/Type.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/ConstString.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" #include #include Index: lldb/trunk/source/Symbol/Declaration.cpp =================================================================== --- lldb/trunk/source/Symbol/Declaration.cpp +++ lldb/trunk/source/Symbol/Declaration.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Symbol/Declaration.h" -#include "lldb/Core/Stream.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; Index: lldb/trunk/source/Symbol/JavaASTContext.cpp =================================================================== --- lldb/trunk/source/Symbol/JavaASTContext.cpp +++ lldb/trunk/source/Symbol/JavaASTContext.cpp @@ -13,7 +13,6 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/DWARFExpression.h" @@ -22,6 +21,7 @@ #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/Type.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" #include "Plugins/SymbolFile/DWARF/DWARFASTParserJava.h" Index: lldb/trunk/source/Symbol/LineTable.cpp =================================================================== --- lldb/trunk/source/Symbol/LineTable.cpp +++ lldb/trunk/source/Symbol/LineTable.cpp @@ -11,8 +11,8 @@ #include "lldb/Core/Address.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/CompileUnit.h" +#include "lldb/Utility/Stream.h" #include using namespace lldb; Index: lldb/trunk/source/Symbol/ObjectFile.cpp =================================================================== --- lldb/trunk/source/Symbol/ObjectFile.cpp +++ lldb/trunk/source/Symbol/ObjectFile.cpp @@ -15,15 +15,15 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Section.h" #include "lldb/Core/Timer.h" #include "lldb/Symbol/ObjectContainer.h" #include "lldb/Symbol/SymbolFile.h" -#include "lldb/Target/Target.h" +#include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/SectionLoadList.h" -#include "lldb/Target/Process.h" +#include "lldb/Target/Target.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/lldb-private.h" using namespace lldb; Index: lldb/trunk/source/Symbol/Symbol.cpp =================================================================== --- lldb/trunk/source/Symbol/Symbol.cpp +++ lldb/trunk/source/Symbol/Symbol.cpp @@ -12,13 +12,13 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Symbol/Symtab.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Symbol/SymbolFile.cpp =================================================================== --- lldb/trunk/source/Symbol/SymbolFile.cpp +++ lldb/trunk/source/Symbol/SymbolFile.cpp @@ -12,11 +12,11 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/StreamString.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/TypeMap.h" #include "lldb/Symbol/TypeSystem.h" #include "lldb/Symbol/VariableList.h" +#include "lldb/Utility/StreamString.h" #include "lldb/lldb-private.h" using namespace lldb_private; Index: lldb/trunk/source/Symbol/SymbolVendor.cpp =================================================================== --- lldb/trunk/source/Symbol/SymbolVendor.cpp +++ lldb/trunk/source/Symbol/SymbolVendor.cpp @@ -15,10 +15,10 @@ // Project includes #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolFile.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Symbol/Symtab.cpp =================================================================== --- lldb/trunk/source/Symbol/Symtab.cpp +++ lldb/trunk/source/Symbol/Symtab.cpp @@ -13,14 +13,14 @@ #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" #include "Plugins/Language/ObjC/ObjCLanguage.h" #include "lldb/Core/Module.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Symtab.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Symbol/Type.cpp =================================================================== --- lldb/trunk/source/Symbol/Type.cpp +++ lldb/trunk/source/Symbol/Type.cpp @@ -17,7 +17,7 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Module.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" Index: lldb/trunk/source/Symbol/UnwindPlan.cpp =================================================================== --- lldb/trunk/source/Symbol/UnwindPlan.cpp +++ lldb/trunk/source/Symbol/UnwindPlan.cpp @@ -9,11 +9,11 @@ #include "lldb/Symbol/UnwindPlan.h" -#include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/ConstString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Symbol/Variable.cpp =================================================================== --- lldb/trunk/source/Symbol/Variable.cpp +++ lldb/trunk/source/Symbol/Variable.cpp @@ -10,8 +10,6 @@ #include "lldb/Symbol/Variable.h" #include "lldb/Core/Module.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Symbol/Block.h" @@ -30,6 +28,8 @@ #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/Twine.h" Index: lldb/trunk/source/Symbol/VariableList.cpp =================================================================== --- lldb/trunk/source/Symbol/VariableList.cpp +++ lldb/trunk/source/Symbol/VariableList.cpp @@ -9,10 +9,10 @@ #include "lldb/Symbol/VariableList.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" +#include "lldb/Utility/RegularExpression.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/FileAction.cpp =================================================================== --- lldb/trunk/source/Target/FileAction.cpp +++ lldb/trunk/source/Target/FileAction.cpp @@ -9,9 +9,9 @@ #include -#include "lldb/Core/Stream.h" #include "lldb/Host/PosixApi.h" #include "lldb/Target/FileAction.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; Index: lldb/trunk/source/Target/InstrumentationRuntime.cpp =================================================================== --- lldb/trunk/source/Target/InstrumentationRuntime.cpp +++ lldb/trunk/source/Target/InstrumentationRuntime.cpp @@ -15,8 +15,8 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Target/Process.h" +#include "lldb/Utility/RegularExpression.h" #include "lldb/lldb-private.h" using namespace lldb; Index: lldb/trunk/source/Target/Language.cpp =================================================================== --- lldb/trunk/source/Target/Language.cpp +++ lldb/trunk/source/Target/Language.cpp @@ -15,10 +15,10 @@ #include "lldb/Target/Language.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/TypeList.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/PathMappingList.cpp =================================================================== --- lldb/trunk/source/Target/PathMappingList.cpp +++ lldb/trunk/source/Target/PathMappingList.cpp @@ -14,11 +14,11 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Error.h" -#include "lldb/Core/Stream.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/PosixApi.h" #include "lldb/Target/PathMappingList.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/Platform.cpp =================================================================== --- lldb/trunk/source/Target/Platform.cpp +++ lldb/trunk/source/Target/Platform.cpp @@ -23,7 +23,6 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Debugger.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -41,6 +40,7 @@ #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/UnixSignals.h" +#include "lldb/Utility/Error.h" // Define these constants from POSIX mman.h rather than include the file // so that they will be correct even when compiled on Linux. Index: lldb/trunk/source/Target/ProcessInfo.cpp =================================================================== --- lldb/trunk/source/Target/ProcessInfo.cpp +++ lldb/trunk/source/Target/ProcessInfo.cpp @@ -15,8 +15,8 @@ // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Host/PosixApi.h" +#include "lldb/Utility/Stream.h" #include "llvm/ADT/SmallString.h" Index: lldb/trunk/source/Target/SectionLoadHistory.cpp =================================================================== --- lldb/trunk/source/Target/SectionLoadHistory.cpp +++ lldb/trunk/source/Target/SectionLoadHistory.cpp @@ -13,8 +13,8 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/Core/Stream.h" #include "lldb/Target/SectionLoadList.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/SectionLoadList.cpp =================================================================== --- lldb/trunk/source/Target/SectionLoadList.cpp +++ lldb/trunk/source/Target/SectionLoadList.cpp @@ -16,10 +16,10 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/StackID.cpp =================================================================== --- lldb/trunk/source/Target/StackID.cpp +++ lldb/trunk/source/Target/StackID.cpp @@ -12,10 +12,10 @@ // Other libraries and framework includes // Project includes #include "lldb/Target/StackID.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Symbol/SymbolContext.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; Index: lldb/trunk/source/Target/StopInfo.cpp =================================================================== --- lldb/trunk/source/Target/StopInfo.cpp +++ lldb/trunk/source/Target/StopInfo.cpp @@ -19,7 +19,6 @@ #include "lldb/Breakpoint/Watchpoint.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/UserExpression.h" #include "lldb/Target/Process.h" @@ -28,6 +27,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/UnixSignals.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/Target.cpp =================================================================== --- lldb/trunk/source/Target/Target.cpp +++ lldb/trunk/source/Target/Target.cpp @@ -31,7 +31,6 @@ #include "lldb/Core/SourceManager.h" #include "lldb/Core/State.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObject.h" #include "lldb/Expression/REPL.h" @@ -58,6 +57,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadSpec.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/Thread.cpp =================================================================== --- lldb/trunk/source/Target/Thread.cpp +++ lldb/trunk/source/Target/Thread.cpp @@ -19,10 +19,7 @@ #include "lldb/Core/FormatEntity.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/State.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" #include "lldb/Core/ValueObject.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/OptionValueFileSpecList.h" @@ -51,6 +48,9 @@ #include "lldb/Target/ThreadPlanStepUntil.h" #include "lldb/Target/ThreadSpec.h" #include "lldb/Target/Unwind.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanBase.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanBase.cpp +++ lldb/trunk/source/Target/ThreadPlanBase.cpp @@ -19,10 +19,10 @@ #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp +++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp @@ -17,7 +17,6 @@ #include "lldb/Core/Address.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/ABI.h" #include "lldb/Target/LanguageRuntime.h" @@ -27,6 +26,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanRunToAddress.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanCallFunctionUsingABI.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanCallFunctionUsingABI.cpp +++ lldb/trunk/source/Target/ThreadPlanCallFunctionUsingABI.cpp @@ -14,11 +14,11 @@ #include "lldb/Target/ThreadPlanCallFunctionUsingABI.h" #include "lldb/Core/Address.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp +++ lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp @@ -18,7 +18,6 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Address.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Expression/DiagnosticManager.h" #include "lldb/Expression/IRDynamicChecks.h" #include "lldb/Expression/UserExpression.h" @@ -30,6 +29,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanRunToAddress.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp +++ lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp @@ -13,11 +13,11 @@ // Project includes #include "lldb/Target/ThreadPlanRunToAddress.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp +++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp @@ -14,8 +14,6 @@ #include "lldb/Target/ThreadPlanStepInRange.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" -#include "lldb/Core/RegularExpression.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Target/Process.h" @@ -24,6 +22,8 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Target/ThreadPlanStepThrough.h" +#include "lldb/Utility/RegularExpression.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp +++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp @@ -13,12 +13,12 @@ // Project includes #include "lldb/Target/ThreadPlanStepInstruction.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp @@ -14,9 +14,9 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp +++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp @@ -13,7 +13,6 @@ // Project includes #include "lldb/Target/ThreadPlanStepOverRange.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" @@ -24,6 +23,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanStepOut.h" #include "lldb/Target/ThreadPlanStepThrough.h" +#include "lldb/Utility/Stream.h" using namespace lldb_private; using namespace lldb; Index: lldb/trunk/source/Target/ThreadPlanStepRange.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanStepRange.cpp +++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp @@ -16,7 +16,6 @@ #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Disassembler.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" #include "lldb/Target/ExecutionContext.h" @@ -26,6 +25,7 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlanRunToAddress.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Target/ThreadPlanStepThrough.cpp =================================================================== --- lldb/trunk/source/Target/ThreadPlanStepThrough.cpp +++ lldb/trunk/source/Target/ThreadPlanStepThrough.cpp @@ -14,12 +14,12 @@ #include "lldb/Target/ThreadPlanStepThrough.h" #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Stream.h" #include "lldb/Target/DynamicLoader.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/Stream.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/source/Utility/CMakeLists.txt =================================================================== --- lldb/trunk/source/Utility/CMakeLists.txt +++ lldb/trunk/source/Utility/CMakeLists.txt @@ -1,4 +1,6 @@ add_lldb_library(lldbUtility + ConstString.cpp + Error.cpp JSON.cpp LLDBAssert.cpp ModuleCache.cpp @@ -6,8 +8,11 @@ PseudoTerminal.cpp Range.cpp RegisterNumber.cpp + RegularExpression.cpp SelectHelper.cpp SharingPtr.cpp + Stream.cpp + StreamString.cpp StringExtractor.cpp StringExtractorGDBRemote.cpp StringLexer.cpp Index: lldb/trunk/source/Utility/ConstString.cpp =================================================================== --- lldb/trunk/source/Utility/ConstString.cpp +++ lldb/trunk/source/Utility/ConstString.cpp @@ -0,0 +1,336 @@ +//===-- ConstString.cpp -----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Utility/ConstString.h" + +// C Includes +// C++ Includes +#include +#include + +// Other libraries and framework includes +#include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/Support/RWMutex.h" + +// Project includes +#include "lldb/Utility/Stream.h" + +using namespace lldb_private; + +class Pool { +public: + typedef const char *StringPoolValueType; + typedef llvm::StringMap + StringPool; + typedef llvm::StringMapEntry StringPoolEntryType; + + static StringPoolEntryType & + GetStringMapEntryFromKeyData(const char *keyData) { + char *ptr = const_cast(keyData) - sizeof(StringPoolEntryType); + return *reinterpret_cast(ptr); + } + + size_t GetConstCStringLength(const char *ccstr) const { + if (ccstr != nullptr) { + const uint8_t h = hash(llvm::StringRef(ccstr)); + llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); + const StringPoolEntryType &entry = GetStringMapEntryFromKeyData(ccstr); + return entry.getKey().size(); + } + return 0; + } + + StringPoolValueType GetMangledCounterpart(const char *ccstr) const { + if (ccstr != nullptr) { + const uint8_t h = hash(llvm::StringRef(ccstr)); + llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); + return GetStringMapEntryFromKeyData(ccstr).getValue(); + } + return nullptr; + } + + bool SetMangledCounterparts(const char *key_ccstr, const char *value_ccstr) { + if (key_ccstr != nullptr && value_ccstr != nullptr) { + { + const uint8_t h = hash(llvm::StringRef(key_ccstr)); + llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); + GetStringMapEntryFromKeyData(key_ccstr).setValue(value_ccstr); + } + { + const uint8_t h = hash(llvm::StringRef(value_ccstr)); + llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); + GetStringMapEntryFromKeyData(value_ccstr).setValue(key_ccstr); + } + return true; + } + return false; + } + + const char *GetConstCString(const char *cstr) { + if (cstr != nullptr) + return GetConstCStringWithLength(cstr, strlen(cstr)); + return nullptr; + } + + const char *GetConstCStringWithLength(const char *cstr, size_t cstr_len) { + if (cstr != nullptr) + return GetConstCStringWithStringRef(llvm::StringRef(cstr, cstr_len)); + return nullptr; + } + + const char *GetConstCStringWithStringRef(const llvm::StringRef &string_ref) { + if (string_ref.data()) { + const uint8_t h = hash(string_ref); + + { + llvm::sys::SmartScopedReader rlock(m_string_pools[h].m_mutex); + auto it = m_string_pools[h].m_string_map.find(string_ref); + if (it != m_string_pools[h].m_string_map.end()) + return it->getKeyData(); + } + + llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); + StringPoolEntryType &entry = + *m_string_pools[h] + .m_string_map.insert(std::make_pair(string_ref, nullptr)) + .first; + return entry.getKeyData(); + } + return nullptr; + } + + const char * + GetConstCStringAndSetMangledCounterPart(const char *demangled_cstr, + const char *mangled_ccstr) { + if (demangled_cstr != nullptr) { + const char *demangled_ccstr = nullptr; + + { + llvm::StringRef string_ref(demangled_cstr); + const uint8_t h = hash(string_ref); + llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); + + // Make string pool entry with the mangled counterpart already set + StringPoolEntryType &entry = + *m_string_pools[h] + .m_string_map.insert(std::make_pair(string_ref, mangled_ccstr)) + .first; + + // Extract the const version of the demangled_cstr + demangled_ccstr = entry.getKeyData(); + } + + { + // Now assign the demangled const string as the counterpart of the + // mangled const string... + const uint8_t h = hash(llvm::StringRef(mangled_ccstr)); + llvm::sys::SmartScopedWriter wlock(m_string_pools[h].m_mutex); + GetStringMapEntryFromKeyData(mangled_ccstr).setValue(demangled_ccstr); + } + + // Return the constant demangled C string + return demangled_ccstr; + } + return nullptr; + } + + const char *GetConstTrimmedCStringWithLength(const char *cstr, + size_t cstr_len) { + if (cstr != nullptr) { + const size_t trimmed_len = std::min(strlen(cstr), cstr_len); + return GetConstCStringWithLength(cstr, trimmed_len); + } + return nullptr; + } + + //------------------------------------------------------------------ + // Return the size in bytes that this object and any items in its + // collection of uniqued strings + data count values takes in + // memory. + //------------------------------------------------------------------ + size_t MemorySize() const { + size_t mem_size = sizeof(Pool); + for (const auto &pool : m_string_pools) { + llvm::sys::SmartScopedReader rlock(pool.m_mutex); + for (const auto &entry : pool.m_string_map) + mem_size += sizeof(StringPoolEntryType) + entry.getKey().size(); + } + return mem_size; + } + +protected: + uint8_t hash(const llvm::StringRef &s) const { + uint32_t h = llvm::HashString(s); + return ((h >> 24) ^ (h >> 16) ^ (h >> 8) ^ h) & 0xff; + } + + struct PoolEntry { + mutable llvm::sys::SmartRWMutex m_mutex; + StringPool m_string_map; + }; + + std::array m_string_pools; +}; + +//---------------------------------------------------------------------- +// Frameworks and dylibs aren't supposed to have global C++ +// initializers so we hide the string pool in a static function so +// that it will get initialized on the first call to this static +// function. +// +// Note, for now we make the string pool a pointer to the pool, because +// we can't guarantee that some objects won't get destroyed after the +// global destructor chain is run, and trying to make sure no destructors +// touch ConstStrings is difficult. So we leak the pool instead. +//---------------------------------------------------------------------- +static Pool &StringPool() { + static std::once_flag g_pool_initialization_flag; + static Pool *g_string_pool = nullptr; + + std::call_once(g_pool_initialization_flag, + []() { g_string_pool = new Pool(); }); + + return *g_string_pool; +} + +ConstString::ConstString(const char *cstr) + : m_string(StringPool().GetConstCString(cstr)) {} + +ConstString::ConstString(const char *cstr, size_t cstr_len) + : m_string(StringPool().GetConstCStringWithLength(cstr, cstr_len)) {} + +ConstString::ConstString(const llvm::StringRef &s) + : m_string(StringPool().GetConstCStringWithLength(s.data(), s.size())) {} + +bool ConstString::operator<(const ConstString &rhs) const { + if (m_string == rhs.m_string) + return false; + + llvm::StringRef lhs_string_ref(m_string, + StringPool().GetConstCStringLength(m_string)); + llvm::StringRef rhs_string_ref( + rhs.m_string, StringPool().GetConstCStringLength(rhs.m_string)); + + // If both have valid C strings, then return the comparison + if (lhs_string_ref.data() && rhs_string_ref.data()) + return lhs_string_ref < rhs_string_ref; + + // Else one of them was nullptr, so if LHS is nullptr then it is less than + return lhs_string_ref.data() == nullptr; +} + +Stream &lldb_private::operator<<(Stream &s, const ConstString &str) { + const char *cstr = str.GetCString(); + if (cstr != nullptr) + s << cstr; + + return s; +} + +size_t ConstString::GetLength() const { + return StringPool().GetConstCStringLength(m_string); +} + +bool ConstString::Equals(const ConstString &lhs, const ConstString &rhs, + const bool case_sensitive) { + if (lhs.m_string == rhs.m_string) + return true; + + // Since the pointers weren't equal, and identical ConstStrings always have + // identical pointers, + // the result must be false for case sensitive equality test. + if (case_sensitive) + return false; + + // perform case insensitive equality test + llvm::StringRef lhs_string_ref( + lhs.m_string, StringPool().GetConstCStringLength(lhs.m_string)); + llvm::StringRef rhs_string_ref( + rhs.m_string, StringPool().GetConstCStringLength(rhs.m_string)); + return lhs_string_ref.equals_lower(rhs_string_ref); +} + +int ConstString::Compare(const ConstString &lhs, const ConstString &rhs, + const bool case_sensitive) { + // If the iterators are the same, this is the same string + const char *lhs_cstr = lhs.m_string; + const char *rhs_cstr = rhs.m_string; + if (lhs_cstr == rhs_cstr) + return 0; + if (lhs_cstr && rhs_cstr) { + llvm::StringRef lhs_string_ref( + lhs_cstr, StringPool().GetConstCStringLength(lhs_cstr)); + llvm::StringRef rhs_string_ref( + rhs_cstr, StringPool().GetConstCStringLength(rhs_cstr)); + + if (case_sensitive) { + return lhs_string_ref.compare(rhs_string_ref); + } else { + return lhs_string_ref.compare_lower(rhs_string_ref); + } + } + + if (lhs_cstr) + return +1; // LHS isn't nullptr but RHS is + else + return -1; // LHS is nullptr but RHS isn't +} + +void ConstString::Dump(Stream *s, const char *fail_value) const { + if (s != nullptr) { + const char *cstr = AsCString(fail_value); + if (cstr != nullptr) + s->PutCString(cstr); + } +} + +void ConstString::DumpDebug(Stream *s) const { + const char *cstr = GetCString(); + size_t cstr_len = GetLength(); + // Only print the parens if we have a non-nullptr string + const char *parens = cstr ? "\"" : ""; + s->Printf("%*p: ConstString, string = %s%s%s, length = %" PRIu64, + static_cast(sizeof(void *) * 2), + static_cast(this), parens, cstr, parens, + static_cast(cstr_len)); +} + +void ConstString::SetCString(const char *cstr) { + m_string = StringPool().GetConstCString(cstr); +} + +void ConstString::SetString(const llvm::StringRef &s) { + m_string = StringPool().GetConstCStringWithLength(s.data(), s.size()); +} + +void ConstString::SetCStringWithMangledCounterpart(const char *demangled, + const ConstString &mangled) { + m_string = StringPool().GetConstCStringAndSetMangledCounterPart( + demangled, mangled.m_string); +} + +bool ConstString::GetMangledCounterpart(ConstString &counterpart) const { + counterpart.m_string = StringPool().GetMangledCounterpart(m_string); + return (bool)counterpart; +} + +void ConstString::SetCStringWithLength(const char *cstr, size_t cstr_len) { + m_string = StringPool().GetConstCStringWithLength(cstr, cstr_len); +} + +void ConstString::SetTrimmedCStringWithLength(const char *cstr, + size_t cstr_len) { + m_string = StringPool().GetConstTrimmedCStringWithLength(cstr, cstr_len); +} + +size_t ConstString::StaticMemorySize() { + // Get the size of the static string pool + return StringPool().MemorySize(); +} Index: lldb/trunk/source/Utility/Error.cpp =================================================================== --- lldb/trunk/source/Utility/Error.cpp +++ lldb/trunk/source/Utility/Error.cpp @@ -0,0 +1,336 @@ +//===-- Error.cpp -----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// C Includes +#ifdef __APPLE__ +#include +#endif + +// C++ Includes +#include +#include + +// Other libraries and framework includes +#include "llvm/ADT/SmallVector.h" + +// Project includes +#include "lldb/Core/Log.h" +#include "lldb/Host/PosixApi.h" +#include "lldb/Utility/Error.h" + +using namespace lldb; +using namespace lldb_private; + +Error::Error() : m_code(0), m_type(eErrorTypeInvalid), m_string() {} + +Error::Error(ValueType err, ErrorType type) + : m_code(err), m_type(type), m_string() {} + +Error::Error(const Error &rhs) = default; + +Error::Error(const char *format, ...) + : m_code(0), m_type(eErrorTypeInvalid), m_string() { + va_list args; + va_start(args, format); + SetErrorToGenericError(); + SetErrorStringWithVarArg(format, args); + va_end(args); +} + +//---------------------------------------------------------------------- +// Assignment operator +//---------------------------------------------------------------------- +const Error &Error::operator=(const Error &rhs) { + if (this != &rhs) { + m_code = rhs.m_code; + m_type = rhs.m_type; + m_string = rhs.m_string; + } + return *this; +} + +//---------------------------------------------------------------------- +// Assignment operator +//---------------------------------------------------------------------- +const Error &Error::operator=(uint32_t err) { + m_code = err; + m_type = eErrorTypeMachKernel; + m_string.clear(); + return *this; +} + +Error::~Error() = default; + +//---------------------------------------------------------------------- +// Get the error value as a NULL C string. The error string will be +// fetched and cached on demand. The cached error string value will +// remain until the error value is changed or cleared. +//---------------------------------------------------------------------- +const char *Error::AsCString(const char *default_error_str) const { + if (Success()) + return nullptr; + + if (m_string.empty()) { + const char *s = nullptr; + switch (m_type) { + case eErrorTypeMachKernel: +#if defined(__APPLE__) + s = ::mach_error_string(m_code); +#endif + break; + + case eErrorTypePOSIX: + s = ::strerror(m_code); + break; + + default: + break; + } + if (s != nullptr) + m_string.assign(s); + } + if (m_string.empty()) { + if (default_error_str) + m_string.assign(default_error_str); + else + return nullptr; // User wanted a nullptr string back... + } + return m_string.c_str(); +} + +//---------------------------------------------------------------------- +// Clear the error and any cached error string that it might contain. +//---------------------------------------------------------------------- +void Error::Clear() { + m_code = 0; + m_type = eErrorTypeInvalid; + m_string.clear(); +} + +//---------------------------------------------------------------------- +// Access the error value. +//---------------------------------------------------------------------- +Error::ValueType Error::GetError() const { return m_code; } + +//---------------------------------------------------------------------- +// Access the error type. +//---------------------------------------------------------------------- +ErrorType Error::GetType() const { return m_type; } + +//---------------------------------------------------------------------- +// Returns true if this object contains a value that describes an +// error or otherwise non-success result. +//---------------------------------------------------------------------- +bool Error::Fail() const { return m_code != 0; } + +//---------------------------------------------------------------------- +// Log the error given a string with format. If the this object +// contains an error code, update the error string to contain the +// "error: " followed by the formatted string, followed by the error +// value and any string that describes the current error. This +// allows more context to be given to an error string that remains +// cached in this object. Logging always occurs even when the error +// code contains a non-error value. +//---------------------------------------------------------------------- +void Error::PutToLog(Log *log, const char *format, ...) { + char *arg_msg = nullptr; + va_list args; + va_start(args, format); + ::vasprintf(&arg_msg, format, args); + va_end(args); + + if (arg_msg != nullptr) { + if (Fail()) { + const char *err_str = AsCString(); + if (err_str == nullptr) + err_str = "???"; + + SetErrorStringWithFormat("error: %s err = %s (0x%8.8x)", arg_msg, err_str, + m_code); + if (log != nullptr) + log->Error("%s", m_string.c_str()); + } else { + if (log != nullptr) + log->Printf("%s err = 0x%8.8x", arg_msg, m_code); + } + ::free(arg_msg); + } +} + +//---------------------------------------------------------------------- +// Log the error given a string with format. If the this object +// contains an error code, update the error string to contain the +// "error: " followed by the formatted string, followed by the error +// value and any string that describes the current error. This +// allows more context to be given to an error string that remains +// cached in this object. Logging only occurs even when the error +// code contains a error value. +//---------------------------------------------------------------------- +void Error::LogIfError(Log *log, const char *format, ...) { + if (Fail()) { + char *arg_msg = nullptr; + va_list args; + va_start(args, format); + ::vasprintf(&arg_msg, format, args); + va_end(args); + + if (arg_msg != nullptr) { + const char *err_str = AsCString(); + if (err_str == nullptr) + err_str = "???"; + + SetErrorStringWithFormat("%s err = %s (0x%8.8x)", arg_msg, err_str, + m_code); + if (log != nullptr) + log->Error("%s", m_string.c_str()); + + ::free(arg_msg); + } + } +} + +//---------------------------------------------------------------------- +// Set accesssor for the error value to "err" and the type to +// "eErrorTypeMachKernel" +//---------------------------------------------------------------------- +void Error::SetMachError(uint32_t err) { + m_code = err; + m_type = eErrorTypeMachKernel; + m_string.clear(); +} + +void Error::SetExpressionError(lldb::ExpressionResults result, + const char *mssg) { + m_code = result; + m_type = eErrorTypeExpression; + m_string = mssg; +} + +int Error::SetExpressionErrorWithFormat(lldb::ExpressionResults result, + const char *format, ...) { + int length = 0; + + if (format != nullptr && format[0]) { + va_list args; + va_start(args, format); + length = SetErrorStringWithVarArg(format, args); + va_end(args); + } else { + m_string.clear(); + } + m_code = result; + m_type = eErrorTypeExpression; + return length; +} + +//---------------------------------------------------------------------- +// Set accesssor for the error value and type. +//---------------------------------------------------------------------- +void Error::SetError(ValueType err, ErrorType type) { + m_code = err; + m_type = type; + m_string.clear(); +} + +//---------------------------------------------------------------------- +// Update the error value to be "errno" and update the type to +// be "POSIX". +//---------------------------------------------------------------------- +void Error::SetErrorToErrno() { + m_code = errno; + m_type = eErrorTypePOSIX; + m_string.clear(); +} + +//---------------------------------------------------------------------- +// Update the error value to be LLDB_GENERIC_ERROR and update the type +// to be "Generic". +//---------------------------------------------------------------------- +void Error::SetErrorToGenericError() { + m_code = LLDB_GENERIC_ERROR; + m_type = eErrorTypeGeneric; + m_string.clear(); +} + +//---------------------------------------------------------------------- +// Set accessor for the error string value for a specific error. +// This allows any string to be supplied as an error explanation. +// The error string value will remain until the error value is +// cleared or a new error value/type is assigned. +//---------------------------------------------------------------------- +void Error::SetErrorString(llvm::StringRef err_str) { + if (!err_str.empty()) { + // If we have an error string, we should always at least have an error + // set to a generic value. + if (Success()) + SetErrorToGenericError(); + } + m_string = err_str; +} + +//------------------------------------------------------------------ +/// Set the current error string to a formatted error string. +/// +/// @param format +/// A printf style format string +//------------------------------------------------------------------ +int Error::SetErrorStringWithFormat(const char *format, ...) { + if (format != nullptr && format[0]) { + va_list args; + va_start(args, format); + int length = SetErrorStringWithVarArg(format, args); + va_end(args); + return length; + } else { + m_string.clear(); + } + return 0; +} + +int Error::SetErrorStringWithVarArg(const char *format, va_list args) { + if (format != nullptr && format[0]) { + // If we have an error string, we should always at least have + // an error set to a generic value. + if (Success()) + SetErrorToGenericError(); + + // Try and fit our error into a 1024 byte buffer first... + llvm::SmallVector buf; + buf.resize(1024); + // Copy in case our first call to vsnprintf doesn't fit into our + // allocated buffer above + va_list copy_args; + va_copy(copy_args, args); + unsigned length = ::vsnprintf(buf.data(), buf.size(), format, args); + if (length >= buf.size()) { + // The error formatted string didn't fit into our buffer, resize it + // to the exact needed size, and retry + buf.resize(length + 1); + length = ::vsnprintf(buf.data(), buf.size(), format, copy_args); + va_end(copy_args); + assert(length < buf.size()); + } + m_string.assign(buf.data(), length); + va_end(args); + return length; + } else { + m_string.clear(); + } + return 0; +} + +//---------------------------------------------------------------------- +// Returns true if the error code in this object is considered a +// successful return value. +//---------------------------------------------------------------------- +bool Error::Success() const { return m_code == 0; } + +bool Error::WasInterrupted() const { + return (m_type == eErrorTypePOSIX && m_code == EINTR); +} Index: lldb/trunk/source/Utility/JSON.cpp =================================================================== --- lldb/trunk/source/Utility/JSON.cpp +++ lldb/trunk/source/Utility/JSON.cpp @@ -9,8 +9,8 @@ #include "lldb/Utility/JSON.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/StreamString.h" #include "llvm/Support/ErrorHandling.h" #include Index: lldb/trunk/source/Utility/ModuleCache.h =================================================================== --- lldb/trunk/source/Utility/ModuleCache.h +++ lldb/trunk/source/Utility/ModuleCache.h @@ -13,9 +13,9 @@ #include "lldb/lldb-forward.h" #include "lldb/lldb-types.h" -#include "lldb/Core/Error.h" #include "lldb/Host/File.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Utility/Error.h" #include #include Index: lldb/trunk/source/Utility/NameMatches.cpp =================================================================== --- lldb/trunk/source/Utility/NameMatches.cpp +++ lldb/trunk/source/Utility/NameMatches.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// #include "lldb/Utility/NameMatches.h" -#include "lldb/Core/RegularExpression.h" +#include "lldb/Utility/RegularExpression.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/source/Utility/RegularExpression.cpp =================================================================== --- lldb/trunk/source/Utility/RegularExpression.cpp +++ lldb/trunk/source/Utility/RegularExpression.cpp @@ -0,0 +1,208 @@ +//===-- RegularExpression.cpp -----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Utility/RegularExpression.h" + +// C Includes +// C++ Includes +#include + +// Other libraries and framework includes +#include "llvm/ADT/StringRef.h" + +// Project includes +#include "lldb/Utility/Error.h" + +//---------------------------------------------------------------------- +// Enable enhanced mode if it is available. This allows for things like +// \d for digit, \s for space, and many more, but it isn't available +// everywhere. +//---------------------------------------------------------------------- +#if defined(REG_ENHANCED) +#define DEFAULT_COMPILE_FLAGS (REG_ENHANCED | REG_EXTENDED) +#else +#define DEFAULT_COMPILE_FLAGS (REG_EXTENDED) +#endif + +using namespace lldb_private; + +RegularExpression::RegularExpression() : m_re(), m_comp_err(1), m_preg() { + memset(&m_preg, 0, sizeof(m_preg)); +} + +//---------------------------------------------------------------------- +// Constructor that compiles "re" using "flags" and stores the +// resulting compiled regular expression into this object. +//---------------------------------------------------------------------- +RegularExpression::RegularExpression(llvm::StringRef str) + : m_re(), m_comp_err(1), m_preg() { + memset(&m_preg, 0, sizeof(m_preg)); + Compile(str); +} + +RegularExpression::RegularExpression(const RegularExpression &rhs) { + memset(&m_preg, 0, sizeof(m_preg)); + Compile(rhs.GetText()); +} + +const RegularExpression &RegularExpression:: +operator=(const RegularExpression &rhs) { + if (&rhs != this) + Compile(rhs.GetText()); + return *this; +} + +//---------------------------------------------------------------------- +// Destructor +// +// Any previously compiled regular expression contained in this +// object will be freed. +//---------------------------------------------------------------------- +RegularExpression::~RegularExpression() { Free(); } + +//---------------------------------------------------------------------- +// Compile a regular expression using the supplied regular +// expression text and flags. The compiled regular expression lives +// in this object so that it can be readily used for regular +// expression matches. Execute() can be called after the regular +// expression is compiled. Any previously compiled regular +// expression contained in this object will be freed. +// +// RETURNS +// True if the regular expression compiles successfully, false +// otherwise. +//---------------------------------------------------------------------- +bool RegularExpression::Compile(llvm::StringRef str) { + Free(); + + if (!str.empty()) { + m_re = str; + m_comp_err = ::regcomp(&m_preg, m_re.c_str(), DEFAULT_COMPILE_FLAGS); + } else { + // No valid regular expression + m_comp_err = 1; + } + + return m_comp_err == 0; +} + +//---------------------------------------------------------------------- +// Execute a regular expression match using the compiled regular +// expression that is already in this object against the match +// string "s". If any parens are used for regular expression +// matches "match_count" should indicate the number of regmatch_t +// values that are present in "match_ptr". The regular expression +// will be executed using the "execute_flags". +//--------------------------------------------------------------------- +bool RegularExpression::Execute(llvm::StringRef str, Match *match) const { + int err = 1; + if (m_comp_err == 0) { + // Argument to regexec must be null-terminated. + std::string reg_str = str; + if (match) { + err = ::regexec(&m_preg, reg_str.c_str(), match->GetSize(), + match->GetData(), 0); + } else { + err = ::regexec(&m_preg, reg_str.c_str(), 0, nullptr, 0); + } + } + + if (err != 0) { + // The regular expression didn't compile, so clear the matches + if (match) + match->Clear(); + return false; + } + return true; +} + +bool RegularExpression::Match::GetMatchAtIndex(llvm::StringRef s, uint32_t idx, + std::string &match_str) const { + llvm::StringRef match_str_ref; + if (GetMatchAtIndex(s, idx, match_str_ref)) { + match_str = match_str_ref.str(); + return true; + } + return false; +} + +bool RegularExpression::Match::GetMatchAtIndex( + llvm::StringRef s, uint32_t idx, llvm::StringRef &match_str) const { + if (idx < m_matches.size()) { + if (m_matches[idx].rm_eo == -1 && m_matches[idx].rm_so == -1) + return false; + + if (m_matches[idx].rm_eo == m_matches[idx].rm_so) { + // Matched the empty string... + match_str = llvm::StringRef(); + return true; + } else if (m_matches[idx].rm_eo > m_matches[idx].rm_so) { + match_str = s.substr(m_matches[idx].rm_so, + m_matches[idx].rm_eo - m_matches[idx].rm_so); + return true; + } + } + return false; +} + +bool RegularExpression::Match::GetMatchSpanningIndices( + llvm::StringRef s, uint32_t idx1, uint32_t idx2, + llvm::StringRef &match_str) const { + if (idx1 < m_matches.size() && idx2 < m_matches.size()) { + if (m_matches[idx1].rm_so == m_matches[idx2].rm_eo) { + // Matched the empty string... + match_str = llvm::StringRef(); + return true; + } else if (m_matches[idx1].rm_so < m_matches[idx2].rm_eo) { + match_str = s.substr(m_matches[idx1].rm_so, + m_matches[idx2].rm_eo - m_matches[idx1].rm_so); + return true; + } + } + return false; +} + +//---------------------------------------------------------------------- +// Returns true if the regular expression compiled and is ready +// for execution. +//---------------------------------------------------------------------- +bool RegularExpression::IsValid() const { return m_comp_err == 0; } + +//---------------------------------------------------------------------- +// Returns the text that was used to compile the current regular +// expression. +//---------------------------------------------------------------------- +llvm::StringRef RegularExpression::GetText() const { return m_re; } + +//---------------------------------------------------------------------- +// Free any contained compiled regular expressions. +//---------------------------------------------------------------------- +void RegularExpression::Free() { + if (m_comp_err == 0) { + m_re.clear(); + regfree(&m_preg); + // Set a compile error since we no longer have a valid regex + m_comp_err = 1; + } +} + +size_t RegularExpression::GetErrorAsCString(char *err_str, + size_t err_str_max_len) const { + if (m_comp_err == 0) { + if (err_str && err_str_max_len) + *err_str = '\0'; + return 0; + } + + return ::regerror(m_comp_err, &m_preg, err_str, err_str_max_len); +} + +bool RegularExpression::operator<(const RegularExpression &rhs) const { + return (m_re < rhs.m_re); +} Index: lldb/trunk/source/Utility/SelectHelper.cpp =================================================================== --- lldb/trunk/source/Utility/SelectHelper.cpp +++ lldb/trunk/source/Utility/SelectHelper.cpp @@ -31,7 +31,7 @@ #include "llvm/ADT/SmallVector.h" // Project includes -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/SelectHelper.h" Index: lldb/trunk/source/Utility/Stream.cpp =================================================================== --- lldb/trunk/source/Utility/Stream.cpp +++ lldb/trunk/source/Utility/Stream.cpp @@ -0,0 +1,613 @@ +//===-- Stream.cpp ----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Utility/Stream.h" +#include "lldb/Host/Endian.h" +#include "lldb/Host/PosixApi.h" +#include +#include +#include +#include + +#include + +using namespace lldb; +using namespace lldb_private; + +Stream::Stream(uint32_t flags, uint32_t addr_size, ByteOrder byte_order) + : m_flags(flags), m_addr_size(addr_size), m_byte_order(byte_order), + m_indent_level(0) {} + +Stream::Stream() + : m_flags(0), m_addr_size(4), m_byte_order(endian::InlHostByteOrder()), + m_indent_level(0) {} + +//------------------------------------------------------------------ +// Destructor +//------------------------------------------------------------------ +Stream::~Stream() {} + +ByteOrder Stream::SetByteOrder(ByteOrder byte_order) { + ByteOrder old_byte_order = m_byte_order; + m_byte_order = byte_order; + return old_byte_order; +} + +//------------------------------------------------------------------ +// Put an offset "uval" out to the stream using the printf format +// in "format". +//------------------------------------------------------------------ +void Stream::Offset(uint32_t uval, const char *format) { Printf(format, uval); } + +//------------------------------------------------------------------ +// Put an SLEB128 "uval" out to the stream using the printf format +// in "format". +//------------------------------------------------------------------ +size_t Stream::PutSLEB128(int64_t sval) { + size_t bytes_written = 0; + if (m_flags.Test(eBinary)) { + bool more = true; + while (more) { + uint8_t byte = sval & 0x7fu; + sval >>= 7; + /* sign bit of byte is 2nd high order bit (0x40) */ + if ((sval == 0 && !(byte & 0x40)) || (sval == -1 && (byte & 0x40))) + more = false; + else + // more bytes to come + byte |= 0x80u; + bytes_written += Write(&byte, 1); + } + } else { + bytes_written = Printf("0x%" PRIi64, sval); + } + + return bytes_written; +} + +//------------------------------------------------------------------ +// Put an ULEB128 "uval" out to the stream using the printf format +// in "format". +//------------------------------------------------------------------ +size_t Stream::PutULEB128(uint64_t uval) { + size_t bytes_written = 0; + if (m_flags.Test(eBinary)) { + do { + + uint8_t byte = uval & 0x7fu; + uval >>= 7; + if (uval != 0) { + // more bytes to come + byte |= 0x80u; + } + bytes_written += Write(&byte, 1); + } while (uval != 0); + } else { + bytes_written = Printf("0x%" PRIx64, uval); + } + return bytes_written; +} + +//------------------------------------------------------------------ +// Print a raw NULL terminated C string to the stream. +//------------------------------------------------------------------ +size_t Stream::PutCString(llvm::StringRef str) { + size_t bytes_written = 0; + bytes_written = Write(str.data(), str.size()); + + // when in binary mode, emit the NULL terminator + if (m_flags.Test(eBinary)) + bytes_written += PutChar('\0'); + return bytes_written; +} + +//------------------------------------------------------------------ +// Print a double quoted NULL terminated C string to the stream +// using the printf format in "format". +//------------------------------------------------------------------ +void Stream::QuotedCString(const char *cstr, const char *format) { + Printf(format, cstr); +} + +//------------------------------------------------------------------ +// Put an address "addr" out to the stream with optional prefix +// and suffix strings. +//------------------------------------------------------------------ +void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix, + const char *suffix) { + if (prefix == NULL) + prefix = ""; + if (suffix == NULL) + suffix = ""; + // int addr_width = m_addr_size << 1; + // Printf ("%s0x%0*" PRIx64 "%s", prefix, addr_width, addr, suffix); + Printf("%s0x%0*" PRIx64 "%s", prefix, addr_size * 2, (uint64_t)addr, suffix); +} + +//------------------------------------------------------------------ +// Put an address range out to the stream with optional prefix +// and suffix strings. +//------------------------------------------------------------------ +void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, + uint32_t addr_size, const char *prefix, + const char *suffix) { + if (prefix && prefix[0]) + PutCString(prefix); + Address(lo_addr, addr_size, "["); + Address(hi_addr, addr_size, "-", ")"); + if (suffix && suffix[0]) + PutCString(suffix); +} + +size_t Stream::PutChar(char ch) { return Write(&ch, 1); } + +//------------------------------------------------------------------ +// Print some formatted output to the stream. +//------------------------------------------------------------------ +size_t Stream::Printf(const char *format, ...) { + va_list args; + va_start(args, format); + size_t result = PrintfVarArg(format, args); + va_end(args); + return result; +} + +//------------------------------------------------------------------ +// Print some formatted output to the stream. +//------------------------------------------------------------------ +size_t Stream::PrintfVarArg(const char *format, va_list args) { + char str[1024]; + va_list args_copy; + + va_copy(args_copy, args); + + size_t bytes_written = 0; + // Try and format our string into a fixed buffer first and see if it fits + size_t length = ::vsnprintf(str, sizeof(str), format, args); + if (length < sizeof(str)) { + // Include the NULL termination byte for binary output + if (m_flags.Test(eBinary)) + length += 1; + // The formatted string fit into our stack based buffer, so we can just + // append that to our packet + bytes_written = Write(str, length); + } else { + // Our stack buffer wasn't big enough to contain the entire formatted + // string, so lets let vasprintf create the string for us! + char *str_ptr = NULL; + length = ::vasprintf(&str_ptr, format, args_copy); + if (str_ptr) { + // Include the NULL termination byte for binary output + if (m_flags.Test(eBinary)) + length += 1; + bytes_written = Write(str_ptr, length); + ::free(str_ptr); + } + } + va_end(args_copy); + return bytes_written; +} + +//------------------------------------------------------------------ +// Print and End of Line character to the stream +//------------------------------------------------------------------ +size_t Stream::EOL() { return PutChar('\n'); } + +//------------------------------------------------------------------ +// Indent the current line using the current indentation level and +// print an optional string following the indentation spaces. +//------------------------------------------------------------------ +size_t Stream::Indent(const char *s) { + return Printf("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : ""); +} + +size_t Stream::Indent(llvm::StringRef str) { + return Printf("%*.*s%s", m_indent_level, m_indent_level, "", + str.str().c_str()); +} + +//------------------------------------------------------------------ +// Stream a character "ch" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(char ch) { + PutChar(ch); + return *this; +} + +//------------------------------------------------------------------ +// Stream the NULL terminated C string out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(const char *s) { + Printf("%s", s); + return *this; +} + +Stream &Stream::operator<<(llvm::StringRef str) { + Write(str.data(), str.size()); + return *this; +} + +//------------------------------------------------------------------ +// Stream the pointer value out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(const void *p) { + Printf("0x%.*tx", (int)sizeof(const void *) * 2, (ptrdiff_t)p); + return *this; +} + +//------------------------------------------------------------------ +// Stream a uint8_t "uval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(uint8_t uval) { + PutHex8(uval); + return *this; +} + +//------------------------------------------------------------------ +// Stream a uint16_t "uval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(uint16_t uval) { + PutHex16(uval, m_byte_order); + return *this; +} + +//------------------------------------------------------------------ +// Stream a uint32_t "uval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(uint32_t uval) { + PutHex32(uval, m_byte_order); + return *this; +} + +//------------------------------------------------------------------ +// Stream a uint64_t "uval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(uint64_t uval) { + PutHex64(uval, m_byte_order); + return *this; +} + +//------------------------------------------------------------------ +// Stream a int8_t "sval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(int8_t sval) { + Printf("%i", (int)sval); + return *this; +} + +//------------------------------------------------------------------ +// Stream a int16_t "sval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(int16_t sval) { + Printf("%i", (int)sval); + return *this; +} + +//------------------------------------------------------------------ +// Stream a int32_t "sval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(int32_t sval) { + Printf("%i", (int)sval); + return *this; +} + +//------------------------------------------------------------------ +// Stream a int64_t "sval" out to this stream. +//------------------------------------------------------------------ +Stream &Stream::operator<<(int64_t sval) { + Printf("%" PRIi64, sval); + return *this; +} + +//------------------------------------------------------------------ +// Get the current indentation level +//------------------------------------------------------------------ +int Stream::GetIndentLevel() const { return m_indent_level; } + +//------------------------------------------------------------------ +// Set the current indentation level +//------------------------------------------------------------------ +void Stream::SetIndentLevel(int indent_level) { m_indent_level = indent_level; } + +//------------------------------------------------------------------ +// Increment the current indentation level +//------------------------------------------------------------------ +void Stream::IndentMore(int amount) { m_indent_level += amount; } + +//------------------------------------------------------------------ +// Decrement the current indentation level +//------------------------------------------------------------------ +void Stream::IndentLess(int amount) { + if (m_indent_level >= amount) + m_indent_level -= amount; + else + m_indent_level = 0; +} + +//------------------------------------------------------------------ +// Get the address size in bytes +//------------------------------------------------------------------ +uint32_t Stream::GetAddressByteSize() const { return m_addr_size; } + +//------------------------------------------------------------------ +// Set the address size in bytes +//------------------------------------------------------------------ +void Stream::SetAddressByteSize(uint32_t addr_size) { m_addr_size = addr_size; } + +//------------------------------------------------------------------ +// The flags get accessor +//------------------------------------------------------------------ +Flags &Stream::GetFlags() { return m_flags; } + +//------------------------------------------------------------------ +// The flags const get accessor +//------------------------------------------------------------------ +const Flags &Stream::GetFlags() const { return m_flags; } + +//------------------------------------------------------------------ +// The byte order get accessor +//------------------------------------------------------------------ + +lldb::ByteOrder Stream::GetByteOrder() const { return m_byte_order; } + +size_t Stream::PrintfAsRawHex8(const char *format, ...) { + va_list args; + va_list args_copy; + va_start(args, format); + va_copy(args_copy, args); // Copy this so we + + char str[1024]; + size_t bytes_written = 0; + // Try and format our string into a fixed buffer first and see if it fits + size_t length = ::vsnprintf(str, sizeof(str), format, args); + if (length < sizeof(str)) { + // The formatted string fit into our stack based buffer, so we can just + // append that to our packet + for (size_t i = 0; i < length; ++i) + bytes_written += _PutHex8(str[i], false); + } else { + // Our stack buffer wasn't big enough to contain the entire formatted + // string, so lets let vasprintf create the string for us! + char *str_ptr = NULL; + length = ::vasprintf(&str_ptr, format, args_copy); + if (str_ptr) { + for (size_t i = 0; i < length; ++i) + bytes_written += _PutHex8(str_ptr[i], false); + ::free(str_ptr); + } + } + va_end(args); + va_end(args_copy); + + return bytes_written; +} + +size_t Stream::PutNHex8(size_t n, uint8_t uvalue) { + size_t bytes_written = 0; + for (size_t i = 0; i < n; ++i) + bytes_written += _PutHex8(uvalue, false); + return bytes_written; +} + +size_t Stream::_PutHex8(uint8_t uvalue, bool add_prefix) { + size_t bytes_written = 0; + if (m_flags.Test(eBinary)) { + bytes_written = Write(&uvalue, 1); + } else { + if (add_prefix) + PutCString("0x"); + + static char g_hex_to_ascii_hex_char[16] = {'0', '1', '2', '3', '4', '5', + '6', '7', '8', '9', 'a', 'b', + 'c', 'd', 'e', 'f'}; + char nibble_chars[2]; + nibble_chars[0] = g_hex_to_ascii_hex_char[(uvalue >> 4) & 0xf]; + nibble_chars[1] = g_hex_to_ascii_hex_char[(uvalue >> 0) & 0xf]; + bytes_written = Write(nibble_chars, sizeof(nibble_chars)); + } + return bytes_written; +} + +size_t Stream::PutHex8(uint8_t uvalue) { return _PutHex8(uvalue, false); } + +size_t Stream::PutHex16(uint16_t uvalue, ByteOrder byte_order) { + if (byte_order == eByteOrderInvalid) + byte_order = m_byte_order; + + size_t bytes_written = 0; + if (byte_order == eByteOrderLittle) { + for (size_t byte = 0; byte < sizeof(uvalue); ++byte) + bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); + } else { + for (size_t byte = sizeof(uvalue) - 1; byte < sizeof(uvalue); --byte) + bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); + } + return bytes_written; +} + +size_t Stream::PutHex32(uint32_t uvalue, ByteOrder byte_order) { + if (byte_order == eByteOrderInvalid) + byte_order = m_byte_order; + + size_t bytes_written = 0; + if (byte_order == eByteOrderLittle) { + for (size_t byte = 0; byte < sizeof(uvalue); ++byte) + bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); + } else { + for (size_t byte = sizeof(uvalue) - 1; byte < sizeof(uvalue); --byte) + bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); + } + return bytes_written; +} + +size_t Stream::PutHex64(uint64_t uvalue, ByteOrder byte_order) { + if (byte_order == eByteOrderInvalid) + byte_order = m_byte_order; + + size_t bytes_written = 0; + if (byte_order == eByteOrderLittle) { + for (size_t byte = 0; byte < sizeof(uvalue); ++byte) + bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); + } else { + for (size_t byte = sizeof(uvalue) - 1; byte < sizeof(uvalue); --byte) + bytes_written += _PutHex8((uint8_t)(uvalue >> (byte * 8)), false); + } + return bytes_written; +} + +size_t Stream::PutMaxHex64(uint64_t uvalue, size_t byte_size, + lldb::ByteOrder byte_order) { + switch (byte_size) { + case 1: + return PutHex8((uint8_t)uvalue); + case 2: + return PutHex16((uint16_t)uvalue); + case 4: + return PutHex32((uint32_t)uvalue); + case 8: + return PutHex64(uvalue); + } + return 0; +} + +size_t Stream::PutPointer(void *ptr) { + return PutRawBytes(&ptr, sizeof(ptr), endian::InlHostByteOrder(), + endian::InlHostByteOrder()); +} + +size_t Stream::PutFloat(float f, ByteOrder byte_order) { + if (byte_order == eByteOrderInvalid) + byte_order = m_byte_order; + + return PutRawBytes(&f, sizeof(f), endian::InlHostByteOrder(), byte_order); +} + +size_t Stream::PutDouble(double d, ByteOrder byte_order) { + if (byte_order == eByteOrderInvalid) + byte_order = m_byte_order; + + return PutRawBytes(&d, sizeof(d), endian::InlHostByteOrder(), byte_order); +} + +size_t Stream::PutLongDouble(long double ld, ByteOrder byte_order) { + if (byte_order == eByteOrderInvalid) + byte_order = m_byte_order; + + return PutRawBytes(&ld, sizeof(ld), endian::InlHostByteOrder(), byte_order); +} + +size_t Stream::PutRawBytes(const void *s, size_t src_len, + ByteOrder src_byte_order, ByteOrder dst_byte_order) { + if (src_byte_order == eByteOrderInvalid) + src_byte_order = m_byte_order; + + if (dst_byte_order == eByteOrderInvalid) + dst_byte_order = m_byte_order; + + size_t bytes_written = 0; + const uint8_t *src = (const uint8_t *)s; + bool binary_was_set = m_flags.Test(eBinary); + if (!binary_was_set) + m_flags.Set(eBinary); + if (src_byte_order == dst_byte_order) { + for (size_t i = 0; i < src_len; ++i) + bytes_written += _PutHex8(src[i], false); + } else { + for (size_t i = src_len - 1; i < src_len; --i) + bytes_written += _PutHex8(src[i], false); + } + if (!binary_was_set) + m_flags.Clear(eBinary); + + return bytes_written; +} + +size_t Stream::PutBytesAsRawHex8(const void *s, size_t src_len, + ByteOrder src_byte_order, + ByteOrder dst_byte_order) { + if (src_byte_order == eByteOrderInvalid) + src_byte_order = m_byte_order; + + if (dst_byte_order == eByteOrderInvalid) + dst_byte_order = m_byte_order; + + size_t bytes_written = 0; + const uint8_t *src = (const uint8_t *)s; + bool binary_is_set = m_flags.Test(eBinary); + m_flags.Clear(eBinary); + if (src_byte_order == dst_byte_order) { + for (size_t i = 0; i < src_len; ++i) + bytes_written += _PutHex8(src[i], false); + } else { + for (size_t i = src_len - 1; i < src_len; --i) + bytes_written += _PutHex8(src[i], false); + } + if (binary_is_set) + m_flags.Set(eBinary); + + return bytes_written; +} + +size_t Stream::PutCStringAsRawHex8(const char *s) { + size_t bytes_written = 0; + bool binary_is_set = m_flags.Test(eBinary); + m_flags.Clear(eBinary); + do { + bytes_written += _PutHex8(*s, false); + ++s; + } while (*s); + if (binary_is_set) + m_flags.Set(eBinary); + return bytes_written; +} + +void Stream::UnitTest(Stream *s) { + s->PutHex8(0x12); + + s->PutChar(' '); + s->PutHex16(0x3456, endian::InlHostByteOrder()); + s->PutChar(' '); + s->PutHex16(0x3456, eByteOrderBig); + s->PutChar(' '); + s->PutHex16(0x3456, eByteOrderLittle); + + s->PutChar(' '); + s->PutHex32(0x789abcde, endian::InlHostByteOrder()); + s->PutChar(' '); + s->PutHex32(0x789abcde, eByteOrderBig); + s->PutChar(' '); + s->PutHex32(0x789abcde, eByteOrderLittle); + + s->PutChar(' '); + s->PutHex64(0x1122334455667788ull, endian::InlHostByteOrder()); + s->PutChar(' '); + s->PutHex64(0x1122334455667788ull, eByteOrderBig); + s->PutChar(' '); + s->PutHex64(0x1122334455667788ull, eByteOrderLittle); + + const char *hola = "Hello World!!!"; + s->PutChar(' '); + s->PutCString(hola); + + s->PutChar(' '); + s->Write(hola, 5); + + s->PutChar(' '); + s->PutCStringAsRawHex8(hola); + + s->PutChar(' '); + s->PutCStringAsRawHex8("01234"); + + s->PutChar(' '); + s->Printf("pid=%i", 12733); + + s->PutChar(' '); + s->PrintfAsRawHex8("pid=%i", 12733); + s->PutChar('\n'); +} Index: lldb/trunk/source/Utility/StreamString.cpp =================================================================== --- lldb/trunk/source/Utility/StreamString.cpp +++ lldb/trunk/source/Utility/StreamString.cpp @@ -0,0 +1,65 @@ +//===-- StreamString.cpp ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Utility/StreamString.h" +#include + +using namespace lldb; +using namespace lldb_private; + +StreamString::StreamString() : Stream(0, 4, eByteOrderBig) {} + +StreamString::StreamString(uint32_t flags, uint32_t addr_size, + ByteOrder byte_order) + : Stream(flags, addr_size, byte_order), m_packet() {} + +StreamString::~StreamString() {} + +void StreamString::Flush() { + // Nothing to do when flushing a buffer based stream... +} + +size_t StreamString::Write(const void *s, size_t length) { + m_packet.append(reinterpret_cast(s), length); + return length; +} + +void StreamString::Clear() { m_packet.clear(); } + +bool StreamString::Empty() const { return GetSize() == 0; } + +size_t StreamString::GetSize() const { return m_packet.size(); } + +size_t StreamString::GetSizeOfLastLine() const { + const size_t length = m_packet.size(); + size_t last_line_begin_pos = m_packet.find_last_of("\r\n"); + if (last_line_begin_pos == std::string::npos) { + return length; + } else { + ++last_line_begin_pos; + return length - last_line_begin_pos; + } +} + +llvm::StringRef StreamString::GetString() const { return m_packet; } + +void StreamString::FillLastLineToColumn(uint32_t column, char fill_char) { + const size_t length = m_packet.size(); + size_t last_line_begin_pos = m_packet.find_last_of("\r\n"); + if (last_line_begin_pos == std::string::npos) { + last_line_begin_pos = 0; + } else { + ++last_line_begin_pos; + } + + const size_t line_columns = length - last_line_begin_pos; + if (column > line_columns) { + m_packet.append(column - line_columns, fill_char); + } +} Index: lldb/trunk/tools/argdumper/argdumper.cpp =================================================================== --- lldb/trunk/tools/argdumper/argdumper.cpp +++ lldb/trunk/tools/argdumper/argdumper.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/StreamString.h" #include "lldb/Utility/JSON.h" +#include "lldb/Utility/StreamString.h" #include Index: lldb/trunk/tools/lldb-server/Acceptor.h =================================================================== --- lldb/trunk/tools/lldb-server/Acceptor.h +++ lldb/trunk/tools/lldb-server/Acceptor.h @@ -10,8 +10,8 @@ #define lldb_server_Acceptor_h_ #include "lldb/Core/Connection.h" -#include "lldb/Core/Error.h" #include "lldb/Host/Socket.h" +#include "lldb/Utility/Error.h" #include #include Index: lldb/trunk/tools/lldb-server/Acceptor.cpp =================================================================== --- lldb/trunk/tools/lldb-server/Acceptor.cpp +++ lldb/trunk/tools/lldb-server/Acceptor.cpp @@ -12,9 +12,9 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/ScopedPrinter.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/common/TCPSocket.h" +#include "lldb/Utility/StreamString.h" #include "Utility/UriParser.h" Index: lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp =================================================================== --- lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp +++ lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp @@ -11,8 +11,8 @@ #include "lldb/Core/Log.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Core/StreamString.h" #include "lldb/Interpreter/Args.h" +#include "lldb/Utility/StreamString.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp =================================================================== --- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp +++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp @@ -28,7 +28,6 @@ #include "LLDBServerUtilities.h" #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h" #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h" -#include "lldb/Core/Error.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/HostGetOpt.h" @@ -36,6 +35,7 @@ #include "lldb/Host/Pipe.h" #include "lldb/Host/Socket.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/Error.h" #ifndef LLGS_PROGRAM_NAME #define LLGS_PROGRAM_NAME "lldb-server" Index: lldb/trunk/tools/lldb-server/lldb-platform.cpp =================================================================== --- lldb/trunk/tools/lldb-server/lldb-platform.cpp +++ lldb/trunk/tools/lldb-server/lldb-platform.cpp @@ -30,13 +30,13 @@ #include "LLDBServerUtilities.h" #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h" #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h" -#include "lldb/Core/Error.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/HostGetOpt.h" #include "lldb/Host/OptionParser.h" #include "lldb/Host/common/TCPSocket.h" +#include "lldb/Utility/Error.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/unittests/Breakpoint/BreakpointIDTest.cpp =================================================================== --- lldb/trunk/unittests/Breakpoint/BreakpointIDTest.cpp +++ lldb/trunk/unittests/Breakpoint/BreakpointIDTest.cpp @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "lldb/Breakpoint/BreakpointID.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "llvm/ADT/StringRef.h" Index: lldb/trunk/unittests/Core/ErrorTest.cpp =================================================================== --- lldb/trunk/unittests/Core/ErrorTest.cpp +++ lldb/trunk/unittests/Core/ErrorTest.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// +#include "lldb/Utility/Error.h" #include "gtest/gtest.h" -#include "lldb/Core/Error.h" using namespace lldb_private; Index: lldb/trunk/unittests/Core/LogTest.cpp =================================================================== --- lldb/trunk/unittests/Core/LogTest.cpp +++ lldb/trunk/unittests/Core/LogTest.cpp @@ -10,8 +10,8 @@ #include "gtest/gtest.h" #include "lldb/Core/Log.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Host.h" +#include "lldb/Utility/StreamString.h" using namespace lldb; using namespace lldb_private; Index: lldb/trunk/unittests/Core/ScalarTest.cpp =================================================================== --- lldb/trunk/unittests/Core/ScalarTest.cpp +++ lldb/trunk/unittests/Core/ScalarTest.cpp @@ -17,10 +17,10 @@ #include "gtest/gtest.h" #include "lldb/Core/DataExtractor.h" -#include "lldb/Core/Error.h" #include "lldb/Core/Scalar.h" -#include "lldb/Core/StreamString.h" #include "lldb/Host/Endian.h" +#include "lldb/Utility/Error.h" +#include "lldb/Utility/StreamString.h" using namespace lldb_private; Index: lldb/trunk/unittests/Core/StructuredDataTest.cpp =================================================================== --- lldb/trunk/unittests/Core/StructuredDataTest.cpp +++ lldb/trunk/unittests/Core/StructuredDataTest.cpp @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "lldb/Core/StructuredData.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" #include "llvm/Support/MachO.h" Index: lldb/trunk/unittests/Core/TimerTest.cpp =================================================================== --- lldb/trunk/unittests/Core/TimerTest.cpp +++ lldb/trunk/unittests/Core/TimerTest.cpp @@ -16,7 +16,7 @@ #include "lldb/Core/Timer.h" #include "gtest/gtest.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Utility/StreamString.h" #include using namespace lldb_private; Index: lldb/trunk/unittests/Editline/EditlineTest.cpp =================================================================== --- lldb/trunk/unittests/Editline/EditlineTest.cpp +++ lldb/trunk/unittests/Editline/EditlineTest.cpp @@ -19,10 +19,10 @@ #include "gtest/gtest.h" -#include "lldb/Core/Error.h" #include "lldb/Core/StringList.h" #include "lldb/Host/Editline.h" #include "lldb/Host/Pipe.h" +#include "lldb/Utility/Error.h" #include "lldb/Utility/PseudoTerminal.h" namespace { Index: lldb/trunk/unittests/Expression/GoParserTest.cpp =================================================================== --- lldb/trunk/unittests/Expression/GoParserTest.cpp +++ lldb/trunk/unittests/Expression/GoParserTest.cpp @@ -20,7 +20,7 @@ #include "gtest/gtest.h" #include "Plugins/ExpressionParser/Go/GoParser.h" -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" using namespace lldb_private;