Index: lldb/include/lldb/Breakpoint/BreakpointResolver.h =================================================================== --- lldb/include/lldb/Breakpoint/BreakpointResolver.h +++ lldb/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/include/lldb/Breakpoint/BreakpointResolverFileRegex.h =================================================================== --- lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h +++ lldb/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/include/lldb/Core/AddressResolver.h =================================================================== --- lldb/include/lldb/Core/AddressResolver.h +++ lldb/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/include/lldb/Core/AddressResolverName.h =================================================================== --- lldb/include/lldb/Core/AddressResolverName.h +++ lldb/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/include/lldb/Core/ArchSpec.h =================================================================== --- lldb/include/lldb/Core/ArchSpec.h +++ lldb/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/include/lldb/Core/Broadcaster.h =================================================================== --- lldb/include/lldb/Core/Broadcaster.h +++ lldb/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/include/lldb/Core/Communication.h =================================================================== --- lldb/include/lldb/Core/Communication.h +++ lldb/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/include/lldb/Core/ConstString.h =================================================================== --- lldb/include/lldb/Core/ConstString.h +++ /dev/null @@ -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/include/lldb/Core/DataBufferMemoryMap.h =================================================================== --- lldb/include/lldb/Core/DataBufferMemoryMap.h +++ lldb/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/include/lldb/Core/Error.h =================================================================== --- lldb/include/lldb/Core/Error.h +++ /dev/null @@ -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/include/lldb/Core/Event.h =================================================================== --- lldb/include/lldb/Core/Event.h +++ lldb/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/include/lldb/Core/FormatEntity.h =================================================================== --- lldb/include/lldb/Core/FormatEntity.h +++ lldb/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/include/lldb/Core/IOHandler.h =================================================================== --- lldb/include/lldb/Core/IOHandler.h +++ lldb/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/include/lldb/Core/Log.h =================================================================== --- lldb/include/lldb/Core/Log.h +++ lldb/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/include/lldb/Core/Mangled.h =================================================================== --- lldb/include/lldb/Core/Mangled.h +++ lldb/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/include/lldb/Core/MappedHash.h =================================================================== --- lldb/include/lldb/Core/MappedHash.h +++ lldb/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/include/lldb/Core/ModuleSpec.h =================================================================== --- lldb/include/lldb/Core/ModuleSpec.h +++ lldb/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/include/lldb/Core/RegularExpression.h =================================================================== --- lldb/include/lldb/Core/RegularExpression.h +++ /dev/null @@ -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/include/lldb/Core/Section.h =================================================================== --- lldb/include/lldb/Core/Section.h +++ lldb/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/include/lldb/Core/Stream.h =================================================================== --- lldb/include/lldb/Core/Stream.h +++ /dev/null @@ -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/include/lldb/Core/StreamAsynchronousIO.h =================================================================== --- lldb/include/lldb/Core/StreamAsynchronousIO.h +++ lldb/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/include/lldb/Core/StreamBuffer.h =================================================================== --- lldb/include/lldb/Core/StreamBuffer.h +++ lldb/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/include/lldb/Core/StreamCallback.h =================================================================== --- lldb/include/lldb/Core/StreamCallback.h +++ lldb/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/include/lldb/Core/StreamFile.h =================================================================== --- lldb/include/lldb/Core/StreamFile.h +++ lldb/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/include/lldb/Core/StreamGDBRemote.h =================================================================== --- lldb/include/lldb/Core/StreamGDBRemote.h +++ lldb/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/include/lldb/Core/StreamString.h =================================================================== --- lldb/include/lldb/Core/StreamString.h +++ /dev/null @@ -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/include/lldb/Core/StreamTee.h =================================================================== --- lldb/include/lldb/Core/StreamTee.h +++ /dev/null @@ -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/include/lldb/Core/StructuredData.h =================================================================== --- lldb/include/lldb/Core/StructuredData.h +++ lldb/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/include/lldb/Core/UniqueCStringMap.h =================================================================== --- lldb/include/lldb/Core/UniqueCStringMap.h +++ lldb/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/include/lldb/Core/UserSettingsController.h =================================================================== --- lldb/include/lldb/Core/UserSettingsController.h +++ lldb/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/include/lldb/Core/Value.h =================================================================== --- lldb/include/lldb/Core/Value.h +++ lldb/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/include/lldb/Core/ValueObject.h =================================================================== --- lldb/include/lldb/Core/ValueObject.h +++ lldb/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/include/lldb/DataFormatters/DataVisualization.h =================================================================== --- lldb/include/lldb/DataFormatters/DataVisualization.h +++ lldb/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/include/lldb/DataFormatters/FormatCache.h =================================================================== --- lldb/include/lldb/DataFormatters/FormatCache.h +++ lldb/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/include/lldb/DataFormatters/FormattersContainer.h =================================================================== --- lldb/include/lldb/DataFormatters/FormattersContainer.h +++ lldb/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/include/lldb/DataFormatters/TypeSummary.h =================================================================== --- lldb/include/lldb/DataFormatters/TypeSummary.h +++ lldb/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/include/lldb/DataFormatters/VectorIterator.h =================================================================== --- lldb/include/lldb/DataFormatters/VectorIterator.h +++ lldb/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/include/lldb/Expression/DWARFExpression.h =================================================================== --- lldb/include/lldb/Expression/DWARFExpression.h +++ lldb/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/include/lldb/Expression/ExpressionParser.h =================================================================== --- lldb/include/lldb/Expression/ExpressionParser.h +++ lldb/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/include/lldb/Expression/ExpressionVariable.h =================================================================== --- lldb/include/lldb/Expression/ExpressionVariable.h +++ lldb/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/include/lldb/Expression/IRInterpreter.h =================================================================== --- lldb/include/lldb/Expression/IRInterpreter.h +++ lldb/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/include/lldb/Expression/Materializer.h =================================================================== --- lldb/include/lldb/Expression/Materializer.h +++ lldb/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/include/lldb/Host/FileCache.h =================================================================== --- lldb/include/lldb/Host/FileCache.h +++ lldb/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/include/lldb/Host/FileSpec.h =================================================================== --- lldb/include/lldb/Host/FileSpec.h +++ lldb/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/include/lldb/Host/FileSystem.h =================================================================== --- lldb/include/lldb/Host/FileSystem.h +++ lldb/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/include/lldb/Host/HostNativeProcessBase.h =================================================================== --- lldb/include/lldb/Host/HostNativeProcessBase.h +++ lldb/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/include/lldb/Host/HostNativeThreadBase.h =================================================================== --- lldb/include/lldb/Host/HostNativeThreadBase.h +++ lldb/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/include/lldb/Host/HostThread.h =================================================================== --- lldb/include/lldb/Host/HostThread.h +++ lldb/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/include/lldb/Host/LockFileBase.h =================================================================== --- lldb/include/lldb/Host/LockFileBase.h +++ lldb/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/include/lldb/Host/MainLoopBase.h =================================================================== --- lldb/include/lldb/Host/MainLoopBase.h +++ lldb/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/include/lldb/Host/PipeBase.h =================================================================== --- lldb/include/lldb/Host/PipeBase.h +++ lldb/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/include/lldb/Host/Socket.h =================================================================== --- lldb/include/lldb/Host/Socket.h +++ lldb/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/include/lldb/Host/ThreadLauncher.h =================================================================== --- lldb/include/lldb/Host/ThreadLauncher.h +++ lldb/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/include/lldb/Host/XML.h =================================================================== --- lldb/include/lldb/Host/XML.h +++ lldb/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/include/lldb/Host/common/NativeBreakpointList.h =================================================================== --- lldb/include/lldb/Host/common/NativeBreakpointList.h +++ lldb/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/include/lldb/Host/common/NativeProcessProtocol.h =================================================================== --- lldb/include/lldb/Host/common/NativeProcessProtocol.h +++ lldb/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/include/lldb/Host/common/NativeWatchpointList.h =================================================================== --- lldb/include/lldb/Host/common/NativeWatchpointList.h +++ lldb/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/include/lldb/Host/posix/HostProcessPosix.h =================================================================== --- lldb/include/lldb/Host/posix/HostProcessPosix.h +++ lldb/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/include/lldb/Interpreter/Args.h =================================================================== --- lldb/include/lldb/Interpreter/Args.h +++ lldb/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/include/lldb/Interpreter/CommandCompletions.h =================================================================== --- lldb/include/lldb/Interpreter/CommandCompletions.h +++ lldb/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/include/lldb/Interpreter/CommandHistory.h =================================================================== --- lldb/include/lldb/Interpreter/CommandHistory.h +++ lldb/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/include/lldb/Interpreter/CommandObjectRegexCommand.h =================================================================== --- lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h +++ lldb/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/include/lldb/Interpreter/CommandReturnObject.h =================================================================== --- lldb/include/lldb/Interpreter/CommandReturnObject.h +++ lldb/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/include/lldb/Interpreter/OptionGroupPlatform.h =================================================================== --- lldb/include/lldb/Interpreter/OptionGroupPlatform.h +++ lldb/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/include/lldb/Interpreter/OptionValue.h =================================================================== --- lldb/include/lldb/Interpreter/OptionValue.h +++ lldb/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/include/lldb/Interpreter/OptionValueEnumeration.h =================================================================== --- lldb/include/lldb/Interpreter/OptionValueEnumeration.h +++ lldb/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/include/lldb/Interpreter/OptionValueProperties.h =================================================================== --- lldb/include/lldb/Interpreter/OptionValueProperties.h +++ lldb/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/include/lldb/Interpreter/OptionValueRegex.h =================================================================== --- lldb/include/lldb/Interpreter/OptionValueRegex.h +++ lldb/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/include/lldb/Interpreter/Property.h =================================================================== --- lldb/include/lldb/Interpreter/Property.h +++ lldb/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/include/lldb/Interpreter/ScriptInterpreter.h =================================================================== --- lldb/include/lldb/Interpreter/ScriptInterpreter.h +++ lldb/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/include/lldb/Symbol/Block.h =================================================================== --- lldb/include/lldb/Symbol/Block.h +++ lldb/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/include/lldb/Symbol/ClangASTContext.h =================================================================== --- lldb/include/lldb/Symbol/ClangASTContext.h +++ lldb/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/include/lldb/Symbol/CompileUnit.h =================================================================== --- lldb/include/lldb/Symbol/CompileUnit.h +++ lldb/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/include/lldb/Symbol/CompilerDecl.h =================================================================== --- lldb/include/lldb/Symbol/CompilerDecl.h +++ lldb/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/include/lldb/Symbol/CompilerDeclContext.h =================================================================== --- lldb/include/lldb/Symbol/CompilerDeclContext.h +++ lldb/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/include/lldb/Symbol/DebugMacros.h =================================================================== --- lldb/include/lldb/Symbol/DebugMacros.h +++ lldb/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/include/lldb/Symbol/GoASTContext.h =================================================================== --- lldb/include/lldb/Symbol/GoASTContext.h +++ lldb/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/include/lldb/Symbol/JavaASTContext.h =================================================================== --- lldb/include/lldb/Symbol/JavaASTContext.h +++ lldb/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/include/lldb/Symbol/OCamlASTContext.h =================================================================== --- lldb/include/lldb/Symbol/OCamlASTContext.h +++ lldb/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/include/lldb/Symbol/Type.h =================================================================== --- lldb/include/lldb/Symbol/Type.h +++ lldb/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/include/lldb/Symbol/UnwindPlan.h =================================================================== --- lldb/include/lldb/Symbol/UnwindPlan.h +++ lldb/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/include/lldb/Target/ABI.h =================================================================== --- lldb/include/lldb/Target/ABI.h +++ lldb/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/include/lldb/Target/DynamicLoader.h =================================================================== --- lldb/include/lldb/Target/DynamicLoader.h +++ lldb/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/include/lldb/Target/MemoryRegionInfo.h =================================================================== --- lldb/include/lldb/Target/MemoryRegionInfo.h +++ lldb/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/include/lldb/Target/PathMappingList.h =================================================================== --- lldb/include/lldb/Target/PathMappingList.h +++ lldb/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/include/lldb/Target/Platform.h =================================================================== --- lldb/include/lldb/Target/Platform.h +++ lldb/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/include/lldb/Target/Process.h =================================================================== --- lldb/include/lldb/Target/Process.h +++ lldb/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/include/lldb/Target/QueueItem.h =================================================================== --- lldb/include/lldb/Target/QueueItem.h +++ lldb/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/include/lldb/Target/StackFrame.h =================================================================== --- lldb/include/lldb/Target/StackFrame.h +++ lldb/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/include/lldb/Target/SystemRuntime.h =================================================================== --- lldb/include/lldb/Target/SystemRuntime.h +++ lldb/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/include/lldb/Target/UnixSignals.h =================================================================== --- lldb/include/lldb/Target/UnixSignals.h +++ lldb/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/include/lldb/Utility/ConstString.h =================================================================== --- /dev/null +++ lldb/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/include/lldb/Utility/Error.h =================================================================== --- /dev/null +++ lldb/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/include/lldb/Utility/JSON.h =================================================================== --- lldb/include/lldb/Utility/JSON.h +++ lldb/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/include/lldb/Utility/ProcessStructReader.h =================================================================== --- lldb/include/lldb/Utility/ProcessStructReader.h +++ lldb/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/include/lldb/Utility/RegularExpression.h =================================================================== --- /dev/null +++ lldb/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/include/lldb/Utility/Stream.h =================================================================== --- /dev/null +++ lldb/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/include/lldb/Utility/StreamString.h =================================================================== --- /dev/null +++ lldb/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/include/lldb/Utility/StreamTee.h =================================================================== --- /dev/null +++ lldb/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/source/API/SBAddress.cpp =================================================================== --- lldb/source/API/SBAddress.cpp +++ lldb/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/source/API/SBBreakpoint.cpp =================================================================== --- lldb/source/API/SBBreakpoint.cpp +++ lldb/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/source/API/SBBreakpointLocation.cpp =================================================================== --- lldb/source/API/SBBreakpointLocation.cpp +++ lldb/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/source/API/SBCommandReturnObject.cpp =================================================================== --- lldb/source/API/SBCommandReturnObject.cpp +++ lldb/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/source/API/SBData.cpp =================================================================== --- lldb/source/API/SBData.cpp +++ lldb/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/source/API/SBDeclaration.cpp =================================================================== --- lldb/source/API/SBDeclaration.cpp +++ lldb/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/source/API/SBError.cpp =================================================================== --- lldb/source/API/SBError.cpp +++ lldb/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/source/API/SBEvent.cpp =================================================================== --- lldb/source/API/SBEvent.cpp +++ lldb/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/source/API/SBFileSpec.cpp =================================================================== --- lldb/source/API/SBFileSpec.cpp +++ lldb/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/source/API/SBFileSpecList.cpp =================================================================== --- lldb/source/API/SBFileSpecList.cpp +++ lldb/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/source/API/SBFrame.cpp =================================================================== --- lldb/source/API/SBFrame.cpp +++ lldb/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/source/API/SBInstructionList.cpp =================================================================== --- lldb/source/API/SBInstructionList.cpp +++ lldb/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/source/API/SBLineEntry.cpp =================================================================== --- lldb/source/API/SBLineEntry.cpp +++ lldb/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/source/API/SBListener.cpp =================================================================== --- lldb/source/API/SBListener.cpp +++ lldb/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/source/API/SBMemoryRegionInfo.cpp =================================================================== --- lldb/source/API/SBMemoryRegionInfo.cpp +++ lldb/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/source/API/SBModule.cpp =================================================================== --- lldb/source/API/SBModule.cpp +++ lldb/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/source/API/SBModuleSpec.cpp =================================================================== --- lldb/source/API/SBModuleSpec.cpp +++ lldb/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/source/API/SBPlatform.cpp =================================================================== --- lldb/source/API/SBPlatform.cpp +++ lldb/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/source/API/SBProcess.cpp =================================================================== --- lldb/source/API/SBProcess.cpp +++ lldb/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/source/API/SBSection.cpp =================================================================== --- lldb/source/API/SBSection.cpp +++ lldb/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/source/API/SBSourceManager.cpp =================================================================== --- lldb/source/API/SBSourceManager.cpp +++ lldb/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/source/API/SBStream.cpp =================================================================== --- lldb/source/API/SBStream.cpp +++ lldb/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/source/API/SBStructuredData.cpp =================================================================== --- lldb/source/API/SBStructuredData.cpp +++ lldb/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/source/API/SBTarget.cpp =================================================================== --- lldb/source/API/SBTarget.cpp +++ lldb/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/source/API/SBThread.cpp =================================================================== --- lldb/source/API/SBThread.cpp +++ lldb/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/source/API/SBThreadPlan.cpp =================================================================== --- lldb/source/API/SBThreadPlan.cpp +++ lldb/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/source/API/SBType.cpp =================================================================== --- lldb/source/API/SBType.cpp +++ lldb/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/source/API/SBTypeEnumMember.cpp =================================================================== --- lldb/source/API/SBTypeEnumMember.cpp +++ lldb/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/source/API/SBValue.cpp =================================================================== --- lldb/source/API/SBValue.cpp +++ lldb/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/source/API/SBWatchpoint.cpp =================================================================== --- lldb/source/API/SBWatchpoint.cpp +++ lldb/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/source/Breakpoint/Breakpoint.cpp =================================================================== --- lldb/source/Breakpoint/Breakpoint.cpp +++ lldb/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/source/Breakpoint/BreakpointID.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointID.cpp +++ lldb/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/source/Breakpoint/BreakpointLocation.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointLocation.cpp +++ lldb/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/source/Breakpoint/BreakpointOptions.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointOptions.cpp +++ lldb/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/source/Breakpoint/BreakpointResolver.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointResolver.cpp +++ lldb/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/source/Breakpoint/BreakpointResolverAddress.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointResolverAddress.cpp +++ lldb/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/source/Breakpoint/BreakpointResolverFileLine.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointResolverFileLine.cpp +++ lldb/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/source/Breakpoint/BreakpointResolverFileRegex.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp +++ lldb/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/source/Breakpoint/BreakpointResolverName.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointResolverName.cpp +++ lldb/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/source/Breakpoint/BreakpointSite.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointSite.cpp +++ lldb/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/source/Breakpoint/BreakpointSiteList.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointSiteList.cpp +++ lldb/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/source/Breakpoint/Watchpoint.cpp =================================================================== --- lldb/source/Breakpoint/Watchpoint.cpp +++ lldb/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/source/Breakpoint/WatchpointOptions.cpp =================================================================== --- lldb/source/Breakpoint/WatchpointOptions.cpp +++ lldb/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/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/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/source/Commands/CommandObjectFrame.cpp =================================================================== --- lldb/source/Commands/CommandObjectFrame.cpp +++ lldb/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/source/Commands/CommandObjectLog.cpp =================================================================== --- lldb/source/Commands/CommandObjectLog.cpp +++ lldb/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/source/Commands/CommandObjectMemory.cpp =================================================================== --- lldb/source/Commands/CommandObjectMemory.cpp +++ lldb/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/source/Commands/CommandObjectType.cpp =================================================================== --- lldb/source/Commands/CommandObjectType.cpp +++ lldb/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/source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpoint.cpp +++ lldb/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/source/Core/AddressRange.cpp =================================================================== --- lldb/source/Core/AddressRange.cpp +++ lldb/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/source/Core/AddressResolver.cpp =================================================================== --- lldb/source/Core/AddressResolver.cpp +++ lldb/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/source/Core/AddressResolverFileLine.cpp =================================================================== --- lldb/source/Core/AddressResolverFileLine.cpp +++ lldb/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/source/Core/AddressResolverName.cpp =================================================================== --- lldb/source/Core/AddressResolverName.cpp +++ lldb/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/source/Core/ArchSpec.cpp =================================================================== --- lldb/source/Core/ArchSpec.cpp +++ lldb/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/source/Core/Baton.cpp =================================================================== --- lldb/source/Core/Baton.cpp +++ lldb/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/source/Core/Broadcaster.cpp =================================================================== --- lldb/source/Core/Broadcaster.cpp +++ lldb/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/source/Core/CMakeLists.txt =================================================================== --- lldb/source/Core/CMakeLists.txt +++ lldb/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/source/Core/ConstString.cpp =================================================================== --- lldb/source/Core/ConstString.cpp +++ /dev/null @@ -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/source/Core/DataBufferMemoryMap.cpp =================================================================== --- lldb/source/Core/DataBufferMemoryMap.cpp +++ lldb/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/source/Core/DataExtractor.cpp =================================================================== --- lldb/source/Core/DataExtractor.cpp +++ lldb/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/source/Core/Debugger.cpp =================================================================== --- lldb/source/Core/Debugger.cpp +++ lldb/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/source/Core/Disassembler.cpp =================================================================== --- lldb/source/Core/Disassembler.cpp +++ lldb/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/source/Core/EmulateInstruction.cpp =================================================================== --- lldb/source/Core/EmulateInstruction.cpp +++ lldb/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/source/Core/Error.cpp =================================================================== --- lldb/source/Core/Error.cpp +++ /dev/null @@ -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/source/Core/Event.cpp =================================================================== --- lldb/source/Core/Event.cpp +++ lldb/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/source/Core/FileLineResolver.cpp =================================================================== --- lldb/source/Core/FileLineResolver.cpp +++ lldb/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/source/Core/FileSpecList.cpp =================================================================== --- lldb/source/Core/FileSpecList.cpp +++ lldb/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/source/Core/FormatEntity.cpp =================================================================== --- lldb/source/Core/FormatEntity.cpp +++ lldb/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/source/Core/History.cpp =================================================================== --- lldb/source/Core/History.cpp +++ lldb/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/source/Core/Listener.cpp =================================================================== --- lldb/source/Core/Listener.cpp +++ lldb/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/source/Core/Log.cpp =================================================================== --- lldb/source/Core/Log.cpp +++ lldb/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/source/Core/Mangled.cpp =================================================================== --- lldb/source/Core/Mangled.cpp +++ lldb/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/source/Core/Module.cpp =================================================================== --- lldb/source/Core/Module.cpp +++ lldb/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/source/Core/Opcode.cpp =================================================================== --- lldb/source/Core/Opcode.cpp +++ lldb/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/source/Core/PluginManager.cpp =================================================================== --- lldb/source/Core/PluginManager.cpp +++ lldb/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/source/Core/RegisterValue.cpp =================================================================== --- lldb/source/Core/RegisterValue.cpp +++ lldb/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/source/Core/RegularExpression.cpp =================================================================== --- lldb/source/Core/RegularExpression.cpp +++ /dev/null @@ -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/source/Core/Scalar.cpp =================================================================== --- lldb/source/Core/Scalar.cpp +++ lldb/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/source/Core/SourceManager.cpp =================================================================== --- lldb/source/Core/SourceManager.cpp +++ lldb/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/source/Core/Stream.cpp =================================================================== --- lldb/source/Core/Stream.cpp +++ /dev/null @@ -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/source/Core/StreamFile.cpp =================================================================== --- lldb/source/Core/StreamFile.cpp +++ lldb/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/source/Core/StreamString.cpp =================================================================== --- lldb/source/Core/StreamString.cpp +++ /dev/null @@ -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/source/Core/StringList.cpp =================================================================== --- lldb/source/Core/StringList.cpp +++ lldb/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/source/Core/StructuredData.cpp =================================================================== --- lldb/source/Core/StructuredData.cpp +++ lldb/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/source/Core/Timer.cpp =================================================================== --- lldb/source/Core/Timer.cpp +++ lldb/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/source/Core/UUID.cpp =================================================================== --- lldb/source/Core/UUID.cpp +++ lldb/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/source/Core/UserID.cpp =================================================================== --- lldb/source/Core/UserID.cpp +++ lldb/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/source/Core/UserSettingsController.cpp =================================================================== --- lldb/source/Core/UserSettingsController.cpp +++ lldb/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/source/Core/VMRange.cpp =================================================================== --- lldb/source/Core/VMRange.cpp +++ lldb/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/source/Core/Value.cpp =================================================================== --- lldb/source/Core/Value.cpp +++ lldb/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/source/Core/ValueObject.cpp =================================================================== --- lldb/source/Core/ValueObject.cpp +++ lldb/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/source/DataFormatters/CXXFunctionPointer.cpp =================================================================== --- lldb/source/DataFormatters/CXXFunctionPointer.cpp +++ lldb/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/source/DataFormatters/FormattersHelpers.cpp =================================================================== --- lldb/source/DataFormatters/FormattersHelpers.cpp +++ lldb/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/source/DataFormatters/StringPrinter.cpp =================================================================== --- lldb/source/DataFormatters/StringPrinter.cpp +++ lldb/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/source/DataFormatters/TypeFormat.cpp =================================================================== --- lldb/source/DataFormatters/TypeFormat.cpp +++ lldb/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/source/DataFormatters/TypeSummary.cpp =================================================================== --- lldb/source/DataFormatters/TypeSummary.cpp +++ lldb/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/source/DataFormatters/TypeSynthetic.cpp =================================================================== --- lldb/source/DataFormatters/TypeSynthetic.cpp +++ lldb/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/source/DataFormatters/TypeValidator.cpp =================================================================== --- lldb/source/DataFormatters/TypeValidator.cpp +++ lldb/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/source/DataFormatters/ValueObjectPrinter.cpp =================================================================== --- lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ lldb/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/source/Expression/DWARFExpression.cpp =================================================================== --- lldb/source/Expression/DWARFExpression.cpp +++ lldb/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/source/Expression/DiagnosticManager.cpp =================================================================== --- lldb/source/Expression/DiagnosticManager.cpp +++ lldb/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/source/Expression/ExpressionSourceCode.cpp =================================================================== --- lldb/source/Expression/ExpressionSourceCode.cpp +++ lldb/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/source/Expression/IRDynamicChecks.cpp =================================================================== --- lldb/source/Expression/IRDynamicChecks.cpp +++ lldb/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/source/Expression/IRInterpreter.cpp =================================================================== --- lldb/source/Expression/IRInterpreter.cpp +++ lldb/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/source/Expression/IRMemoryMap.cpp =================================================================== --- lldb/source/Expression/IRMemoryMap.cpp +++ lldb/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/source/Expression/LLVMUserExpression.cpp =================================================================== --- lldb/source/Expression/LLVMUserExpression.cpp +++ lldb/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/source/Expression/UserExpression.cpp =================================================================== --- lldb/source/Expression/UserExpression.cpp +++ lldb/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/source/Expression/UtilityFunction.cpp =================================================================== --- lldb/source/Expression/UtilityFunction.cpp +++ lldb/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/source/Host/common/Editline.cpp =================================================================== --- lldb/source/Host/common/Editline.cpp +++ lldb/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/source/Host/common/File.cpp =================================================================== --- lldb/source/Host/common/File.cpp +++ lldb/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/source/Host/common/FileSpec.cpp =================================================================== --- lldb/source/Host/common/FileSpec.cpp +++ lldb/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/source/Host/common/Host.cpp =================================================================== --- lldb/source/Host/common/Host.cpp +++ lldb/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/source/Host/common/HostInfoBase.cpp =================================================================== --- lldb/source/Host/common/HostInfoBase.cpp +++ lldb/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/source/Host/common/MonitoringProcessLauncher.cpp =================================================================== --- lldb/source/Host/common/MonitoringProcessLauncher.cpp +++ lldb/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/source/Host/common/NativeBreakpoint.cpp =================================================================== --- lldb/source/Host/common/NativeBreakpoint.cpp +++ lldb/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/source/Host/common/Socket.cpp =================================================================== --- lldb/source/Host/common/Socket.cpp +++ lldb/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/source/Host/common/SoftwareBreakpoint.cpp =================================================================== --- lldb/source/Host/common/SoftwareBreakpoint.cpp +++ lldb/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/source/Host/common/Symbols.cpp =================================================================== --- lldb/source/Host/common/Symbols.cpp +++ lldb/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/source/Host/common/ThisThread.cpp =================================================================== --- lldb/source/Host/common/ThisThread.cpp +++ lldb/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/source/Host/freebsd/Host.cpp =================================================================== --- lldb/source/Host/freebsd/Host.cpp +++ lldb/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/source/Host/linux/Host.cpp =================================================================== --- lldb/source/Host/linux/Host.cpp +++ lldb/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/source/Host/macosx/Symbols.cpp =================================================================== --- lldb/source/Host/macosx/Symbols.cpp +++ lldb/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/source/Host/netbsd/Host.cpp =================================================================== --- lldb/source/Host/netbsd/Host.cpp +++ lldb/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/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/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/source/Host/posix/FileSystem.cpp =================================================================== --- lldb/source/Host/posix/FileSystem.cpp +++ lldb/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/source/Host/posix/HostThreadPosix.cpp =================================================================== --- lldb/source/Host/posix/HostThreadPosix.cpp +++ lldb/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/source/Host/posix/MainLoopPosix.cpp =================================================================== --- lldb/source/Host/posix/MainLoopPosix.cpp +++ lldb/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/source/Host/windows/ConnectionGenericFileWindows.cpp =================================================================== --- lldb/source/Host/windows/ConnectionGenericFileWindows.cpp +++ lldb/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/source/Host/windows/Host.cpp =================================================================== --- lldb/source/Host/windows/Host.cpp +++ lldb/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/source/Host/windows/HostThreadWindows.cpp =================================================================== --- lldb/source/Host/windows/HostThreadWindows.cpp +++ lldb/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/source/Host/windows/ThisThread.cpp =================================================================== --- lldb/source/Host/windows/ThisThread.cpp +++ lldb/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/source/Interpreter/Args.cpp =================================================================== --- lldb/source/Interpreter/Args.cpp +++ lldb/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/source/Interpreter/CommandAlias.cpp =================================================================== --- lldb/source/Interpreter/CommandAlias.cpp +++ lldb/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/source/Interpreter/CommandInterpreter.cpp =================================================================== --- lldb/source/Interpreter/CommandInterpreter.cpp +++ lldb/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/source/Interpreter/CommandReturnObject.cpp =================================================================== --- lldb/source/Interpreter/CommandReturnObject.cpp +++ lldb/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/source/Interpreter/OptionGroupVariable.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupVariable.cpp +++ lldb/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/source/Interpreter/OptionValueArray.cpp =================================================================== --- lldb/source/Interpreter/OptionValueArray.cpp +++ lldb/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/source/Interpreter/OptionValueBoolean.cpp =================================================================== --- lldb/source/Interpreter/OptionValueBoolean.cpp +++ lldb/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/source/Interpreter/OptionValueChar.cpp =================================================================== --- lldb/source/Interpreter/OptionValueChar.cpp +++ lldb/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/source/Interpreter/OptionValueFileSpecLIst.cpp =================================================================== --- lldb/source/Interpreter/OptionValueFileSpecLIst.cpp +++ lldb/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/source/Interpreter/OptionValueFormat.cpp =================================================================== --- lldb/source/Interpreter/OptionValueFormat.cpp +++ lldb/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/source/Interpreter/OptionValueFormatEntity.cpp =================================================================== --- lldb/source/Interpreter/OptionValueFormatEntity.cpp +++ lldb/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/source/Interpreter/OptionValueLanguage.cpp =================================================================== --- lldb/source/Interpreter/OptionValueLanguage.cpp +++ lldb/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/source/Interpreter/OptionValuePathMappings.cpp =================================================================== --- lldb/source/Interpreter/OptionValuePathMappings.cpp +++ lldb/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/source/Interpreter/OptionValueProperties.cpp =================================================================== --- lldb/source/Interpreter/OptionValueProperties.cpp +++ lldb/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/source/Interpreter/OptionValueRegex.cpp =================================================================== --- lldb/source/Interpreter/OptionValueRegex.cpp +++ lldb/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/source/Interpreter/OptionValueSInt64.cpp =================================================================== --- lldb/source/Interpreter/OptionValueSInt64.cpp +++ lldb/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/source/Interpreter/OptionValueString.cpp =================================================================== --- lldb/source/Interpreter/OptionValueString.cpp +++ lldb/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/source/Interpreter/OptionValueUInt64.cpp =================================================================== --- lldb/source/Interpreter/OptionValueUInt64.cpp +++ lldb/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/source/Interpreter/OptionValueUUID.cpp =================================================================== --- lldb/source/Interpreter/OptionValueUUID.cpp +++ lldb/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/source/Interpreter/Options.cpp =================================================================== --- lldb/source/Interpreter/Options.cpp +++ lldb/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/source/Interpreter/ScriptInterpreter.cpp =================================================================== --- lldb/source/Interpreter/ScriptInterpreter.cpp +++ lldb/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/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp =================================================================== --- lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ lldb/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/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h =================================================================== --- lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ lldb/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/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp =================================================================== --- lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ lldb/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/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp =================================================================== --- lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ lldb/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/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ lldb/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/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ lldb/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/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ lldb/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/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp +++ lldb/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/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp +++ lldb/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/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp +++ lldb/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/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp +++ lldb/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/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp +++ lldb/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/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp +++ lldb/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/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp =================================================================== --- lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ lldb/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/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp =================================================================== --- lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ lldb/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/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ lldb/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/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ASTDumper.h =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.h +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +++ lldb/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/source/Plugins/ExpressionParser/Clang/IRForTarget.h =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h +++ lldb/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/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp +++ lldb/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/source/Plugins/ExpressionParser/Go/GoParser.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Go/GoParser.cpp +++ lldb/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/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp +++ lldb/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/source/Plugins/Instruction/ARM/EmulateInstructionARM.h =================================================================== --- lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h +++ lldb/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/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp =================================================================== --- lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ lldb/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/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h =================================================================== --- lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ lldb/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/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp =================================================================== --- lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ lldb/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/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h =================================================================== --- lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ lldb/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/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp =================================================================== --- lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ lldb/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/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h =================================================================== --- lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h +++ lldb/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/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp =================================================================== --- lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ lldb/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/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp +++ lldb/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/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp +++ lldb/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/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp =================================================================== --- lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h +++ lldb/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/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/CxxStringTypes.h =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h +++ lldb/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/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxx.h =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxx.h +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxx.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxxList.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibStdcpp.h =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.h +++ lldb/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/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp +++ lldb/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/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp =================================================================== --- lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp +++ lldb/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/source/Plugins/Language/Go/GoFormatterFunctions.h =================================================================== --- lldb/source/Plugins/Language/Go/GoFormatterFunctions.h +++ lldb/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/source/Plugins/Language/Go/GoLanguage.h =================================================================== --- lldb/source/Plugins/Language/Go/GoLanguage.h +++ lldb/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/source/Plugins/Language/Go/GoLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/Go/GoLanguage.cpp +++ lldb/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/source/Plugins/Language/Java/JavaLanguage.h =================================================================== --- lldb/source/Plugins/Language/Java/JavaLanguage.h +++ lldb/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/source/Plugins/Language/Java/JavaLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/Java/JavaLanguage.cpp +++ lldb/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/source/Plugins/Language/OCaml/OCamlLanguage.h =================================================================== --- lldb/source/Plugins/Language/OCaml/OCamlLanguage.h +++ lldb/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/source/Plugins/Language/OCaml/OCamlLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/OCaml/OCamlLanguage.cpp +++ lldb/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/source/Plugins/Language/ObjC/CF.h =================================================================== --- lldb/source/Plugins/Language/ObjC/CF.h +++ lldb/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/source/Plugins/Language/ObjC/CF.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/CF.cpp +++ lldb/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/source/Plugins/Language/ObjC/Cocoa.h =================================================================== --- lldb/source/Plugins/Language/ObjC/Cocoa.h +++ lldb/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/source/Plugins/Language/ObjC/Cocoa.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ lldb/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/source/Plugins/Language/ObjC/CoreMedia.h =================================================================== --- lldb/source/Plugins/Language/ObjC/CoreMedia.h +++ lldb/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/source/Plugins/Language/ObjC/NSArray.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/NSArray.cpp +++ lldb/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/source/Plugins/Language/ObjC/NSDictionary.h =================================================================== --- lldb/source/Plugins/Language/ObjC/NSDictionary.h +++ lldb/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/source/Plugins/Language/ObjC/NSDictionary.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/NSDictionary.cpp +++ lldb/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/source/Plugins/Language/ObjC/NSError.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/NSError.cpp +++ lldb/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/source/Plugins/Language/ObjC/NSException.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/NSException.cpp +++ lldb/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/source/Plugins/Language/ObjC/NSSet.h =================================================================== --- lldb/source/Plugins/Language/ObjC/NSSet.h +++ lldb/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/source/Plugins/Language/ObjC/NSSet.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/NSSet.cpp +++ lldb/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/source/Plugins/Language/ObjC/NSString.h =================================================================== --- lldb/source/Plugins/Language/ObjC/NSString.h +++ lldb/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/source/Plugins/Language/ObjC/NSString.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/NSString.cpp +++ lldb/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/source/Plugins/Language/ObjC/ObjCLanguage.h =================================================================== --- lldb/source/Plugins/Language/ObjC/ObjCLanguage.h +++ lldb/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/source/Plugins/Language/ObjC/ObjCLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp +++ lldb/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/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp =================================================================== --- lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp +++ lldb/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/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ lldb/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/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp +++ lldb/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/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ lldb/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/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ lldb/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/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ lldb/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/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ lldb/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/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/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/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp +++ lldb/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/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h =================================================================== --- lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ lldb/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/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp =================================================================== --- lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ lldb/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/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp =================================================================== --- lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ lldb/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/source/Plugins/ObjectFile/ELF/ELFHeader.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ lldb/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/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/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/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ lldb/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/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/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/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ lldb/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/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp =================================================================== --- lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp +++ lldb/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/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp =================================================================== --- lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ lldb/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/source/Plugins/Platform/Android/AdbClient.h =================================================================== --- lldb/source/Plugins/Platform/Android/AdbClient.h +++ lldb/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/source/Plugins/Platform/Android/AdbClient.cpp =================================================================== --- lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ lldb/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/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp =================================================================== --- lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ lldb/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/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp =================================================================== --- lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ lldb/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/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp =================================================================== --- lldb/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp +++ lldb/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/source/Plugins/Platform/Linux/PlatformLinux.cpp =================================================================== --- lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ lldb/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/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h +++ lldb/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/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp =================================================================== --- lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ lldb/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/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp =================================================================== --- lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp +++ lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp @@ -18,7 +18,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/UserExpression.h" #include "lldb/Host/File.h" @@ -31,6 +30,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/source/Plugins/Platform/Windows/PlatformWindows.cpp =================================================================== --- lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ lldb/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/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp =================================================================== --- lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ lldb/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/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp =================================================================== --- lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp +++ lldb/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/source/Plugins/Process/Darwin/MachException.cpp =================================================================== --- lldb/source/Plugins/Process/Darwin/MachException.cpp +++ lldb/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/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp =================================================================== --- lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ lldb/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/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp =================================================================== --- lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp +++ lldb/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/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp =================================================================== --- lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp +++ lldb/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/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp =================================================================== --- lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ lldb/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/source/Plugins/Process/Linux/NativeProcessLinux.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ lldb/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/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp +++ lldb/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/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ lldb/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/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ lldb/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/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ lldb/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/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ lldb/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/source/Plugins/Process/Linux/ProcFileReader.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/ProcFileReader.cpp +++ lldb/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/source/Plugins/Process/Linux/SingleStepCheck.cpp =================================================================== --- lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ lldb/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/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h =================================================================== --- lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ lldb/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/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp =================================================================== --- lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ lldb/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/source/Plugins/Process/Utility/DynamicRegisterInfo.h =================================================================== --- lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h +++ lldb/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/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ lldb/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/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ lldb/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/source/Plugins/Process/Utility/RegisterContextMemory.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp +++ lldb/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/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp +++ lldb/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/source/Plugins/Process/Utility/StopInfoMachException.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp +++ lldb/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/source/Plugins/Process/Utility/UnwindLLDB.h =================================================================== --- lldb/source/Plugins/Process/Utility/UnwindLLDB.h +++ lldb/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/source/Plugins/Process/Windows/Common/DebuggerThread.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp +++ lldb/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/source/Plugins/Process/Windows/Common/ProcessWindows.h =================================================================== --- lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ lldb/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/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp +++ lldb/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/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp +++ lldb/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/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp +++ lldb/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/source/Plugins/Process/elf-core/ProcessElfCore.h =================================================================== --- lldb/source/Plugins/Process/elf-core/ProcessElfCore.h +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h +++ lldb/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/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ lldb/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/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/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/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ lldb/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/source/Plugins/Process/mach-core/ProcessMachCore.h =================================================================== --- lldb/source/Plugins/Process/mach-core/ProcessMachCore.h +++ lldb/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/source/Plugins/Process/mach-core/ThreadMachCore.cpp =================================================================== --- lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp +++ lldb/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/source/Plugins/Process/minidump/MinidumpParser.h =================================================================== --- lldb/source/Plugins/Process/minidump/MinidumpParser.h +++ lldb/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/source/Plugins/Process/minidump/MinidumpTypes.h =================================================================== --- lldb/source/Plugins/Process/minidump/MinidumpTypes.h +++ lldb/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/source/Plugins/Process/minidump/ProcessMinidump.h =================================================================== --- lldb/source/Plugins/Process/minidump/ProcessMinidump.h +++ lldb/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/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp =================================================================== --- lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp +++ lldb/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/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h =================================================================== --- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ lldb/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/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp =================================================================== --- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ lldb/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/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp =================================================================== --- lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h +++ lldb/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/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ lldb/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/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/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/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ lldb/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/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ lldb/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/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp =================================================================== --- lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ lldb/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/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp =================================================================== --- lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ lldb/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/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ lldb/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/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp =================================================================== --- lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ lldb/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/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp =================================================================== --- lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ lldb/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/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h =================================================================== --- lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h +++ lldb/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/source/Symbol/ClangASTContext.cpp =================================================================== --- lldb/source/Symbol/ClangASTContext.cpp +++ lldb/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/source/Symbol/ClangExternalASTSourceCommon.cpp =================================================================== --- lldb/source/Symbol/ClangExternalASTSourceCommon.cpp +++ lldb/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/source/Symbol/CompactUnwindInfo.cpp =================================================================== --- lldb/source/Symbol/CompactUnwindInfo.cpp +++ lldb/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/source/Symbol/CompilerType.cpp =================================================================== --- lldb/source/Symbol/CompilerType.cpp +++ lldb/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/source/Symbol/Declaration.cpp =================================================================== --- lldb/source/Symbol/Declaration.cpp +++ lldb/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/source/Symbol/JavaASTContext.cpp =================================================================== --- lldb/source/Symbol/JavaASTContext.cpp +++ lldb/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/source/Symbol/LineTable.cpp =================================================================== --- lldb/source/Symbol/LineTable.cpp +++ lldb/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/source/Symbol/ObjectFile.cpp =================================================================== --- lldb/source/Symbol/ObjectFile.cpp +++ lldb/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/source/Symbol/Symbol.cpp =================================================================== --- lldb/source/Symbol/Symbol.cpp +++ lldb/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/source/Symbol/SymbolFile.cpp =================================================================== --- lldb/source/Symbol/SymbolFile.cpp +++ lldb/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/source/Symbol/SymbolVendor.cpp =================================================================== --- lldb/source/Symbol/SymbolVendor.cpp +++ lldb/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/source/Symbol/Symtab.cpp =================================================================== --- lldb/source/Symbol/Symtab.cpp +++ lldb/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/source/Symbol/Type.cpp =================================================================== --- lldb/source/Symbol/Type.cpp +++ lldb/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/source/Symbol/UnwindPlan.cpp =================================================================== --- lldb/source/Symbol/UnwindPlan.cpp +++ lldb/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/source/Symbol/Variable.cpp =================================================================== --- lldb/source/Symbol/Variable.cpp +++ lldb/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/source/Symbol/VariableList.cpp =================================================================== --- lldb/source/Symbol/VariableList.cpp +++ lldb/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/source/Target/FileAction.cpp =================================================================== --- lldb/source/Target/FileAction.cpp +++ lldb/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/source/Target/InstrumentationRuntime.cpp =================================================================== --- lldb/source/Target/InstrumentationRuntime.cpp +++ lldb/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/source/Target/Language.cpp =================================================================== --- lldb/source/Target/Language.cpp +++ lldb/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/source/Target/PathMappingList.cpp =================================================================== --- lldb/source/Target/PathMappingList.cpp +++ lldb/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/source/Target/Platform.cpp =================================================================== --- lldb/source/Target/Platform.cpp +++ lldb/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/source/Target/ProcessInfo.cpp =================================================================== --- lldb/source/Target/ProcessInfo.cpp +++ lldb/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/source/Target/SectionLoadHistory.cpp =================================================================== --- lldb/source/Target/SectionLoadHistory.cpp +++ lldb/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/source/Target/SectionLoadList.cpp =================================================================== --- lldb/source/Target/SectionLoadList.cpp +++ lldb/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/source/Target/StackID.cpp =================================================================== --- lldb/source/Target/StackID.cpp +++ lldb/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/source/Target/StopInfo.cpp =================================================================== --- lldb/source/Target/StopInfo.cpp +++ lldb/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/source/Target/Target.cpp =================================================================== --- lldb/source/Target/Target.cpp +++ lldb/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/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/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/source/Target/ThreadPlanBase.cpp =================================================================== --- lldb/source/Target/ThreadPlanBase.cpp +++ lldb/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/source/Target/ThreadPlanCallFunction.cpp =================================================================== --- lldb/source/Target/ThreadPlanCallFunction.cpp +++ lldb/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/source/Target/ThreadPlanCallFunctionUsingABI.cpp =================================================================== --- lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp +++ lldb/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/source/Target/ThreadPlanCallUserExpression.cpp =================================================================== --- lldb/source/Target/ThreadPlanCallUserExpression.cpp +++ lldb/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/source/Target/ThreadPlanRunToAddress.cpp =================================================================== --- lldb/source/Target/ThreadPlanRunToAddress.cpp +++ lldb/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/source/Target/ThreadPlanStepInRange.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepInRange.cpp +++ lldb/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/source/Target/ThreadPlanStepInstruction.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepInstruction.cpp +++ lldb/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/source/Target/ThreadPlanStepOverBreakpoint.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ lldb/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/source/Target/ThreadPlanStepOverRange.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepOverRange.cpp +++ lldb/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/source/Target/ThreadPlanStepRange.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepRange.cpp +++ lldb/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/source/Target/ThreadPlanStepThrough.cpp =================================================================== --- lldb/source/Target/ThreadPlanStepThrough.cpp +++ lldb/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/source/Utility/CMakeLists.txt =================================================================== --- lldb/source/Utility/CMakeLists.txt +++ lldb/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/source/Utility/ConstString.cpp =================================================================== --- /dev/null +++ lldb/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/source/Utility/Error.cpp =================================================================== --- /dev/null +++ lldb/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/source/Utility/JSON.cpp =================================================================== --- lldb/source/Utility/JSON.cpp +++ lldb/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/source/Utility/ModuleCache.h =================================================================== --- lldb/source/Utility/ModuleCache.h +++ lldb/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/source/Utility/NameMatches.cpp =================================================================== --- lldb/source/Utility/NameMatches.cpp +++ lldb/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/source/Utility/RegularExpression.cpp =================================================================== --- /dev/null +++ lldb/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/source/Utility/SelectHelper.cpp =================================================================== --- lldb/source/Utility/SelectHelper.cpp +++ lldb/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/source/Utility/Stream.cpp =================================================================== --- /dev/null +++ lldb/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/source/Utility/StreamString.cpp =================================================================== --- /dev/null +++ lldb/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/tools/argdumper/argdumper.cpp =================================================================== --- lldb/tools/argdumper/argdumper.cpp +++ lldb/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/tools/lldb-server/Acceptor.h =================================================================== --- lldb/tools/lldb-server/Acceptor.h +++ lldb/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/tools/lldb-server/Acceptor.cpp =================================================================== --- lldb/tools/lldb-server/Acceptor.cpp +++ lldb/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/tools/lldb-server/LLDBServerUtilities.cpp =================================================================== --- lldb/tools/lldb-server/LLDBServerUtilities.cpp +++ lldb/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/tools/lldb-server/lldb-gdbserver.cpp =================================================================== --- lldb/tools/lldb-server/lldb-gdbserver.cpp +++ lldb/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/tools/lldb-server/lldb-platform.cpp =================================================================== --- lldb/tools/lldb-server/lldb-platform.cpp +++ lldb/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/unittests/Breakpoint/BreakpointIDTest.cpp =================================================================== --- lldb/unittests/Breakpoint/BreakpointIDTest.cpp +++ lldb/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/unittests/Core/ErrorTest.cpp =================================================================== --- lldb/unittests/Core/ErrorTest.cpp +++ lldb/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/unittests/Core/LogTest.cpp =================================================================== --- lldb/unittests/Core/LogTest.cpp +++ lldb/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/unittests/Core/ScalarTest.cpp =================================================================== --- lldb/unittests/Core/ScalarTest.cpp +++ lldb/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/unittests/Core/StructuredDataTest.cpp =================================================================== --- lldb/unittests/Core/StructuredDataTest.cpp +++ lldb/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/unittests/Core/TimerTest.cpp =================================================================== --- lldb/unittests/Core/TimerTest.cpp +++ lldb/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/unittests/Editline/EditlineTest.cpp =================================================================== --- lldb/unittests/Editline/EditlineTest.cpp +++ lldb/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/unittests/Expression/GoParserTest.cpp =================================================================== --- lldb/unittests/Expression/GoParserTest.cpp +++ lldb/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;