[Lldb-commits] [lldb] r296943 - Move DataBuffer / DataExtractor and friends from Core -> Utility.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 3 17:30:07 PST 2017


Author: zturner
Date: Fri Mar  3 19:30:05 2017
New Revision: 296943

URL: http://llvm.org/viewvc/llvm-project?rev=296943&view=rev
Log:
Move DataBuffer / DataExtractor and friends from Core -> Utility.

Added:
    lldb/trunk/include/lldb/Utility/DataBuffer.h
    lldb/trunk/include/lldb/Utility/DataBufferHeap.h
    lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
    lldb/trunk/include/lldb/Utility/DataEncoder.h
    lldb/trunk/include/lldb/Utility/DataExtractor.h
    lldb/trunk/source/Utility/DataBufferHeap.cpp
    lldb/trunk/source/Utility/DataBufferLLVM.cpp
    lldb/trunk/source/Utility/DataEncoder.cpp
    lldb/trunk/source/Utility/DataExtractor.cpp
Removed:
    lldb/trunk/include/lldb/Core/DataBuffer.h
    lldb/trunk/include/lldb/Core/DataBufferHeap.h
    lldb/trunk/include/lldb/Core/DataBufferLLVM.h
    lldb/trunk/include/lldb/Core/DataEncoder.h
    lldb/trunk/include/lldb/Core/DataExtractor.h
    lldb/trunk/source/Core/DataBufferHeap.cpp
    lldb/trunk/source/Core/DataBufferLLVM.cpp
    lldb/trunk/source/Core/DataEncoder.cpp
    lldb/trunk/source/Core/DataExtractor.cpp
Modified:
    lldb/trunk/include/lldb/Core/MappedHash.h
    lldb/trunk/include/lldb/Core/Value.h
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
    lldb/trunk/include/lldb/Expression/DWARFExpression.h
    lldb/trunk/include/lldb/Expression/IRExecutionUnit.h
    lldb/trunk/include/lldb/Expression/IRMemoryMap.h
    lldb/trunk/include/lldb/Symbol/ArmUnwindInfo.h
    lldb/trunk/include/lldb/Symbol/CompactUnwindInfo.h
    lldb/trunk/include/lldb/Symbol/ObjectContainer.h
    lldb/trunk/include/lldb/Symbol/ObjectFile.h
    lldb/trunk/include/lldb/Target/ProcessStructReader.h
    lldb/trunk/source/API/SBData.cpp
    lldb/trunk/source/API/SBInstruction.cpp
    lldb/trunk/source/API/SBSection.cpp
    lldb/trunk/source/API/SBValue.cpp
    lldb/trunk/source/Commands/CommandObjectMemory.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
    lldb/trunk/source/Commands/CommandObjectRegister.cpp
    lldb/trunk/source/Core/CMakeLists.txt
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Core/DumpDataExtractor.cpp
    lldb/trunk/source/Core/EmulateInstruction.cpp
    lldb/trunk/source/Core/Event.cpp
    lldb/trunk/source/Core/Module.cpp
    lldb/trunk/source/Core/Opcode.cpp
    lldb/trunk/source/Core/RegisterValue.cpp
    lldb/trunk/source/Core/Scalar.cpp
    lldb/trunk/source/Core/SourceManager.cpp
    lldb/trunk/source/Core/StructuredData.cpp
    lldb/trunk/source/Core/Value.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectConstResult.cpp
    lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp
    lldb/trunk/source/DataFormatters/TypeFormat.cpp
    lldb/trunk/source/Expression/DWARFExpression.cpp
    lldb/trunk/source/Expression/FunctionCaller.cpp
    lldb/trunk/source/Expression/IRExecutionUnit.cpp
    lldb/trunk/source/Expression/IRInterpreter.cpp
    lldb/trunk/source/Expression/IRMemoryMap.cpp
    lldb/trunk/source/Host/common/File.cpp
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Host/common/Symbols.cpp
    lldb/trunk/source/Host/freebsd/Host.cpp
    lldb/trunk/source/Host/linux/Host.cpp
    lldb/trunk/source/Host/linux/HostThreadLinux.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Host/macosx/Symbols.cpp
    lldb/trunk/source/Host/netbsd/Host.cpp
    lldb/trunk/source/Host/windows/Host.cpp
    lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
    lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
    lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
    lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
    lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
    lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
    lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
    lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
    lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
    lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp
    lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
    lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
    lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
    lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
    lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp
    lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
    lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp
    lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp
    lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp
    lldb/trunk/source/Plugins/Process/minidump/ThreadMinidump.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
    lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
    lldb/trunk/source/Symbol/CompilerType.cpp
    lldb/trunk/source/Symbol/ObjectFile.cpp
    lldb/trunk/source/Symbol/Type.cpp
    lldb/trunk/source/Target/Memory.cpp
    lldb/trunk/source/Target/Platform.cpp
    lldb/trunk/source/Target/RegisterContext.cpp
    lldb/trunk/source/Target/ThreadPlanTracer.cpp
    lldb/trunk/source/Utility/CMakeLists.txt
    lldb/trunk/source/Utility/UUID.cpp
    lldb/trunk/unittests/Core/DataExtractorTest.cpp
    lldb/trunk/unittests/Core/ScalarTest.cpp
    lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
    lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp

Removed: lldb/trunk/include/lldb/Core/DataBuffer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataBuffer.h?rev=296942&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/DataBuffer.h (original)
+++ lldb/trunk/include/lldb/Core/DataBuffer.h (removed)
@@ -1,99 +0,0 @@
-//===-- DataBuffer.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_DataBuffer_h_
-#define liblldb_DataBuffer_h_
-#if defined(__cplusplus)
-
-#include <stdint.h>
-#include <string.h>
-
-#include "lldb/lldb-types.h"
-
-#include "llvm/ADT/ArrayRef.h"
-
-namespace lldb_private {
-
-//----------------------------------------------------------------------
-/// @class DataBuffer DataBuffer.h "lldb/Core/DataBuffer.h"
-/// @brief A pure virtual protocol class for abstracted data buffers.
-///
-/// DataBuffer is an abstract class that gets packaged into a shared pointer
-/// that can use to implement various ways to store data (on the heap,
-/// memory mapped, cached inferior memory). It gets used by DataExtractor
-/// so many DataExtractor objects can share the same data and sub-ranges
-/// of that shared data, and the last object that contains a reference
-/// to the shared data will free it.
-///
-/// Subclasses can implement as many different constructors or member
-/// functions that allow data to be stored in the object's buffer prior
-/// to handing the shared data to clients that use these buffers.
-///
-/// All subclasses must override all of the pure virtual functions as
-/// they are used by clients to access the data. Having a common
-/// interface allows different ways of storing data, yet using it in
-/// one common way.
-///
-/// This class currently expects all data to be available without any
-/// extra calls being made, but we can modify it to optionally get
-/// data on demand with some extra function calls to load the data
-/// before it gets accessed.
-//----------------------------------------------------------------------
-class DataBuffer {
-public:
-  //------------------------------------------------------------------
-  /// Destructor
-  ///
-  /// The destructor is virtual as other classes will inherit from
-  /// this class and be downcast to the DataBuffer pure virtual
-  /// interface. The virtual destructor ensures that destructing the
-  /// base class will destruct the class that inherited from it
-  /// correctly.
-  //------------------------------------------------------------------
-  virtual ~DataBuffer() {}
-
-  //------------------------------------------------------------------
-  /// Get a pointer to the data.
-  ///
-  /// @return
-  ///     A pointer to the bytes owned by this object, or NULL if the
-  ///     object contains no bytes.
-  //------------------------------------------------------------------
-  virtual uint8_t *GetBytes() = 0;
-
-  //------------------------------------------------------------------
-  /// Get a const pointer to the data.
-  ///
-  /// @return
-  ///     A const pointer to the bytes owned by this object, or NULL
-  ///     if the object contains no bytes.
-  //------------------------------------------------------------------
-  virtual const uint8_t *GetBytes() const = 0;
-
-  //------------------------------------------------------------------
-  /// Get the number of bytes in the data buffer.
-  ///
-  /// @return
-  ///     The number of bytes this object currently contains.
-  //------------------------------------------------------------------
-  virtual lldb::offset_t GetByteSize() const = 0;
-
-  llvm::ArrayRef<uint8_t> GetData() const {
-    return llvm::ArrayRef<uint8_t>(GetBytes(), GetByteSize());
-  }
-
-  llvm::MutableArrayRef<uint8_t> GetData() {
-    return llvm::MutableArrayRef<uint8_t>(GetBytes(), GetByteSize());
-  }
-};
-
-} // namespace lldb_private
-
-#endif /// #if defined(__cplusplus)
-#endif /// lldb_DataBuffer_h_

Removed: lldb/trunk/include/lldb/Core/DataBufferHeap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataBufferHeap.h?rev=296942&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/DataBufferHeap.h (original)
+++ lldb/trunk/include/lldb/Core/DataBufferHeap.h (removed)
@@ -1,133 +0,0 @@
-//===-- DataBufferHeap.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_DataBufferHeap_h_
-#define liblldb_DataBufferHeap_h_
-
-#include <vector>
-
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-//----------------------------------------------------------------------
-/// @class DataBufferHeap DataBufferHeap.h "lldb/Core/DataBufferHeap.h"
-/// @brief A subclass of DataBuffer that stores a data buffer on the heap.
-///
-/// This class keeps its data in a heap based buffer that is owned by
-/// the object. This class is best used to store chunks of data that
-/// are created or read from sources that can't intelligently and lazily
-/// fault new data pages in. Large amounts of data that comes from files
-/// should probably use DataBufferLLVM, which can intelligently determine
-/// when memory mapping is optimal.
-//----------------------------------------------------------------------
-class DataBufferHeap : public DataBuffer {
-public:
-  //------------------------------------------------------------------
-  /// Default constructor
-  ///
-  /// Initializes the heap based buffer with no bytes.
-  //------------------------------------------------------------------
-  DataBufferHeap();
-
-  //------------------------------------------------------------------
-  /// Construct with size \a n and fill with \a ch.
-  ///
-  /// Initialize this class with \a n bytes and fills the buffer with
-  /// \a ch.
-  ///
-  /// @param[in] n
-  ///     The number of bytes that heap based buffer should contain.
-  ///
-  /// @param[in] ch
-  ///     The character to use when filling the buffer initially.
-  //------------------------------------------------------------------
-  DataBufferHeap(lldb::offset_t n, uint8_t ch);
-
-  //------------------------------------------------------------------
-  /// Construct by making a copy of \a src_len bytes from \a src.
-  ///
-  /// @param[in] src
-  ///     A pointer to the data to copy.
-  ///
-  /// @param[in] src_len
-  ///     The number of bytes in \a src to copy.
-  //------------------------------------------------------------------
-  DataBufferHeap(const void *src, lldb::offset_t src_len);
-
-  //------------------------------------------------------------------
-  /// Destructor.
-  ///
-  /// Virtual destructor since this class inherits from a pure virtual
-  /// base class #DataBuffer.
-  //------------------------------------------------------------------
-  ~DataBufferHeap() override;
-
-  //------------------------------------------------------------------
-  /// @copydoc DataBuffer::GetBytes()
-  //------------------------------------------------------------------
-  uint8_t *GetBytes() override;
-
-  //------------------------------------------------------------------
-  /// @copydoc DataBuffer::GetBytes() const
-  //------------------------------------------------------------------
-  const uint8_t *GetBytes() const override;
-
-  //------------------------------------------------------------------
-  /// @copydoc DataBuffer::GetByteSize() const
-  //------------------------------------------------------------------
-  lldb::offset_t GetByteSize() const override;
-
-  //------------------------------------------------------------------
-  /// Set the number of bytes in the data buffer.
-  ///
-  /// Sets the number of bytes that this object should be able to
-  /// contain. This can be used prior to copying data into the buffer.
-  ///
-  /// @param[in] byte_size
-  ///     The new size in bytes that this data buffer should attempt
-  ///     to resize itself to.
-  ///
-  /// @return
-  ///     The size in bytes after that this heap buffer was
-  ///     successfully resized to.
-  //------------------------------------------------------------------
-  lldb::offset_t SetByteSize(lldb::offset_t byte_size);
-
-  //------------------------------------------------------------------
-  /// Makes a copy of the \a src_len bytes in \a src.
-  ///
-  /// Copies the data in \a src into an internal buffer.
-  ///
-  /// @param[in] src
-  ///     A pointer to the data to copy.
-  ///
-  /// @param[in] src_len
-  ///     The number of bytes in \a src to copy.
-  //------------------------------------------------------------------
-  void CopyData(const void *src, lldb::offset_t src_len);
-  void CopyData(llvm::StringRef src) { CopyData(src.data(), src.size()); }
-
-  void AppendData(const void *src, uint64_t src_len);
-
-  void Clear();
-
-private:
-  //------------------------------------------------------------------
-  // This object uses a std::vector<uint8_t> to store its data. This
-  // takes care of free the data when the object is deleted.
-  //------------------------------------------------------------------
-  typedef std::vector<uint8_t> buffer_t; ///< Buffer type
-  buffer_t m_data; ///< The heap based buffer where data is stored
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_DataBufferHeap_h_

Removed: lldb/trunk/include/lldb/Core/DataBufferLLVM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataBufferLLVM.h?rev=296942&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/DataBufferLLVM.h (original)
+++ lldb/trunk/include/lldb/Core/DataBufferLLVM.h (removed)
@@ -1,46 +0,0 @@
-//===--- DataBufferLLVM.h ---------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_CORE_DATABUFFERLLVM_H
-#define LLDB_CORE_DATABUFFERLLVM_H
-
-#include "lldb/Core/DataBuffer.h"
-
-#include <memory>
-
-namespace llvm {
-class MemoryBuffer;
-}
-
-namespace lldb_private {
-
-class DataBufferLLVM : public DataBuffer {
-public:
-  ~DataBufferLLVM();
-
-  static std::shared_ptr<DataBufferLLVM>
-  CreateFromPath(llvm::StringRef Path, uint64_t Size, uint64_t Offset);
-  static std::shared_ptr<DataBufferLLVM>
-  CreateFromFileSpec(const FileSpec &F, uint64_t Size, uint64_t Offset);
-
-  uint8_t *GetBytes() override;
-  const uint8_t *GetBytes() const override;
-  lldb::offset_t GetByteSize() const override;
-
-private:
-  /// \brief Construct a DataBufferLLVM from \p Buffer.  \p Buffer must be a
-  /// valid pointer.
-  explicit DataBufferLLVM(std::unique_ptr<llvm::MemoryBuffer> Buffer);
-  const uint8_t *GetBuffer() const;
-
-  std::unique_ptr<llvm::MemoryBuffer> Buffer;
-};
-}
-
-#endif

Removed: lldb/trunk/include/lldb/Core/DataEncoder.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataEncoder.h?rev=296942&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/DataEncoder.h (original)
+++ lldb/trunk/include/lldb/Core/DataEncoder.h (removed)
@@ -1,398 +0,0 @@
-//===-- DataEncoder.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_DataEncoder_h_
-#define liblldb_DataEncoder_h_
-
-#if defined(__cplusplus)
-
-#include "lldb/lldb-private.h"
-#include <limits.h>
-#include <stdint.h>
-
-namespace lldb_private {
-
-//----------------------------------------------------------------------
-/// @class DataEncoder DataEncoder.h "lldb/Core/DataEncoder.h"
-/// @brief An binary data encoding class.
-///
-/// DataEncoder is a class that can encode binary data (swapping if needed)
-/// to a data buffer. The data buffer can be caller owned, or can be
-/// shared data that can be shared between multiple DataEncoder or
-/// DataEncoder instances.
-///
-/// @see DataBuffer
-//----------------------------------------------------------------------
-class DataEncoder {
-public:
-  //------------------------------------------------------------------
-  /// Default constructor.
-  ///
-  /// Initialize all members to a default empty state.
-  //------------------------------------------------------------------
-  DataEncoder();
-
-  //------------------------------------------------------------------
-  /// Construct with a buffer that is owned by the caller.
-  ///
-  /// This constructor allows us to use data that is owned by the
-  /// caller. The data must stay around as long as this object is
-  /// valid.
-  ///
-  /// @param[in] data
-  ///     A pointer to caller owned data.
-  ///
-  /// @param[in] data_length
-  ///     The length in bytes of \a data.
-  ///
-  /// @param[in] byte_order
-  ///     A byte order of the data that we are extracting from.
-  ///
-  /// @param[in] addr_size
-  ///     A new address byte size value.
-  //------------------------------------------------------------------
-  DataEncoder(void *data, uint32_t data_length, lldb::ByteOrder byte_order,
-              uint8_t addr_size);
-
-  //------------------------------------------------------------------
-  /// Construct with shared data.
-  ///
-  /// Copies the data shared pointer which adds a reference to the
-  /// contained in \a data_sp. The shared data reference is reference
-  /// counted to ensure the data lives as long as anyone still has a
-  /// valid shared pointer to the data in \a data_sp.
-  ///
-  /// @param[in] data_sp
-  ///     A shared pointer to data.
-  ///
-  /// @param[in] byte_order
-  ///     A byte order of the data that we are extracting from.
-  ///
-  /// @param[in] addr_size
-  ///     A new address byte size value.
-  //------------------------------------------------------------------
-  DataEncoder(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order,
-              uint8_t addr_size);
-
-  //------------------------------------------------------------------
-  /// Destructor
-  ///
-  /// If this object contains a valid shared data reference, the
-  /// reference count on the data will be decremented, and if zero,
-  /// the data will be freed.
-  //------------------------------------------------------------------
-  ~DataEncoder();
-
-  //------------------------------------------------------------------
-  /// Clears the object state.
-  ///
-  /// Clears the object contents back to a default invalid state, and
-  /// release any references to shared data that this object may
-  /// contain.
-  //------------------------------------------------------------------
-  void Clear();
-
-  //------------------------------------------------------------------
-  /// Get the current address size.
-  ///
-  /// Return the size in bytes of any address values this object will
-  /// extract.
-  ///
-  /// @return
-  ///     The size in bytes of address values that will be extracted.
-  //------------------------------------------------------------------
-  uint8_t GetAddressByteSize() const { return m_addr_size; }
-
-  //------------------------------------------------------------------
-  /// Get the number of bytes contained in this object.
-  ///
-  /// @return
-  ///     The total number of bytes of data this object refers to.
-  //------------------------------------------------------------------
-  size_t GetByteSize() const { return m_end - m_start; }
-
-  //------------------------------------------------------------------
-  /// Get the data end pointer.
-  ///
-  /// @return
-  ///     Returns a pointer to the next byte contained in this
-  ///     object's data, or NULL of there is no data in this object.
-  //------------------------------------------------------------------
-  uint8_t *GetDataEnd() { return m_end; }
-
-  const uint8_t *GetDataEnd() const { return m_end; }
-
-  //------------------------------------------------------------------
-  /// Get the shared data offset.
-  ///
-  /// Get the offset of the first byte of data in the shared data (if
-  /// any).
-  ///
-  /// @return
-  ///     If this object contains shared data, this function returns
-  ///     the offset in bytes into that shared data, zero otherwise.
-  //------------------------------------------------------------------
-  size_t GetSharedDataOffset() const;
-
-  //------------------------------------------------------------------
-  /// Get the current byte order value.
-  ///
-  /// @return
-  ///     The current byte order value from this object's internal
-  ///     state.
-  //------------------------------------------------------------------
-  lldb::ByteOrder GetByteOrder() const { return m_byte_order; }
-
-  //------------------------------------------------------------------
-  /// Get the data start pointer.
-  ///
-  /// @return
-  ///     Returns a pointer to the first byte contained in this
-  ///     object's data, or NULL of there is no data in this object.
-  //------------------------------------------------------------------
-  uint8_t *GetDataStart() { return m_start; }
-
-  const uint8_t *GetDataStart() const { return m_start; }
-
-  //------------------------------------------------------------------
-  /// Encode unsigned integer values into the data at \a offset.
-  ///
-  /// @param[in] offset
-  ///     The offset within the contained data at which to put the
-  ///     data.
-  ///
-  /// @param[in] value
-  ///     The value to encode into the data.
-  ///
-  /// @return
-  ///     The next offset in the bytes of this data if the data
-  ///     was successfully encoded, UINT32_MAX if the encoding failed.
-  //------------------------------------------------------------------
-  uint32_t PutU8(uint32_t offset, uint8_t value);
-
-  uint32_t PutU16(uint32_t offset, uint16_t value);
-
-  uint32_t PutU32(uint32_t offset, uint32_t value);
-
-  uint32_t PutU64(uint32_t offset, uint64_t value);
-
-  //------------------------------------------------------------------
-  /// Encode an unsigned integer of size \a byte_size to \a offset.
-  ///
-  /// Encode a single integer value at \a offset and return the offset
-  /// that follows the newly encoded integer when the data is successfully
-  /// encoded into the existing data. There must be enough room in the
-  /// data, else UINT32_MAX will be returned to indicate that encoding
-  /// failed.
-  ///
-  /// @param[in] offset
-  ///     The offset within the contained data at which to put the
-  ///     encoded integer.
-  ///
-  /// @param[in] byte_size
-  ///     The size in byte of the integer to encode.
-  ///
-  /// @param[in] value
-  ///     The integer value to write. The least significant bytes of
-  ///     the integer value will be written if the size is less than
-  ///     8 bytes.
-  ///
-  /// @return
-  ///     The next offset in the bytes of this data if the integer
-  ///     was successfully encoded, UINT32_MAX if the encoding failed.
-  //------------------------------------------------------------------
-  uint32_t PutMaxU64(uint32_t offset, uint32_t byte_size, uint64_t value);
-
-  //------------------------------------------------------------------
-  /// Encode an arbitrary number of bytes.
-  ///
-  /// @param[in] offset
-  ///     The offset in bytes into the contained data at which to
-  ///     start encoding.
-  ///
-  /// @param[in] src
-  ///     The buffer that contains the bytes to encode.
-  ///
-  /// @param[in] src_len
-  ///     The number of bytes to encode.
-  ///
-  /// @return
-  ///     The next valid offset within data if the put operation
-  ///     was successful, else UINT32_MAX to indicate the put failed.
-  //------------------------------------------------------------------
-  uint32_t PutData(uint32_t offset, const void *src, uint32_t src_len);
-
-  //------------------------------------------------------------------
-  /// Encode an address in the existing buffer at \a offset bytes into
-  /// the buffer.
-  ///
-  /// Encode a single address (honoring the m_addr_size member) to
-  /// the data and return the next offset where subsequent data would
-  /// go.
-  /// pointed to by \a offset_ptr. The size of the extracted address
-  /// comes from the \a m_addr_size member variable and should be
-  /// set correctly prior to extracting any address values.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The next valid offset within data if the put operation
-  ///     was successful, else UINT32_MAX to indicate the put failed.
-  //------------------------------------------------------------------
-  uint32_t PutAddress(uint32_t offset, lldb::addr_t addr);
-
-  //------------------------------------------------------------------
-  /// Put a C string to \a offset.
-  ///
-  /// Encodes a C string into the existing data including the
-  /// terminating
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     A pointer to the C string value in the data. If the offset
-  ///     pointed to by \a offset_ptr is out of bounds, or if the
-  ///     offset plus the length of the C string is out of bounds,
-  ///     NULL will be returned.
-  //------------------------------------------------------------------
-  uint32_t PutCString(uint32_t offset_ptr, const char *cstr);
-
-  lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; }
-
-  //------------------------------------------------------------------
-  /// Set the address byte size.
-  ///
-  /// Set the size in bytes that will be used when extracting any
-  /// address and pointer values from data contained in this object.
-  ///
-  /// @param[in] addr_size
-  ///     The size in bytes to use when extracting addresses.
-  //------------------------------------------------------------------
-  void SetAddressByteSize(uint8_t addr_size) { m_addr_size = addr_size; }
-
-  //------------------------------------------------------------------
-  /// Set data with a buffer that is caller owned.
-  ///
-  /// Use data that is owned by the caller when extracting values.
-  /// The data must stay around as long as this object, or any object
-  /// that copies a subset of this object's data, is valid. If \a
-  /// bytes is NULL, or \a length is zero, this object will contain
-  /// no data.
-  ///
-  /// @param[in] bytes
-  ///     A pointer to caller owned data.
-  ///
-  /// @param[in] length
-  ///     The length in bytes of \a bytes.
-  ///
-  /// @param[in] byte_order
-  ///     A byte order of the data that we are extracting from.
-  ///
-  /// @return
-  ///     The number of bytes that this object now contains.
-  //------------------------------------------------------------------
-  uint32_t SetData(void *bytes, uint32_t length, lldb::ByteOrder byte_order);
-
-  //------------------------------------------------------------------
-  /// Adopt a subset of shared data in \a data_sp.
-  ///
-  /// Copies the data shared pointer which adds a reference to the
-  /// contained in \a data_sp. The shared data reference is reference
-  /// counted to ensure the data lives as long as anyone still has a
-  /// valid shared pointer to the data in \a data_sp. The byte order
-  /// and address byte size settings remain the same. If
-  /// \a offset is not a valid offset in \a data_sp, then no reference
-  /// to the shared data will be added. If there are not \a length
-  /// bytes available in \a data starting at \a offset, the length
-  /// will be truncated to contains as many bytes as possible.
-  ///
-  /// @param[in] data_sp
-  ///     A shared pointer to data.
-  ///
-  /// @param[in] offset
-  ///     The offset into \a data_sp at which the subset starts.
-  ///
-  /// @param[in] length
-  ///     The length in bytes of the subset of \a data_sp.
-  ///
-  /// @return
-  ///     The number of bytes that this object now contains.
-  //------------------------------------------------------------------
-  uint32_t SetData(const lldb::DataBufferSP &data_sp, uint32_t offset = 0,
-                   uint32_t length = UINT32_MAX);
-
-  //------------------------------------------------------------------
-  /// 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.
-  //------------------------------------------------------------------
-  void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; }
-
-  //------------------------------------------------------------------
-  /// Test the validity of \a offset.
-  ///
-  /// @return
-  ///     \b true if \a offset is a valid offset into the data in this
-  ///     object, \b false otherwise.
-  //------------------------------------------------------------------
-  bool ValidOffset(uint32_t offset) const { return offset < GetByteSize(); }
-
-  //------------------------------------------------------------------
-  /// Test the availability of \a length bytes of data from \a offset.
-  ///
-  /// @return
-  ///     \b true if \a offset is a valid offset and there are \a
-  ///     length bytes available at that offset, \b false otherwise.
-  //------------------------------------------------------------------
-  bool ValidOffsetForDataOfSize(uint32_t offset, uint32_t length) const {
-    return length <= BytesLeft(offset);
-  }
-
-  uint32_t BytesLeft(uint32_t offset) const {
-    const uint32_t size = GetByteSize();
-    if (size > offset)
-      return size - offset;
-    return 0;
-  }
-
-protected:
-  //------------------------------------------------------------------
-  // Member variables
-  //------------------------------------------------------------------
-  uint8_t *m_start; ///< A pointer to the first byte of data.
-  uint8_t *m_end;   ///< A pointer to the byte that is past the end of the data.
-  lldb::ByteOrder
-      m_byte_order;    ///< The byte order of the data we are extracting from.
-  uint8_t m_addr_size; ///< The address size to use when extracting pointers or
-                       ///addresses
-  mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can
-                                        ///be shared among multiple instances
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(DataEncoder);
-};
-
-} // namespace lldb_private
-
-#endif // #if defined (__cplusplus)
-#endif // #ifndef liblldb_DataEncoder_h_

Removed: lldb/trunk/include/lldb/Core/DataExtractor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataExtractor.h?rev=296942&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/DataExtractor.h (original)
+++ lldb/trunk/include/lldb/Core/DataExtractor.h (removed)
@@ -1,1149 +0,0 @@
-//===-- DataExtractor.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_DataExtractor_h_
-#define liblldb_DataExtractor_h_
-
-// C Includes
-#include <limits.h>
-#include <stdint.h>
-#include <string.h>
-
-// C++ Includes
-// Other libraries and framework includes
-#include "llvm/ADT/SmallVector.h"
-
-// Project includes
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-//----------------------------------------------------------------------
-/// @class DataExtractor DataExtractor.h "lldb/Core/DataExtractor.h"
-/// @brief An data extractor class.
-///
-/// DataExtractor is a class that can extract data (swapping if needed)
-/// from a data buffer. The data buffer can be caller owned, or can be
-/// shared data that can be shared between multiple DataExtractor
-/// instances. Multiple DataExtractor objects can share the same data,
-/// yet extract values in different address sizes and byte order modes.
-/// Each object can have a unique position in the shared data and extract
-/// data from different offsets.
-///
-/// @see DataBuffer
-//----------------------------------------------------------------------
-class DataExtractor {
-public:
-  //------------------------------------------------------------------
-  /// @typedef DataExtractor::Type
-  /// @brief Type enumerations used in the dump routines.
-  //------------------------------------------------------------------
-  typedef enum {
-    TypeUInt8,   ///< Format output as unsigned 8 bit integers
-    TypeChar,    ///< Format output as characters
-    TypeUInt16,  ///< Format output as unsigned 16 bit integers
-    TypeUInt32,  ///< Format output as unsigned 32 bit integers
-    TypeUInt64,  ///< Format output as unsigned 64 bit integers
-    TypePointer, ///< Format output as pointers
-    TypeULEB128, ///< Format output as ULEB128 numbers
-    TypeSLEB128  ///< Format output as SLEB128 numbers
-  } Type;
-
-  //------------------------------------------------------------------
-  /// Default constructor.
-  ///
-  /// Initialize all members to a default empty state.
-  //------------------------------------------------------------------
-  DataExtractor();
-
-  //------------------------------------------------------------------
-  /// Construct with a buffer that is owned by the caller.
-  ///
-  /// This constructor allows us to use data that is owned by the
-  /// caller. The data must stay around as long as this object is
-  /// valid.
-  ///
-  /// @param[in] data
-  ///     A pointer to caller owned data.
-  ///
-  /// @param[in] data_length
-  ///     The length in bytes of \a data.
-  ///
-  /// @param[in] byte_order
-  ///     A byte order of the data that we are extracting from.
-  ///
-  /// @param[in] addr_size
-  ///     A new address byte size value.
-  ///
-  /// @param[in] target_byte_size
-  ///     A size of a target byte in 8-bit host bytes
-  //------------------------------------------------------------------
-  DataExtractor(const void *data, lldb::offset_t data_length,
-                lldb::ByteOrder byte_order, uint32_t addr_size,
-                uint32_t target_byte_size = 1);
-
-  //------------------------------------------------------------------
-  /// Construct with shared data.
-  ///
-  /// Copies the data shared pointer which adds a reference to the
-  /// contained in \a data_sp. The shared data reference is reference
-  /// counted to ensure the data lives as long as anyone still has a
-  /// valid shared pointer to the data in \a data_sp.
-  ///
-  /// @param[in] data_sp
-  ///     A shared pointer to data.
-  ///
-  /// @param[in] byte_order
-  ///     A byte order of the data that we are extracting from.
-  ///
-  /// @param[in] addr_size
-  ///     A new address byte size value.
-  ///
-  /// @param[in] target_byte_size
-  ///     A size of a target byte in 8-bit host bytes
-  //------------------------------------------------------------------
-  DataExtractor(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order,
-                uint32_t addr_size, uint32_t target_byte_size = 1);
-
-  //------------------------------------------------------------------
-  /// Construct with a subset of \a data.
-  ///
-  /// Initialize this object with a subset of the data bytes in \a
-  /// data. If \a data contains shared data, then a reference to the
-  /// shared data will be added to ensure the shared data stays around
-  /// as long as any objects have references to the shared data. The
-  /// byte order value and the address size settings are copied from \a
-  /// data. If \a offset is not a valid offset in \a data, then no
-  /// reference to the shared data will be added. If there are not
-  /// \a length bytes available in \a data starting at \a offset,
-  /// the length will be truncated to contain as many bytes as
-  /// possible.
-  ///
-  /// @param[in] data
-  ///     Another DataExtractor object that contains data.
-  ///
-  /// @param[in] offset
-  ///     The offset into \a data at which the subset starts.
-  ///
-  /// @param[in] length
-  ///     The length in bytes of the subset of data.
-  ///
-  /// @param[in] target_byte_size
-  ///     A size of a target byte in 8-bit host bytes
-  //------------------------------------------------------------------
-  DataExtractor(const DataExtractor &data, lldb::offset_t offset,
-                lldb::offset_t length, uint32_t target_byte_size = 1);
-
-  DataExtractor(const DataExtractor &rhs);
-
-  //------------------------------------------------------------------
-  /// Assignment operator.
-  ///
-  /// Copies all data, byte order and address size settings from \a rhs into
-  /// this object. If \a rhs contains shared data, a reference to that
-  /// shared data will be added.
-  ///
-  /// @param[in] rhs
-  ///     Another DataExtractor object to copy.
-  ///
-  /// @return
-  ///     A const reference to this object.
-  //------------------------------------------------------------------
-  const DataExtractor &operator=(const DataExtractor &rhs);
-
-  //------------------------------------------------------------------
-  /// Destructor
-  ///
-  /// If this object contains a valid shared data reference, the
-  /// reference count on the data will be decremented, and if zero,
-  /// the data will be freed.
-  //------------------------------------------------------------------
-  virtual ~DataExtractor();
-
-  uint32_t getTargetByteSize() const { return m_target_byte_size; }
-
-  //------------------------------------------------------------------
-  /// Clears the object state.
-  ///
-  /// Clears the object contents back to a default invalid state, and
-  /// release any references to shared data that this object may
-  /// contain.
-  //------------------------------------------------------------------
-  void Clear();
-
-  //------------------------------------------------------------------
-  /// Dumps the binary data as \a type objects to stream \a s (or to
-  /// Log() if \a s is nullptr) starting \a offset bytes into the data
-  /// and stopping after dumping \a length bytes. The offset into the
-  /// data is displayed at the beginning of each line and can be
-  /// offset by base address \a base_addr. \a num_per_line objects
-  /// will be displayed on each line.
-  ///
-  /// @param[in] s
-  ///     The stream to dump the output to. If nullptr the output will
-  ///     be dumped to Log().
-  ///
-  /// @param[in] offset
-  ///     The offset into the data at which to start dumping.
-  ///
-  /// @param[in] length
-  ///     The number of bytes to dump.
-  ///
-  /// @param[in] base_addr
-  ///     The base address that gets added to the offset displayed on
-  ///     each line.
-  ///
-  /// @param[in] num_per_line
-  ///     The number of \a type objects to display on each line.
-  ///
-  /// @param[in] type
-  ///     The type of objects to use when dumping data from this
-  ///     object. See DataExtractor::Type.
-  ///
-  /// @param[in] type_format
-  ///     The optional format to use for the \a type objects. If this
-  ///     is nullptr, the default format for the \a type will be used.
-  ///
-  /// @return
-  ///     The offset at which dumping ended.
-  //------------------------------------------------------------------
-  lldb::offset_t PutToLog(Log *log, lldb::offset_t offset,
-                          lldb::offset_t length, uint64_t base_addr,
-                          uint32_t num_per_line, Type type,
-                          const char *type_format = nullptr) const;
-
-  //------------------------------------------------------------------
-  /// Dump a UUID value at \a offset.
-  ///
-  /// Dump a UUID starting at \a offset bytes into this object's data.
-  /// If the stream \a s is nullptr, the output will be sent to Log().
-  ///
-  /// @param[in] s
-  ///     The stream to dump the output to. If nullptr the output will
-  ///     be dumped to Log().
-  ///
-  /// @param[in] offset
-  ///     The offset into the data at which to extract and dump a
-  ///     UUID value.
-  //------------------------------------------------------------------
-  void DumpUUID(Stream *s, lldb::offset_t offset) const;
-
-  //------------------------------------------------------------------
-  /// Extract an arbitrary number of bytes in the specified byte
-  /// order.
-  ///
-  /// Attemps to extract \a length bytes starting at \a offset bytes
-  /// into this data in the requested byte order (\a dst_byte_order)
-  /// and place the results in \a dst. \a dst must be at least \a
-  /// length bytes long.
-  ///
-  /// @param[in] offset
-  ///     The offset in bytes into the contained data at which to
-  ///     start extracting.
-  ///
-  /// @param[in] length
-  ///     The number of bytes to extract.
-  ///
-  /// @param[in] dst_byte_order
-  ///     A byte order of the data that we want when the value in
-  ///     copied to \a dst.
-  ///
-  /// @param[out] dst
-  ///     The buffer that will receive the extracted value if there
-  ///     are enough bytes available in the current data.
-  ///
-  /// @return
-  ///     The number of bytes that were extracted which will be \a
-  ///     length when the value is successfully extracted, or zero
-  ///     if there aren't enough bytes at the specified offset.
-  //------------------------------------------------------------------
-  size_t ExtractBytes(lldb::offset_t offset, lldb::offset_t length,
-                      lldb::ByteOrder dst_byte_order, void *dst) const;
-
-  //------------------------------------------------------------------
-  /// Extract an address from \a *offset_ptr.
-  ///
-  /// Extract a single address from the data and update the offset
-  /// pointed to by \a offset_ptr. The size of the extracted address
-  /// comes from the \a m_addr_size member variable and should be
-  /// set correctly prior to extracting any address values.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted address value.
-  //------------------------------------------------------------------
-  uint64_t GetAddress(lldb::offset_t *offset_ptr) const;
-
-  uint64_t GetAddress_unchecked(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Get the current address size.
-  ///
-  /// Return the size in bytes of any address values this object will
-  /// extract.
-  ///
-  /// @return
-  ///     The size in bytes of address values that will be extracted.
-  //------------------------------------------------------------------
-  uint32_t GetAddressByteSize() const { return m_addr_size; }
-
-  //------------------------------------------------------------------
-  /// Get the number of bytes contained in this object.
-  ///
-  /// @return
-  ///     The total number of bytes of data this object refers to.
-  //------------------------------------------------------------------
-  uint64_t GetByteSize() const { return m_end - m_start; }
-
-  //------------------------------------------------------------------
-  /// Extract a C string from \a *offset_ptr.
-  ///
-  /// Returns a pointer to a C String from the data at the offset
-  /// pointed to by \a offset_ptr. A variable length NULL terminated C
-  /// string will be extracted and the \a offset_ptr will be
-  /// updated with the offset of the byte that follows the NULL
-  /// terminator byte.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     A pointer to the C string value in the data. If the offset
-  ///     pointed to by \a offset_ptr is out of bounds, or if the
-  ///     offset plus the length of the C string is out of bounds,
-  ///     nullptr will be returned.
-  //------------------------------------------------------------------
-  const char *GetCStr(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Extract a C string from \a *offset_ptr with field size \a len.
-  ///
-  /// Returns a pointer to a C String from the data at the offset
-  /// pointed to by \a offset_ptr, with a field length of \a len.
-  /// A NULL terminated C string will be extracted and the \a offset_ptr
-  /// will be updated with the offset of the byte that follows the fixed
-  /// length field.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     A pointer to the C string value in the data. If the offset
-  ///     pointed to by \a offset_ptr is out of bounds, or if the
-  ///     offset plus the length of the field is out of bounds, or if
-  ///     the field does not contain a NULL terminator byte, nullptr will
-  ///     be returned.
-  const char *GetCStr(lldb::offset_t *offset_ptr, lldb::offset_t len) const;
-
-  //------------------------------------------------------------------
-  /// Extract \a length bytes from \a *offset_ptr.
-  ///
-  /// Returns a pointer to a bytes in this object's data at the offset
-  /// pointed to by \a offset_ptr. If \a length is zero or too large,
-  /// then the offset pointed to by \a offset_ptr will not be updated
-  /// and nullptr will be returned.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[in] length
-  ///     The optional length of a string to extract. If the value is
-  ///     zero, a NULL terminated C string will be extracted.
-  ///
-  /// @return
-  ///     A pointer to the bytes in this object's data if the offset
-  ///     and length are valid, or nullptr otherwise.
-  //------------------------------------------------------------------
-  const void *GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const {
-    const uint8_t *ptr = PeekData(*offset_ptr, length);
-    if (ptr)
-      *offset_ptr += length;
-    return ptr;
-  }
-
-  //------------------------------------------------------------------
-  /// Copy \a length bytes from \a *offset, without swapping bytes.
-  ///
-  /// @param[in] offset
-  ///     The offset into this data from which to start copying
-  ///
-  /// @param[in] length
-  ///     The length of the data to copy from this object
-  ///
-  /// @param[out] dst
-  ///     The buffer to place the output data.
-  ///
-  /// @return
-  ///     Returns the number of bytes that were copied, or zero if
-  ///     anything goes wrong.
-  //------------------------------------------------------------------
-  lldb::offset_t CopyData(lldb::offset_t offset, lldb::offset_t length,
-                          void *dst) const;
-
-  //------------------------------------------------------------------
-  /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied
-  /// data is treated as a value that can be swapped to match the
-  /// specified byte order.
-  ///
-  /// For values that are larger than the supported integer sizes,
-  /// this function can be used to extract data in a specified byte
-  /// order. It can also be used to copy a smaller integer value from
-  /// to a larger value. The extra bytes left over will be padded
-  /// correctly according to the byte order of this object and the
-  /// \a dst_byte_order. This can be very handy when say copying a
-  /// partial data value into a register.
-  ///
-  /// @param[in] src_offset
-  ///     The offset into this data from which to start copying an
-  ///     endian entity
-  ///
-  /// @param[in] src_len
-  ///     The length of the endian data to copy from this object
-  ///     into the \a dst object
-  ///
-  /// @param[out] dst
-  ///     The buffer where to place the endian data. The data might
-  ///     need to be byte swapped (and appropriately padded with
-  ///     zeroes if \a src_len != \a dst_len) if \a dst_byte_order
-  ///     does not match the byte order in this object.
-  ///
-  /// @param[in] dst_len
-  ///     The length number of bytes that the endian value will
-  ///     occupy is \a dst.
-  ///
-  /// @param[in] byte_order
-  ///     The byte order that the endian value should be in the \a dst
-  ///     buffer.
-  ///
-  /// @return
-  ///     Returns the number of bytes that were copied, or zero if
-  ///     anything goes wrong.
-  //------------------------------------------------------------------
-  lldb::offset_t CopyByteOrderedData(lldb::offset_t src_offset,
-                                     lldb::offset_t src_len, void *dst,
-                                     lldb::offset_t dst_len,
-                                     lldb::ByteOrder dst_byte_order) const;
-
-  //------------------------------------------------------------------
-  /// Get the data end pointer.
-  ///
-  /// @return
-  ///     Returns a pointer to the next byte contained in this
-  ///     object's data, or nullptr of there is no data in this object.
-  //------------------------------------------------------------------
-  const uint8_t *GetDataEnd() const { return m_end; }
-
-  //------------------------------------------------------------------
-  /// Get the shared data offset.
-  ///
-  /// Get the offset of the first byte of data in the shared data (if
-  /// any).
-  ///
-  /// @return
-  ///     If this object contains shared data, this function returns
-  ///     the offset in bytes into that shared data, zero otherwise.
-  //------------------------------------------------------------------
-  size_t GetSharedDataOffset() const;
-
-  //------------------------------------------------------------------
-  /// Get the data start pointer.
-  ///
-  /// @return
-  ///     Returns a pointer to the first byte contained in this
-  ///     object's data, or nullptr of there is no data in this object.
-  //------------------------------------------------------------------
-  const uint8_t *GetDataStart() const { return m_start; }
-
-  //------------------------------------------------------------------
-  /// Extract a float from \a *offset_ptr.
-  ///
-  /// Extract a single float value.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The floating value that was extracted, or zero on failure.
-  //------------------------------------------------------------------
-  float GetFloat(lldb::offset_t *offset_ptr) const;
-
-  double GetDouble(lldb::offset_t *offset_ptr) const;
-
-  long double GetLongDouble(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Extract an integer of size \a byte_size from \a *offset_ptr.
-  ///
-  /// Extract a single integer value and update the offset pointed to
-  /// by \a offset_ptr. The size of the extracted integer is specified
-  /// by the \a byte_size argument. \a byte_size should have a value
-  /// >= 1 and <= 4 since the return value is only 32 bits wide. Any
-  /// \a byte_size values less than 1 or greater than 4 will result in
-  /// nothing being extracted, and zero being returned.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[in] byte_size
-  ///     The size in byte of the integer to extract.
-  ///
-  /// @return
-  ///     The integer value that was extracted, or zero on failure.
-  //------------------------------------------------------------------
-  uint32_t GetMaxU32(lldb::offset_t *offset_ptr, size_t byte_size) const;
-
-  //------------------------------------------------------------------
-  /// Extract an unsigned integer of size \a byte_size from \a
-  /// *offset_ptr.
-  ///
-  /// Extract a single unsigned integer value and update the offset
-  /// pointed to by \a offset_ptr. The size of the extracted integer
-  /// is specified by the \a byte_size argument. \a byte_size should
-  /// have a value greater than or equal to one and less than or equal
-  /// to eight since the return value is 64 bits wide. Any
-  /// \a byte_size values less than 1 or greater than 8 will result in
-  /// nothing being extracted, and zero being returned.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[in] byte_size
-  ///     The size in byte of the integer to extract.
-  ///
-  /// @return
-  ///     The unsigned integer value that was extracted, or zero on
-  ///     failure.
-  //------------------------------------------------------------------
-  uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const;
-
-  uint64_t GetMaxU64_unchecked(lldb::offset_t *offset_ptr,
-                               size_t byte_size) const;
-
-  //------------------------------------------------------------------
-  /// Extract an signed integer of size \a byte_size from \a *offset_ptr.
-  ///
-  /// Extract a single signed integer value (sign extending if required)
-  /// and update the offset pointed to by \a offset_ptr. The size of
-  /// the extracted integer is specified by the \a byte_size argument.
-  /// \a byte_size should have a value greater than or equal to one
-  /// and less than or equal to eight since the return value is 64
-  /// bits wide. Any \a byte_size values less than 1 or greater than
-  /// 8 will result in nothing being extracted, and zero being returned.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[in] byte_size
-  ///     The size in byte of the integer to extract.
-  ///
-  /// @return
-  ///     The sign extended signed integer value that was extracted,
-  ///     or zero on failure.
-  //------------------------------------------------------------------
-  int64_t GetMaxS64(lldb::offset_t *offset_ptr, size_t size) const;
-
-  //------------------------------------------------------------------
-  /// Extract an unsigned integer of size \a byte_size from \a
-  /// *offset_ptr, then extract the bitfield from this value if
-  /// \a bitfield_bit_size is non-zero.
-  ///
-  /// Extract a single unsigned integer value and update the offset
-  /// pointed to by \a offset_ptr. The size of the extracted integer
-  /// is specified by the \a byte_size argument. \a byte_size should
-  /// have a value greater than or equal to one and less than or equal
-  /// to 8 since the return value is 64 bits wide. Any
-  /// \a byte_size values less than 1 or greater than 8 will result in
-  /// nothing being extracted, and zero being returned.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[in] byte_size
-  ///     The size in byte of the integer to extract.
-  ///
-  /// @param[in] bitfield_bit_size
-  ///     The size in bits of the bitfield value to extract, or zero
-  ///     to just extract the entire integer value.
-  ///
-  /// @param[in] bitfield_bit_offset
-  ///     The bit offset of the bitfield value in the extracted
-  ///     integer.  For little-endian data, this is the offset of
-  ///     the LSB of the bitfield from the LSB of the integer.
-  ///     For big-endian data, this is the offset of the MSB of the
-  ///     bitfield from the MSB of the integer.
-  ///
-  /// @return
-  ///     The unsigned bitfield integer value that was extracted, or
-  ///     zero on failure.
-  //------------------------------------------------------------------
-  uint64_t GetMaxU64Bitfield(lldb::offset_t *offset_ptr, size_t size,
-                             uint32_t bitfield_bit_size,
-                             uint32_t bitfield_bit_offset) const;
-
-  //------------------------------------------------------------------
-  /// Extract an signed integer of size \a byte_size from \a
-  /// *offset_ptr, then extract and signe extend the bitfield from
-  /// this value if \a bitfield_bit_size is non-zero.
-  ///
-  /// Extract a single signed integer value (sign extending if required)
-  /// and update the offset pointed to by \a offset_ptr. The size of
-  /// the extracted integer is specified by the \a byte_size argument.
-  /// \a byte_size should have a value greater than or equal to one
-  /// and less than or equal to eight since the return value is 64
-  /// bits wide. Any \a byte_size values less than 1 or greater than
-  /// 8 will result in nothing being extracted, and zero being returned.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[in] byte_size
-  ///     The size in bytes of the integer to extract.
-  ///
-  /// @param[in] bitfield_bit_size
-  ///     The size in bits of the bitfield value to extract, or zero
-  ///     to just extract the entire integer value.
-  ///
-  /// @param[in] bitfield_bit_offset
-  ///     The bit offset of the bitfield value in the extracted
-  ///     integer.  For little-endian data, this is the offset of
-  ///     the LSB of the bitfield from the LSB of the integer.
-  ///     For big-endian data, this is the offset of the MSB of the
-  ///     bitfield from the MSB of the integer.
-  ///
-  /// @return
-  ///     The signed bitfield integer value that was extracted, or
-  ///     zero on failure.
-  //------------------------------------------------------------------
-  int64_t GetMaxS64Bitfield(lldb::offset_t *offset_ptr, size_t size,
-                            uint32_t bitfield_bit_size,
-                            uint32_t bitfield_bit_offset) const;
-
-  //------------------------------------------------------------------
-  /// Extract an pointer from \a *offset_ptr.
-  ///
-  /// Extract a single pointer from the data and update the offset
-  /// pointed to by \a offset_ptr. The size of the extracted pointer
-  /// comes from the \a m_addr_size member variable and should be
-  /// set correctly prior to extracting any pointer values.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted pointer value as a 64 integer.
-  //------------------------------------------------------------------
-  uint64_t GetPointer(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Get the current byte order value.
-  ///
-  /// @return
-  ///     The current byte order value from this object's internal
-  ///     state.
-  //------------------------------------------------------------------
-  lldb::ByteOrder GetByteOrder() const { return m_byte_order; }
-
-  //------------------------------------------------------------------
-  /// Extract a uint8_t value from \a *offset_ptr.
-  ///
-  /// Extract a single uint8_t from the binary data at the offset
-  /// pointed to by \a offset_ptr, and advance the offset on success.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted uint8_t value.
-  //------------------------------------------------------------------
-  uint8_t GetU8(lldb::offset_t *offset_ptr) const;
-
-  uint8_t GetU8_unchecked(lldb::offset_t *offset_ptr) const {
-    uint8_t val = m_start[*offset_ptr];
-    *offset_ptr += 1;
-    return val;
-  }
-
-  uint16_t GetU16_unchecked(lldb::offset_t *offset_ptr) const;
-
-  uint32_t GetU32_unchecked(lldb::offset_t *offset_ptr) const;
-
-  uint64_t GetU64_unchecked(lldb::offset_t *offset_ptr) const;
-  //------------------------------------------------------------------
-  /// Extract \a count uint8_t values from \a *offset_ptr.
-  ///
-  /// Extract \a count uint8_t values from the binary data at the
-  /// offset pointed to by \a offset_ptr, and advance the offset on
-  /// success. The extracted values are copied into \a dst.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[out] dst
-  ///     A buffer to copy \a count uint8_t values into. \a dst must
-  ///     be large enough to hold all requested data.
-  ///
-  /// @param[in] count
-  ///     The number of uint8_t values to extract.
-  ///
-  /// @return
-  ///     \a dst if all values were properly extracted and copied,
-  ///     nullptr otherwise.
-  //------------------------------------------------------------------
-  void *GetU8(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
-
-  //------------------------------------------------------------------
-  /// Extract a uint16_t value from \a *offset_ptr.
-  ///
-  /// Extract a single uint16_t from the binary data at the offset
-  /// pointed to by \a offset_ptr, and update the offset on success.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted uint16_t value.
-  //------------------------------------------------------------------
-  uint16_t GetU16(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Extract \a count uint16_t values from \a *offset_ptr.
-  ///
-  /// Extract \a count uint16_t values from the binary data at the
-  /// offset pointed to by \a offset_ptr, and advance the offset on
-  /// success. The extracted values are copied into \a dst.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[out] dst
-  ///     A buffer to copy \a count uint16_t values into. \a dst must
-  ///     be large enough to hold all requested data.
-  ///
-  /// @param[in] count
-  ///     The number of uint16_t values to extract.
-  ///
-  /// @return
-  ///     \a dst if all values were properly extracted and copied,
-  ///     nullptr otherwise.
-  //------------------------------------------------------------------
-  void *GetU16(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
-
-  //------------------------------------------------------------------
-  /// Extract a uint32_t value from \a *offset_ptr.
-  ///
-  /// Extract a single uint32_t from the binary data at the offset
-  /// pointed to by \a offset_ptr, and update the offset on success.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted uint32_t value.
-  //------------------------------------------------------------------
-  uint32_t GetU32(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Extract \a count uint32_t values from \a *offset_ptr.
-  ///
-  /// Extract \a count uint32_t values from the binary data at the
-  /// offset pointed to by \a offset_ptr, and advance the offset on
-  /// success. The extracted values are copied into \a dst.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[out] dst
-  ///     A buffer to copy \a count uint32_t values into. \a dst must
-  ///     be large enough to hold all requested data.
-  ///
-  /// @param[in] count
-  ///     The number of uint32_t values to extract.
-  ///
-  /// @return
-  ///     \a dst if all values were properly extracted and copied,
-  ///     nullptr otherwise.
-  //------------------------------------------------------------------
-  void *GetU32(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
-
-  //------------------------------------------------------------------
-  /// Extract a uint64_t value from \a *offset_ptr.
-  ///
-  /// Extract a single uint64_t from the binary data at the offset
-  /// pointed to by \a offset_ptr, and update the offset on success.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted uint64_t value.
-  //------------------------------------------------------------------
-  uint64_t GetU64(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Extract \a count uint64_t values from \a *offset_ptr.
-  ///
-  /// Extract \a count uint64_t values from the binary data at the
-  /// offset pointed to by \a offset_ptr, and advance the offset on
-  /// success. The extracted values are copied into \a dst.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @param[out] dst
-  ///     A buffer to copy \a count uint64_t values into. \a dst must
-  ///     be large enough to hold all requested data.
-  ///
-  /// @param[in] count
-  ///     The number of uint64_t values to extract.
-  ///
-  /// @return
-  ///     \a dst if all values were properly extracted and copied,
-  ///     nullptr otherwise.
-  //------------------------------------------------------------------
-  void *GetU64(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
-
-  //------------------------------------------------------------------
-  /// Extract a signed LEB128 value from \a *offset_ptr.
-  ///
-  /// Extracts an signed LEB128 number from this object's data
-  /// starting at the offset pointed to by \a offset_ptr. The offset
-  /// pointed to by \a offset_ptr will be updated with the offset of
-  /// the byte following the last extracted byte.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted signed integer value.
-  //------------------------------------------------------------------
-  int64_t GetSLEB128(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Extract a unsigned LEB128 value from \a *offset_ptr.
-  ///
-  /// Extracts an unsigned LEB128 number from this object's data
-  /// starting at the offset pointed to by \a offset_ptr. The offset
-  /// pointed to by \a offset_ptr will be updated with the offset of
-  /// the byte following the last extracted byte.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  ///     The extracted unsigned integer value.
-  //------------------------------------------------------------------
-  uint64_t GetULEB128(lldb::offset_t *offset_ptr) const;
-
-  lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; }
-
-  //------------------------------------------------------------------
-  /// Peek at a C string at \a offset.
-  ///
-  /// Peeks at a string in the contained data. No verification is done
-  /// to make sure the entire string lies within the bounds of this
-  /// object's data, only \a offset is verified to be a valid offset.
-  ///
-  /// @param[in] offset
-  ///     An offset into the data.
-  ///
-  /// @return
-  ///     A non-nullptr C string pointer if \a offset is a valid offset,
-  ///     nullptr otherwise.
-  //------------------------------------------------------------------
-  const char *PeekCStr(lldb::offset_t offset) const;
-
-  //------------------------------------------------------------------
-  /// Peek at a bytes at \a offset.
-  ///
-  /// Returns a pointer to \a length bytes at \a offset as long as
-  /// there are \a length bytes available starting at \a offset.
-  ///
-  /// @return
-  ///     A non-nullptr data pointer if \a offset is a valid offset and
-  ///     there are \a length bytes available at that offset, nullptr
-  ///     otherwise.
-  //------------------------------------------------------------------
-  const uint8_t *PeekData(lldb::offset_t offset, lldb::offset_t length) const {
-    if (ValidOffsetForDataOfSize(offset, length))
-      return m_start + offset;
-    return nullptr;
-  }
-
-  //------------------------------------------------------------------
-  /// Set the address byte size.
-  ///
-  /// Set the size in bytes that will be used when extracting any
-  /// address and pointer values from data contained in this object.
-  ///
-  /// @param[in] addr_size
-  ///     The size in bytes to use when extracting addresses.
-  //------------------------------------------------------------------
-  void SetAddressByteSize(uint32_t addr_size) {
-#ifdef LLDB_CONFIGURATION_DEBUG
-    assert(addr_size == 4 || addr_size == 8);
-#endif
-    m_addr_size = addr_size;
-  }
-
-  //------------------------------------------------------------------
-  /// Set data with a buffer that is caller owned.
-  ///
-  /// Use data that is owned by the caller when extracting values.
-  /// The data must stay around as long as this object, or any object
-  /// that copies a subset of this object's data, is valid. If \a
-  /// bytes is nullptr, or \a length is zero, this object will contain
-  /// no data.
-  ///
-  /// @param[in] bytes
-  ///     A pointer to caller owned data.
-  ///
-  /// @param[in] length
-  ///     The length in bytes of \a bytes.
-  ///
-  /// @param[in] byte_order
-  ///     A byte order of the data that we are extracting from.
-  ///
-  /// @return
-  ///     The number of bytes that this object now contains.
-  //------------------------------------------------------------------
-  lldb::offset_t SetData(const void *bytes, lldb::offset_t length,
-                         lldb::ByteOrder byte_order);
-
-  //------------------------------------------------------------------
-  /// Adopt a subset of \a data.
-  ///
-  /// Set this object's data to be a subset of the data bytes in \a
-  /// data. If \a data contains shared data, then a reference to the
-  /// shared data will be added to ensure the shared data stays around
-  /// as long as any objects have references to the shared data. The
-  /// byte order and the address size settings are copied from \a
-  /// data. If \a offset is not a valid offset in \a data, then no
-  /// reference to the shared data will be added. If there are not
-  /// \a length bytes available in \a data starting at \a offset,
-  /// the length will be truncated to contains as many bytes as
-  /// possible.
-  ///
-  /// @param[in] data
-  ///     Another DataExtractor object that contains data.
-  ///
-  /// @param[in] offset
-  ///     The offset into \a data at which the subset starts.
-  ///
-  /// @param[in] length
-  ///     The length in bytes of the subset of \a data.
-  ///
-  /// @return
-  ///     The number of bytes that this object now contains.
-  //------------------------------------------------------------------
-  lldb::offset_t SetData(const DataExtractor &data, lldb::offset_t offset,
-                         lldb::offset_t length);
-
-  //------------------------------------------------------------------
-  /// Adopt a subset of shared data in \a data_sp.
-  ///
-  /// Copies the data shared pointer which adds a reference to the
-  /// contained in \a data_sp. The shared data reference is reference
-  /// counted to ensure the data lives as long as anyone still has a
-  /// valid shared pointer to the data in \a data_sp. The byte order
-  /// and address byte size settings remain the same. If
-  /// \a offset is not a valid offset in \a data_sp, then no reference
-  /// to the shared data will be added. If there are not \a length
-  /// bytes available in \a data starting at \a offset, the length
-  /// will be truncated to contains as many bytes as possible.
-  ///
-  /// @param[in] data_sp
-  ///     A shared pointer to data.
-  ///
-  /// @param[in] offset
-  ///     The offset into \a data_sp at which the subset starts.
-  ///
-  /// @param[in] length
-  ///     The length in bytes of the subset of \a data_sp.
-  ///
-  /// @return
-  ///     The number of bytes that this object now contains.
-  //------------------------------------------------------------------
-  lldb::offset_t SetData(const lldb::DataBufferSP &data_sp,
-                         lldb::offset_t offset = 0,
-                         lldb::offset_t length = LLDB_INVALID_OFFSET);
-
-  //------------------------------------------------------------------
-  /// 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.
-  //------------------------------------------------------------------
-  void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; }
-
-  //------------------------------------------------------------------
-  /// Skip an LEB128 number at \a *offset_ptr.
-  ///
-  /// Skips a LEB128 number (signed or unsigned) from this object's
-  /// data starting at the offset pointed to by \a offset_ptr. The
-  /// offset pointed to by \a offset_ptr will be updated with the
-  /// offset of the byte following the last extracted byte.
-  ///
-  /// @param[in,out] offset_ptr
-  ///     A pointer to an offset within the data that will be advanced
-  ///     by the appropriate number of bytes if the value is extracted
-  ///     correctly. If the offset is out of bounds or there are not
-  ///     enough bytes to extract this value, the offset will be left
-  ///     unmodified.
-  ///
-  /// @return
-  //      The number of bytes consumed during the extraction.
-  //------------------------------------------------------------------
-  uint32_t Skip_LEB128(lldb::offset_t *offset_ptr) const;
-
-  //------------------------------------------------------------------
-  /// Test the validity of \a offset.
-  ///
-  /// @return
-  ///     \b true if \a offset is a valid offset into the data in this
-  ///     object, \b false otherwise.
-  //------------------------------------------------------------------
-  bool ValidOffset(lldb::offset_t offset) const {
-    return offset < GetByteSize();
-  }
-
-  //------------------------------------------------------------------
-  /// Test the availability of \a length bytes of data from \a offset.
-  ///
-  /// @return
-  ///     \b true if \a offset is a valid offset and there are \a
-  ///     length bytes available at that offset, \b false otherwise.
-  //------------------------------------------------------------------
-  bool ValidOffsetForDataOfSize(lldb::offset_t offset,
-                                lldb::offset_t length) const {
-    return length <= BytesLeft(offset);
-  }
-
-  size_t Copy(DataExtractor &dest_data) const;
-
-  bool Append(DataExtractor &rhs);
-
-  bool Append(void *bytes, lldb::offset_t length);
-
-  lldb::offset_t BytesLeft(lldb::offset_t offset) const {
-    const lldb::offset_t size = GetByteSize();
-    if (size > offset)
-      return size - offset;
-    return 0;
-  }
-
-  void Checksum(llvm::SmallVectorImpl<uint8_t> &dest, uint64_t max_data = 0);
-
-protected:
-  //------------------------------------------------------------------
-  // Member variables
-  //------------------------------------------------------------------
-  const uint8_t *m_start; ///< A pointer to the first byte of data.
-  const uint8_t
-      *m_end; ///< A pointer to the byte that is past the end of the data.
-  lldb::ByteOrder
-      m_byte_order;     ///< The byte order of the data we are extracting from.
-  uint32_t m_addr_size; ///< The address size to use when extracting pointers or
-                        ///addresses
-  mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can
-                                        ///be shared among multiple instances
-  const uint32_t m_target_byte_size;
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_DataExtractor_h_

Modified: lldb/trunk/include/lldb/Core/MappedHash.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/MappedHash.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/MappedHash.h (original)
+++ lldb/trunk/include/lldb/Core/MappedHash.h Fri Mar  3 19:30:05 2017
@@ -22,7 +22,7 @@
 
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 
 class MappedHash {

Modified: lldb/trunk/include/lldb/Core/Value.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Fri Mar  3 19:30:05 2017
@@ -16,9 +16,9 @@
 
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Symbol/CompilerType.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Fri Mar  3 19:30:05 2017
@@ -22,7 +22,7 @@
 #include "llvm/ADT/SmallVector.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Flags.h"
 
 #include "lldb/Core/UserID.h"

Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Fri Mar  3 19:30:05 2017
@@ -19,7 +19,7 @@
 // Project includes
 #include "lldb/lldb-forward.h"
 
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 
 namespace lldb_private {
 namespace formatters {

Modified: lldb/trunk/include/lldb/Expression/DWARFExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DWARFExpression.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/DWARFExpression.h Fri Mar  3 19:30:05 2017
@@ -11,9 +11,9 @@
 #define liblldb_DWARFExpression_h_
 
 #include "lldb/Core/Address.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/lldb-private.h"
 #include <functional>

Modified: lldb/trunk/include/lldb/Expression/IRExecutionUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRExecutionUnit.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/IRExecutionUnit.h (original)
+++ lldb/trunk/include/lldb/Expression/IRExecutionUnit.h Fri Mar  3 19:30:05 2017
@@ -22,10 +22,10 @@
 #include "llvm/IR/Module.h"
 
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Expression/IRMemoryMap.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/lldb-forward.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/include/lldb/Expression/IRMemoryMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRMemoryMap.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/IRMemoryMap.h (original)
+++ lldb/trunk/include/lldb/Expression/IRMemoryMap.h Fri Mar  3 19:30:05 2017
@@ -10,8 +10,8 @@
 #ifndef lldb_IRMemoryMap_h_
 #define lldb_IRMemoryMap_h_
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/UserID.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/lldb-public.h"
 
 #include <map>

Modified: lldb/trunk/include/lldb/Symbol/ArmUnwindInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ArmUnwindInfo.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ArmUnwindInfo.h (original)
+++ lldb/trunk/include/lldb/Symbol/ArmUnwindInfo.h Fri Mar  3 19:30:05 2017
@@ -12,9 +12,9 @@
 
 #include <vector>
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RangeMap.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/lldb-private.h"
 
 /*

Modified: lldb/trunk/include/lldb/Symbol/CompactUnwindInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompactUnwindInfo.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/CompactUnwindInfo.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompactUnwindInfo.h Fri Mar  3 19:30:05 2017
@@ -13,10 +13,10 @@
 #include <mutex>
 #include <vector>
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RangeMap.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/UnwindPlan.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/lldb-private.h"
 
 namespace lldb_private {

Modified: lldb/trunk/include/lldb/Symbol/ObjectContainer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ObjectContainer.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectContainer.h (original)
+++ lldb/trunk/include/lldb/Symbol/ObjectContainer.h Fri Mar  3 19:30:05 2017
@@ -14,10 +14,10 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Host/FileSpec.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/include/lldb/Symbol/ObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ObjectFile.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h Fri Mar  3 19:30:05 2017
@@ -10,13 +10,13 @@
 #ifndef liblldb_ObjectFile_h_
 #define liblldb_ObjectFile_h_
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Symbol/Symtab.h"
 #include "lldb/Symbol/UnwindTable.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/include/lldb/Target/ProcessStructReader.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ProcessStructReader.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ProcessStructReader.h (original)
+++ lldb/trunk/include/lldb/Target/ProcessStructReader.h Fri Mar  3 19:30:05 2017
@@ -13,10 +13,10 @@
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-types.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 
 #include <initializer_list>

Added: lldb/trunk/include/lldb/Utility/DataBuffer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataBuffer.h?rev=296943&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Utility/DataBuffer.h (added)
+++ lldb/trunk/include/lldb/Utility/DataBuffer.h Fri Mar  3 19:30:05 2017
@@ -0,0 +1,99 @@
+//===-- DataBuffer.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_DataBuffer_h_
+#define liblldb_DataBuffer_h_
+#if defined(__cplusplus)
+
+#include <stdint.h>
+#include <string.h>
+
+#include "lldb/lldb-types.h"
+
+#include "llvm/ADT/ArrayRef.h"
+
+namespace lldb_private {
+
+//----------------------------------------------------------------------
+/// @class DataBuffer DataBuffer.h "lldb/Core/DataBuffer.h"
+/// @brief A pure virtual protocol class for abstracted data buffers.
+///
+/// DataBuffer is an abstract class that gets packaged into a shared pointer
+/// that can use to implement various ways to store data (on the heap,
+/// memory mapped, cached inferior memory). It gets used by DataExtractor
+/// so many DataExtractor objects can share the same data and sub-ranges
+/// of that shared data, and the last object that contains a reference
+/// to the shared data will free it.
+///
+/// Subclasses can implement as many different constructors or member
+/// functions that allow data to be stored in the object's buffer prior
+/// to handing the shared data to clients that use these buffers.
+///
+/// All subclasses must override all of the pure virtual functions as
+/// they are used by clients to access the data. Having a common
+/// interface allows different ways of storing data, yet using it in
+/// one common way.
+///
+/// This class currently expects all data to be available without any
+/// extra calls being made, but we can modify it to optionally get
+/// data on demand with some extra function calls to load the data
+/// before it gets accessed.
+//----------------------------------------------------------------------
+class DataBuffer {
+public:
+  //------------------------------------------------------------------
+  /// Destructor
+  ///
+  /// The destructor is virtual as other classes will inherit from
+  /// this class and be downcast to the DataBuffer pure virtual
+  /// interface. The virtual destructor ensures that destructing the
+  /// base class will destruct the class that inherited from it
+  /// correctly.
+  //------------------------------------------------------------------
+  virtual ~DataBuffer() {}
+
+  //------------------------------------------------------------------
+  /// Get a pointer to the data.
+  ///
+  /// @return
+  ///     A pointer to the bytes owned by this object, or NULL if the
+  ///     object contains no bytes.
+  //------------------------------------------------------------------
+  virtual uint8_t *GetBytes() = 0;
+
+  //------------------------------------------------------------------
+  /// Get a const pointer to the data.
+  ///
+  /// @return
+  ///     A const pointer to the bytes owned by this object, or NULL
+  ///     if the object contains no bytes.
+  //------------------------------------------------------------------
+  virtual const uint8_t *GetBytes() const = 0;
+
+  //------------------------------------------------------------------
+  /// Get the number of bytes in the data buffer.
+  ///
+  /// @return
+  ///     The number of bytes this object currently contains.
+  //------------------------------------------------------------------
+  virtual lldb::offset_t GetByteSize() const = 0;
+
+  llvm::ArrayRef<uint8_t> GetData() const {
+    return llvm::ArrayRef<uint8_t>(GetBytes(), GetByteSize());
+  }
+
+  llvm::MutableArrayRef<uint8_t> GetData() {
+    return llvm::MutableArrayRef<uint8_t>(GetBytes(), GetByteSize());
+  }
+};
+
+} // namespace lldb_private
+
+#endif /// #if defined(__cplusplus)
+#endif /// lldb_DataBuffer_h_

Added: lldb/trunk/include/lldb/Utility/DataBufferHeap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataBufferHeap.h?rev=296943&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Utility/DataBufferHeap.h (added)
+++ lldb/trunk/include/lldb/Utility/DataBufferHeap.h Fri Mar  3 19:30:05 2017
@@ -0,0 +1,133 @@
+//===-- DataBufferHeap.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_DataBufferHeap_h_
+#define liblldb_DataBufferHeap_h_
+
+#include <vector>
+
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/lldb-private.h"
+
+namespace lldb_private {
+
+//----------------------------------------------------------------------
+/// @class DataBufferHeap DataBufferHeap.h "lldb/Core/DataBufferHeap.h"
+/// @brief A subclass of DataBuffer that stores a data buffer on the heap.
+///
+/// This class keeps its data in a heap based buffer that is owned by
+/// the object. This class is best used to store chunks of data that
+/// are created or read from sources that can't intelligently and lazily
+/// fault new data pages in. Large amounts of data that comes from files
+/// should probably use DataBufferLLVM, which can intelligently determine
+/// when memory mapping is optimal.
+//----------------------------------------------------------------------
+class DataBufferHeap : public DataBuffer {
+public:
+  //------------------------------------------------------------------
+  /// Default constructor
+  ///
+  /// Initializes the heap based buffer with no bytes.
+  //------------------------------------------------------------------
+  DataBufferHeap();
+
+  //------------------------------------------------------------------
+  /// Construct with size \a n and fill with \a ch.
+  ///
+  /// Initialize this class with \a n bytes and fills the buffer with
+  /// \a ch.
+  ///
+  /// @param[in] n
+  ///     The number of bytes that heap based buffer should contain.
+  ///
+  /// @param[in] ch
+  ///     The character to use when filling the buffer initially.
+  //------------------------------------------------------------------
+  DataBufferHeap(lldb::offset_t n, uint8_t ch);
+
+  //------------------------------------------------------------------
+  /// Construct by making a copy of \a src_len bytes from \a src.
+  ///
+  /// @param[in] src
+  ///     A pointer to the data to copy.
+  ///
+  /// @param[in] src_len
+  ///     The number of bytes in \a src to copy.
+  //------------------------------------------------------------------
+  DataBufferHeap(const void *src, lldb::offset_t src_len);
+
+  //------------------------------------------------------------------
+  /// Destructor.
+  ///
+  /// Virtual destructor since this class inherits from a pure virtual
+  /// base class #DataBuffer.
+  //------------------------------------------------------------------
+  ~DataBufferHeap() override;
+
+  //------------------------------------------------------------------
+  /// @copydoc DataBuffer::GetBytes()
+  //------------------------------------------------------------------
+  uint8_t *GetBytes() override;
+
+  //------------------------------------------------------------------
+  /// @copydoc DataBuffer::GetBytes() const
+  //------------------------------------------------------------------
+  const uint8_t *GetBytes() const override;
+
+  //------------------------------------------------------------------
+  /// @copydoc DataBuffer::GetByteSize() const
+  //------------------------------------------------------------------
+  lldb::offset_t GetByteSize() const override;
+
+  //------------------------------------------------------------------
+  /// Set the number of bytes in the data buffer.
+  ///
+  /// Sets the number of bytes that this object should be able to
+  /// contain. This can be used prior to copying data into the buffer.
+  ///
+  /// @param[in] byte_size
+  ///     The new size in bytes that this data buffer should attempt
+  ///     to resize itself to.
+  ///
+  /// @return
+  ///     The size in bytes after that this heap buffer was
+  ///     successfully resized to.
+  //------------------------------------------------------------------
+  lldb::offset_t SetByteSize(lldb::offset_t byte_size);
+
+  //------------------------------------------------------------------
+  /// Makes a copy of the \a src_len bytes in \a src.
+  ///
+  /// Copies the data in \a src into an internal buffer.
+  ///
+  /// @param[in] src
+  ///     A pointer to the data to copy.
+  ///
+  /// @param[in] src_len
+  ///     The number of bytes in \a src to copy.
+  //------------------------------------------------------------------
+  void CopyData(const void *src, lldb::offset_t src_len);
+  void CopyData(llvm::StringRef src) { CopyData(src.data(), src.size()); }
+
+  void AppendData(const void *src, uint64_t src_len);
+
+  void Clear();
+
+private:
+  //------------------------------------------------------------------
+  // This object uses a std::vector<uint8_t> to store its data. This
+  // takes care of free the data when the object is deleted.
+  //------------------------------------------------------------------
+  typedef std::vector<uint8_t> buffer_t; ///< Buffer type
+  buffer_t m_data; ///< The heap based buffer where data is stored
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_DataBufferHeap_h_

Added: lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataBufferLLVM.h?rev=296943&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Utility/DataBufferLLVM.h (added)
+++ lldb/trunk/include/lldb/Utility/DataBufferLLVM.h Fri Mar  3 19:30:05 2017
@@ -0,0 +1,45 @@
+//===--- DataBufferLLVM.h ---------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_CORE_DATABUFFERLLVM_H
+#define LLDB_CORE_DATABUFFERLLVM_H
+
+#include "lldb/Utility/DataBuffer.h"
+
+#include <memory>
+
+namespace llvm {
+class MemoryBuffer;
+class Twine;
+}
+
+namespace lldb_private {
+
+class DataBufferLLVM : public DataBuffer {
+public:
+  ~DataBufferLLVM();
+
+  static std::shared_ptr<DataBufferLLVM>
+  CreateFromPath(const llvm::Twine &Path, uint64_t Size, uint64_t Offset);
+
+  uint8_t *GetBytes() override;
+  const uint8_t *GetBytes() const override;
+  lldb::offset_t GetByteSize() const override;
+
+private:
+  /// \brief Construct a DataBufferLLVM from \p Buffer.  \p Buffer must be a
+  /// valid pointer.
+  explicit DataBufferLLVM(std::unique_ptr<llvm::MemoryBuffer> Buffer);
+  const uint8_t *GetBuffer() const;
+
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
+};
+}
+
+#endif

Added: lldb/trunk/include/lldb/Utility/DataEncoder.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataEncoder.h?rev=296943&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Utility/DataEncoder.h (added)
+++ lldb/trunk/include/lldb/Utility/DataEncoder.h Fri Mar  3 19:30:05 2017
@@ -0,0 +1,398 @@
+//===-- DataEncoder.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_DataEncoder_h_
+#define liblldb_DataEncoder_h_
+
+#if defined(__cplusplus)
+
+#include "lldb/lldb-private.h"
+#include <limits.h>
+#include <stdint.h>
+
+namespace lldb_private {
+
+//----------------------------------------------------------------------
+/// @class DataEncoder DataEncoder.h "lldb/Core/DataEncoder.h"
+/// @brief An binary data encoding class.
+///
+/// DataEncoder is a class that can encode binary data (swapping if needed)
+/// to a data buffer. The data buffer can be caller owned, or can be
+/// shared data that can be shared between multiple DataEncoder or
+/// DataEncoder instances.
+///
+/// @see DataBuffer
+//----------------------------------------------------------------------
+class DataEncoder {
+public:
+  //------------------------------------------------------------------
+  /// Default constructor.
+  ///
+  /// Initialize all members to a default empty state.
+  //------------------------------------------------------------------
+  DataEncoder();
+
+  //------------------------------------------------------------------
+  /// Construct with a buffer that is owned by the caller.
+  ///
+  /// This constructor allows us to use data that is owned by the
+  /// caller. The data must stay around as long as this object is
+  /// valid.
+  ///
+  /// @param[in] data
+  ///     A pointer to caller owned data.
+  ///
+  /// @param[in] data_length
+  ///     The length in bytes of \a data.
+  ///
+  /// @param[in] byte_order
+  ///     A byte order of the data that we are extracting from.
+  ///
+  /// @param[in] addr_size
+  ///     A new address byte size value.
+  //------------------------------------------------------------------
+  DataEncoder(void *data, uint32_t data_length, lldb::ByteOrder byte_order,
+              uint8_t addr_size);
+
+  //------------------------------------------------------------------
+  /// Construct with shared data.
+  ///
+  /// Copies the data shared pointer which adds a reference to the
+  /// contained in \a data_sp. The shared data reference is reference
+  /// counted to ensure the data lives as long as anyone still has a
+  /// valid shared pointer to the data in \a data_sp.
+  ///
+  /// @param[in] data_sp
+  ///     A shared pointer to data.
+  ///
+  /// @param[in] byte_order
+  ///     A byte order of the data that we are extracting from.
+  ///
+  /// @param[in] addr_size
+  ///     A new address byte size value.
+  //------------------------------------------------------------------
+  DataEncoder(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order,
+              uint8_t addr_size);
+
+  //------------------------------------------------------------------
+  /// Destructor
+  ///
+  /// If this object contains a valid shared data reference, the
+  /// reference count on the data will be decremented, and if zero,
+  /// the data will be freed.
+  //------------------------------------------------------------------
+  ~DataEncoder();
+
+  //------------------------------------------------------------------
+  /// Clears the object state.
+  ///
+  /// Clears the object contents back to a default invalid state, and
+  /// release any references to shared data that this object may
+  /// contain.
+  //------------------------------------------------------------------
+  void Clear();
+
+  //------------------------------------------------------------------
+  /// Get the current address size.
+  ///
+  /// Return the size in bytes of any address values this object will
+  /// extract.
+  ///
+  /// @return
+  ///     The size in bytes of address values that will be extracted.
+  //------------------------------------------------------------------
+  uint8_t GetAddressByteSize() const { return m_addr_size; }
+
+  //------------------------------------------------------------------
+  /// Get the number of bytes contained in this object.
+  ///
+  /// @return
+  ///     The total number of bytes of data this object refers to.
+  //------------------------------------------------------------------
+  size_t GetByteSize() const { return m_end - m_start; }
+
+  //------------------------------------------------------------------
+  /// Get the data end pointer.
+  ///
+  /// @return
+  ///     Returns a pointer to the next byte contained in this
+  ///     object's data, or NULL of there is no data in this object.
+  //------------------------------------------------------------------
+  uint8_t *GetDataEnd() { return m_end; }
+
+  const uint8_t *GetDataEnd() const { return m_end; }
+
+  //------------------------------------------------------------------
+  /// Get the shared data offset.
+  ///
+  /// Get the offset of the first byte of data in the shared data (if
+  /// any).
+  ///
+  /// @return
+  ///     If this object contains shared data, this function returns
+  ///     the offset in bytes into that shared data, zero otherwise.
+  //------------------------------------------------------------------
+  size_t GetSharedDataOffset() const;
+
+  //------------------------------------------------------------------
+  /// Get the current byte order value.
+  ///
+  /// @return
+  ///     The current byte order value from this object's internal
+  ///     state.
+  //------------------------------------------------------------------
+  lldb::ByteOrder GetByteOrder() const { return m_byte_order; }
+
+  //------------------------------------------------------------------
+  /// Get the data start pointer.
+  ///
+  /// @return
+  ///     Returns a pointer to the first byte contained in this
+  ///     object's data, or NULL of there is no data in this object.
+  //------------------------------------------------------------------
+  uint8_t *GetDataStart() { return m_start; }
+
+  const uint8_t *GetDataStart() const { return m_start; }
+
+  //------------------------------------------------------------------
+  /// Encode unsigned integer values into the data at \a offset.
+  ///
+  /// @param[in] offset
+  ///     The offset within the contained data at which to put the
+  ///     data.
+  ///
+  /// @param[in] value
+  ///     The value to encode into the data.
+  ///
+  /// @return
+  ///     The next offset in the bytes of this data if the data
+  ///     was successfully encoded, UINT32_MAX if the encoding failed.
+  //------------------------------------------------------------------
+  uint32_t PutU8(uint32_t offset, uint8_t value);
+
+  uint32_t PutU16(uint32_t offset, uint16_t value);
+
+  uint32_t PutU32(uint32_t offset, uint32_t value);
+
+  uint32_t PutU64(uint32_t offset, uint64_t value);
+
+  //------------------------------------------------------------------
+  /// Encode an unsigned integer of size \a byte_size to \a offset.
+  ///
+  /// Encode a single integer value at \a offset and return the offset
+  /// that follows the newly encoded integer when the data is successfully
+  /// encoded into the existing data. There must be enough room in the
+  /// data, else UINT32_MAX will be returned to indicate that encoding
+  /// failed.
+  ///
+  /// @param[in] offset
+  ///     The offset within the contained data at which to put the
+  ///     encoded integer.
+  ///
+  /// @param[in] byte_size
+  ///     The size in byte of the integer to encode.
+  ///
+  /// @param[in] value
+  ///     The integer value to write. The least significant bytes of
+  ///     the integer value will be written if the size is less than
+  ///     8 bytes.
+  ///
+  /// @return
+  ///     The next offset in the bytes of this data if the integer
+  ///     was successfully encoded, UINT32_MAX if the encoding failed.
+  //------------------------------------------------------------------
+  uint32_t PutMaxU64(uint32_t offset, uint32_t byte_size, uint64_t value);
+
+  //------------------------------------------------------------------
+  /// Encode an arbitrary number of bytes.
+  ///
+  /// @param[in] offset
+  ///     The offset in bytes into the contained data at which to
+  ///     start encoding.
+  ///
+  /// @param[in] src
+  ///     The buffer that contains the bytes to encode.
+  ///
+  /// @param[in] src_len
+  ///     The number of bytes to encode.
+  ///
+  /// @return
+  ///     The next valid offset within data if the put operation
+  ///     was successful, else UINT32_MAX to indicate the put failed.
+  //------------------------------------------------------------------
+  uint32_t PutData(uint32_t offset, const void *src, uint32_t src_len);
+
+  //------------------------------------------------------------------
+  /// Encode an address in the existing buffer at \a offset bytes into
+  /// the buffer.
+  ///
+  /// Encode a single address (honoring the m_addr_size member) to
+  /// the data and return the next offset where subsequent data would
+  /// go.
+  /// pointed to by \a offset_ptr. The size of the extracted address
+  /// comes from the \a m_addr_size member variable and should be
+  /// set correctly prior to extracting any address values.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The next valid offset within data if the put operation
+  ///     was successful, else UINT32_MAX to indicate the put failed.
+  //------------------------------------------------------------------
+  uint32_t PutAddress(uint32_t offset, lldb::addr_t addr);
+
+  //------------------------------------------------------------------
+  /// Put a C string to \a offset.
+  ///
+  /// Encodes a C string into the existing data including the
+  /// terminating
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     A pointer to the C string value in the data. If the offset
+  ///     pointed to by \a offset_ptr is out of bounds, or if the
+  ///     offset plus the length of the C string is out of bounds,
+  ///     NULL will be returned.
+  //------------------------------------------------------------------
+  uint32_t PutCString(uint32_t offset_ptr, const char *cstr);
+
+  lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; }
+
+  //------------------------------------------------------------------
+  /// Set the address byte size.
+  ///
+  /// Set the size in bytes that will be used when extracting any
+  /// address and pointer values from data contained in this object.
+  ///
+  /// @param[in] addr_size
+  ///     The size in bytes to use when extracting addresses.
+  //------------------------------------------------------------------
+  void SetAddressByteSize(uint8_t addr_size) { m_addr_size = addr_size; }
+
+  //------------------------------------------------------------------
+  /// Set data with a buffer that is caller owned.
+  ///
+  /// Use data that is owned by the caller when extracting values.
+  /// The data must stay around as long as this object, or any object
+  /// that copies a subset of this object's data, is valid. If \a
+  /// bytes is NULL, or \a length is zero, this object will contain
+  /// no data.
+  ///
+  /// @param[in] bytes
+  ///     A pointer to caller owned data.
+  ///
+  /// @param[in] length
+  ///     The length in bytes of \a bytes.
+  ///
+  /// @param[in] byte_order
+  ///     A byte order of the data that we are extracting from.
+  ///
+  /// @return
+  ///     The number of bytes that this object now contains.
+  //------------------------------------------------------------------
+  uint32_t SetData(void *bytes, uint32_t length, lldb::ByteOrder byte_order);
+
+  //------------------------------------------------------------------
+  /// Adopt a subset of shared data in \a data_sp.
+  ///
+  /// Copies the data shared pointer which adds a reference to the
+  /// contained in \a data_sp. The shared data reference is reference
+  /// counted to ensure the data lives as long as anyone still has a
+  /// valid shared pointer to the data in \a data_sp. The byte order
+  /// and address byte size settings remain the same. If
+  /// \a offset is not a valid offset in \a data_sp, then no reference
+  /// to the shared data will be added. If there are not \a length
+  /// bytes available in \a data starting at \a offset, the length
+  /// will be truncated to contains as many bytes as possible.
+  ///
+  /// @param[in] data_sp
+  ///     A shared pointer to data.
+  ///
+  /// @param[in] offset
+  ///     The offset into \a data_sp at which the subset starts.
+  ///
+  /// @param[in] length
+  ///     The length in bytes of the subset of \a data_sp.
+  ///
+  /// @return
+  ///     The number of bytes that this object now contains.
+  //------------------------------------------------------------------
+  uint32_t SetData(const lldb::DataBufferSP &data_sp, uint32_t offset = 0,
+                   uint32_t length = UINT32_MAX);
+
+  //------------------------------------------------------------------
+  /// 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.
+  //------------------------------------------------------------------
+  void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; }
+
+  //------------------------------------------------------------------
+  /// Test the validity of \a offset.
+  ///
+  /// @return
+  ///     \b true if \a offset is a valid offset into the data in this
+  ///     object, \b false otherwise.
+  //------------------------------------------------------------------
+  bool ValidOffset(uint32_t offset) const { return offset < GetByteSize(); }
+
+  //------------------------------------------------------------------
+  /// Test the availability of \a length bytes of data from \a offset.
+  ///
+  /// @return
+  ///     \b true if \a offset is a valid offset and there are \a
+  ///     length bytes available at that offset, \b false otherwise.
+  //------------------------------------------------------------------
+  bool ValidOffsetForDataOfSize(uint32_t offset, uint32_t length) const {
+    return length <= BytesLeft(offset);
+  }
+
+  uint32_t BytesLeft(uint32_t offset) const {
+    const uint32_t size = GetByteSize();
+    if (size > offset)
+      return size - offset;
+    return 0;
+  }
+
+protected:
+  //------------------------------------------------------------------
+  // Member variables
+  //------------------------------------------------------------------
+  uint8_t *m_start; ///< A pointer to the first byte of data.
+  uint8_t *m_end;   ///< A pointer to the byte that is past the end of the data.
+  lldb::ByteOrder
+      m_byte_order;    ///< The byte order of the data we are extracting from.
+  uint8_t m_addr_size; ///< The address size to use when extracting pointers or
+                       /// addresses
+  mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can
+                                        /// be shared among multiple instances
+
+private:
+  DISALLOW_COPY_AND_ASSIGN(DataEncoder);
+};
+
+} // namespace lldb_private
+
+#endif // #if defined (__cplusplus)
+#endif // #ifndef liblldb_DataEncoder_h_

Added: lldb/trunk/include/lldb/Utility/DataExtractor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/DataExtractor.h?rev=296943&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Utility/DataExtractor.h (added)
+++ lldb/trunk/include/lldb/Utility/DataExtractor.h Fri Mar  3 19:30:05 2017
@@ -0,0 +1,1149 @@
+//===-- DataExtractor.h -----------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_UTILITY_DATAEXTRACTOR_H
+#define LLDB_UTILITY_DATAEXTRACTOR_H
+
+// Other libraries and framework includes
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-types.h"
+#include "llvm/ADT/SmallVector.h"
+
+// C Includes
+#include <limits.h>
+#include <stdint.h>
+#include <string.h>
+
+// C++ Includes
+
+namespace lldb_private {
+
+//----------------------------------------------------------------------
+/// @class DataExtractor DataExtractor.h "lldb/Core/DataExtractor.h"
+/// @brief An data extractor class.
+///
+/// DataExtractor is a class that can extract data (swapping if needed)
+/// from a data buffer. The data buffer can be caller owned, or can be
+/// shared data that can be shared between multiple DataExtractor
+/// instances. Multiple DataExtractor objects can share the same data,
+/// yet extract values in different address sizes and byte order modes.
+/// Each object can have a unique position in the shared data and extract
+/// data from different offsets.
+///
+/// @see DataBuffer
+//----------------------------------------------------------------------
+class DataExtractor {
+public:
+  //------------------------------------------------------------------
+  /// @typedef DataExtractor::Type
+  /// @brief Type enumerations used in the dump routines.
+  //------------------------------------------------------------------
+  typedef enum {
+    TypeUInt8,   ///< Format output as unsigned 8 bit integers
+    TypeChar,    ///< Format output as characters
+    TypeUInt16,  ///< Format output as unsigned 16 bit integers
+    TypeUInt32,  ///< Format output as unsigned 32 bit integers
+    TypeUInt64,  ///< Format output as unsigned 64 bit integers
+    TypePointer, ///< Format output as pointers
+    TypeULEB128, ///< Format output as ULEB128 numbers
+    TypeSLEB128  ///< Format output as SLEB128 numbers
+  } Type;
+
+  //------------------------------------------------------------------
+  /// Default constructor.
+  ///
+  /// Initialize all members to a default empty state.
+  //------------------------------------------------------------------
+  DataExtractor();
+
+  //------------------------------------------------------------------
+  /// Construct with a buffer that is owned by the caller.
+  ///
+  /// This constructor allows us to use data that is owned by the
+  /// caller. The data must stay around as long as this object is
+  /// valid.
+  ///
+  /// @param[in] data
+  ///     A pointer to caller owned data.
+  ///
+  /// @param[in] data_length
+  ///     The length in bytes of \a data.
+  ///
+  /// @param[in] byte_order
+  ///     A byte order of the data that we are extracting from.
+  ///
+  /// @param[in] addr_size
+  ///     A new address byte size value.
+  ///
+  /// @param[in] target_byte_size
+  ///     A size of a target byte in 8-bit host bytes
+  //------------------------------------------------------------------
+  DataExtractor(const void *data, lldb::offset_t data_length,
+                lldb::ByteOrder byte_order, uint32_t addr_size,
+                uint32_t target_byte_size = 1);
+
+  //------------------------------------------------------------------
+  /// Construct with shared data.
+  ///
+  /// Copies the data shared pointer which adds a reference to the
+  /// contained in \a data_sp. The shared data reference is reference
+  /// counted to ensure the data lives as long as anyone still has a
+  /// valid shared pointer to the data in \a data_sp.
+  ///
+  /// @param[in] data_sp
+  ///     A shared pointer to data.
+  ///
+  /// @param[in] byte_order
+  ///     A byte order of the data that we are extracting from.
+  ///
+  /// @param[in] addr_size
+  ///     A new address byte size value.
+  ///
+  /// @param[in] target_byte_size
+  ///     A size of a target byte in 8-bit host bytes
+  //------------------------------------------------------------------
+  DataExtractor(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order,
+                uint32_t addr_size, uint32_t target_byte_size = 1);
+
+  //------------------------------------------------------------------
+  /// Construct with a subset of \a data.
+  ///
+  /// Initialize this object with a subset of the data bytes in \a
+  /// data. If \a data contains shared data, then a reference to the
+  /// shared data will be added to ensure the shared data stays around
+  /// as long as any objects have references to the shared data. The
+  /// byte order value and the address size settings are copied from \a
+  /// data. If \a offset is not a valid offset in \a data, then no
+  /// reference to the shared data will be added. If there are not
+  /// \a length bytes available in \a data starting at \a offset,
+  /// the length will be truncated to contain as many bytes as
+  /// possible.
+  ///
+  /// @param[in] data
+  ///     Another DataExtractor object that contains data.
+  ///
+  /// @param[in] offset
+  ///     The offset into \a data at which the subset starts.
+  ///
+  /// @param[in] length
+  ///     The length in bytes of the subset of data.
+  ///
+  /// @param[in] target_byte_size
+  ///     A size of a target byte in 8-bit host bytes
+  //------------------------------------------------------------------
+  DataExtractor(const DataExtractor &data, lldb::offset_t offset,
+                lldb::offset_t length, uint32_t target_byte_size = 1);
+
+  DataExtractor(const DataExtractor &rhs);
+
+  //------------------------------------------------------------------
+  /// Assignment operator.
+  ///
+  /// Copies all data, byte order and address size settings from \a rhs into
+  /// this object. If \a rhs contains shared data, a reference to that
+  /// shared data will be added.
+  ///
+  /// @param[in] rhs
+  ///     Another DataExtractor object to copy.
+  ///
+  /// @return
+  ///     A const reference to this object.
+  //------------------------------------------------------------------
+  const DataExtractor &operator=(const DataExtractor &rhs);
+
+  //------------------------------------------------------------------
+  /// Destructor
+  ///
+  /// If this object contains a valid shared data reference, the
+  /// reference count on the data will be decremented, and if zero,
+  /// the data will be freed.
+  //------------------------------------------------------------------
+  virtual ~DataExtractor();
+
+  uint32_t getTargetByteSize() const { return m_target_byte_size; }
+
+  //------------------------------------------------------------------
+  /// Clears the object state.
+  ///
+  /// Clears the object contents back to a default invalid state, and
+  /// release any references to shared data that this object may
+  /// contain.
+  //------------------------------------------------------------------
+  void Clear();
+
+  //------------------------------------------------------------------
+  /// Dumps the binary data as \a type objects to stream \a s (or to
+  /// Log() if \a s is nullptr) starting \a offset bytes into the data
+  /// and stopping after dumping \a length bytes. The offset into the
+  /// data is displayed at the beginning of each line and can be
+  /// offset by base address \a base_addr. \a num_per_line objects
+  /// will be displayed on each line.
+  ///
+  /// @param[in] s
+  ///     The stream to dump the output to. If nullptr the output will
+  ///     be dumped to Log().
+  ///
+  /// @param[in] offset
+  ///     The offset into the data at which to start dumping.
+  ///
+  /// @param[in] length
+  ///     The number of bytes to dump.
+  ///
+  /// @param[in] base_addr
+  ///     The base address that gets added to the offset displayed on
+  ///     each line.
+  ///
+  /// @param[in] num_per_line
+  ///     The number of \a type objects to display on each line.
+  ///
+  /// @param[in] type
+  ///     The type of objects to use when dumping data from this
+  ///     object. See DataExtractor::Type.
+  ///
+  /// @param[in] type_format
+  ///     The optional format to use for the \a type objects. If this
+  ///     is nullptr, the default format for the \a type will be used.
+  ///
+  /// @return
+  ///     The offset at which dumping ended.
+  //------------------------------------------------------------------
+  lldb::offset_t PutToLog(Log *log, lldb::offset_t offset,
+                          lldb::offset_t length, uint64_t base_addr,
+                          uint32_t num_per_line, Type type,
+                          const char *type_format = nullptr) const;
+
+  //------------------------------------------------------------------
+  /// Dump a UUID value at \a offset.
+  ///
+  /// Dump a UUID starting at \a offset bytes into this object's data.
+  /// If the stream \a s is nullptr, the output will be sent to Log().
+  ///
+  /// @param[in] s
+  ///     The stream to dump the output to. If nullptr the output will
+  ///     be dumped to Log().
+  ///
+  /// @param[in] offset
+  ///     The offset into the data at which to extract and dump a
+  ///     UUID value.
+  //------------------------------------------------------------------
+  void DumpUUID(Stream *s, lldb::offset_t offset) const;
+
+  //------------------------------------------------------------------
+  /// Extract an arbitrary number of bytes in the specified byte
+  /// order.
+  ///
+  /// Attemps to extract \a length bytes starting at \a offset bytes
+  /// into this data in the requested byte order (\a dst_byte_order)
+  /// and place the results in \a dst. \a dst must be at least \a
+  /// length bytes long.
+  ///
+  /// @param[in] offset
+  ///     The offset in bytes into the contained data at which to
+  ///     start extracting.
+  ///
+  /// @param[in] length
+  ///     The number of bytes to extract.
+  ///
+  /// @param[in] dst_byte_order
+  ///     A byte order of the data that we want when the value in
+  ///     copied to \a dst.
+  ///
+  /// @param[out] dst
+  ///     The buffer that will receive the extracted value if there
+  ///     are enough bytes available in the current data.
+  ///
+  /// @return
+  ///     The number of bytes that were extracted which will be \a
+  ///     length when the value is successfully extracted, or zero
+  ///     if there aren't enough bytes at the specified offset.
+  //------------------------------------------------------------------
+  size_t ExtractBytes(lldb::offset_t offset, lldb::offset_t length,
+                      lldb::ByteOrder dst_byte_order, void *dst) const;
+
+  //------------------------------------------------------------------
+  /// Extract an address from \a *offset_ptr.
+  ///
+  /// Extract a single address from the data and update the offset
+  /// pointed to by \a offset_ptr. The size of the extracted address
+  /// comes from the \a m_addr_size member variable and should be
+  /// set correctly prior to extracting any address values.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted address value.
+  //------------------------------------------------------------------
+  uint64_t GetAddress(lldb::offset_t *offset_ptr) const;
+
+  uint64_t GetAddress_unchecked(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Get the current address size.
+  ///
+  /// Return the size in bytes of any address values this object will
+  /// extract.
+  ///
+  /// @return
+  ///     The size in bytes of address values that will be extracted.
+  //------------------------------------------------------------------
+  uint32_t GetAddressByteSize() const { return m_addr_size; }
+
+  //------------------------------------------------------------------
+  /// Get the number of bytes contained in this object.
+  ///
+  /// @return
+  ///     The total number of bytes of data this object refers to.
+  //------------------------------------------------------------------
+  uint64_t GetByteSize() const { return m_end - m_start; }
+
+  //------------------------------------------------------------------
+  /// Extract a C string from \a *offset_ptr.
+  ///
+  /// Returns a pointer to a C String from the data at the offset
+  /// pointed to by \a offset_ptr. A variable length NULL terminated C
+  /// string will be extracted and the \a offset_ptr will be
+  /// updated with the offset of the byte that follows the NULL
+  /// terminator byte.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     A pointer to the C string value in the data. If the offset
+  ///     pointed to by \a offset_ptr is out of bounds, or if the
+  ///     offset plus the length of the C string is out of bounds,
+  ///     nullptr will be returned.
+  //------------------------------------------------------------------
+  const char *GetCStr(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Extract a C string from \a *offset_ptr with field size \a len.
+  ///
+  /// Returns a pointer to a C String from the data at the offset
+  /// pointed to by \a offset_ptr, with a field length of \a len.
+  /// A NULL terminated C string will be extracted and the \a offset_ptr
+  /// will be updated with the offset of the byte that follows the fixed
+  /// length field.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     A pointer to the C string value in the data. If the offset
+  ///     pointed to by \a offset_ptr is out of bounds, or if the
+  ///     offset plus the length of the field is out of bounds, or if
+  ///     the field does not contain a NULL terminator byte, nullptr will
+  ///     be returned.
+  const char *GetCStr(lldb::offset_t *offset_ptr, lldb::offset_t len) const;
+
+  //------------------------------------------------------------------
+  /// Extract \a length bytes from \a *offset_ptr.
+  ///
+  /// Returns a pointer to a bytes in this object's data at the offset
+  /// pointed to by \a offset_ptr. If \a length is zero or too large,
+  /// then the offset pointed to by \a offset_ptr will not be updated
+  /// and nullptr will be returned.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[in] length
+  ///     The optional length of a string to extract. If the value is
+  ///     zero, a NULL terminated C string will be extracted.
+  ///
+  /// @return
+  ///     A pointer to the bytes in this object's data if the offset
+  ///     and length are valid, or nullptr otherwise.
+  //------------------------------------------------------------------
+  const void *GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const {
+    const uint8_t *ptr = PeekData(*offset_ptr, length);
+    if (ptr)
+      *offset_ptr += length;
+    return ptr;
+  }
+
+  //------------------------------------------------------------------
+  /// Copy \a length bytes from \a *offset, without swapping bytes.
+  ///
+  /// @param[in] offset
+  ///     The offset into this data from which to start copying
+  ///
+  /// @param[in] length
+  ///     The length of the data to copy from this object
+  ///
+  /// @param[out] dst
+  ///     The buffer to place the output data.
+  ///
+  /// @return
+  ///     Returns the number of bytes that were copied, or zero if
+  ///     anything goes wrong.
+  //------------------------------------------------------------------
+  lldb::offset_t CopyData(lldb::offset_t offset, lldb::offset_t length,
+                          void *dst) const;
+
+  //------------------------------------------------------------------
+  /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied
+  /// data is treated as a value that can be swapped to match the
+  /// specified byte order.
+  ///
+  /// For values that are larger than the supported integer sizes,
+  /// this function can be used to extract data in a specified byte
+  /// order. It can also be used to copy a smaller integer value from
+  /// to a larger value. The extra bytes left over will be padded
+  /// correctly according to the byte order of this object and the
+  /// \a dst_byte_order. This can be very handy when say copying a
+  /// partial data value into a register.
+  ///
+  /// @param[in] src_offset
+  ///     The offset into this data from which to start copying an
+  ///     endian entity
+  ///
+  /// @param[in] src_len
+  ///     The length of the endian data to copy from this object
+  ///     into the \a dst object
+  ///
+  /// @param[out] dst
+  ///     The buffer where to place the endian data. The data might
+  ///     need to be byte swapped (and appropriately padded with
+  ///     zeroes if \a src_len != \a dst_len) if \a dst_byte_order
+  ///     does not match the byte order in this object.
+  ///
+  /// @param[in] dst_len
+  ///     The length number of bytes that the endian value will
+  ///     occupy is \a dst.
+  ///
+  /// @param[in] byte_order
+  ///     The byte order that the endian value should be in the \a dst
+  ///     buffer.
+  ///
+  /// @return
+  ///     Returns the number of bytes that were copied, or zero if
+  ///     anything goes wrong.
+  //------------------------------------------------------------------
+  lldb::offset_t CopyByteOrderedData(lldb::offset_t src_offset,
+                                     lldb::offset_t src_len, void *dst,
+                                     lldb::offset_t dst_len,
+                                     lldb::ByteOrder dst_byte_order) const;
+
+  //------------------------------------------------------------------
+  /// Get the data end pointer.
+  ///
+  /// @return
+  ///     Returns a pointer to the next byte contained in this
+  ///     object's data, or nullptr of there is no data in this object.
+  //------------------------------------------------------------------
+  const uint8_t *GetDataEnd() const { return m_end; }
+
+  //------------------------------------------------------------------
+  /// Get the shared data offset.
+  ///
+  /// Get the offset of the first byte of data in the shared data (if
+  /// any).
+  ///
+  /// @return
+  ///     If this object contains shared data, this function returns
+  ///     the offset in bytes into that shared data, zero otherwise.
+  //------------------------------------------------------------------
+  size_t GetSharedDataOffset() const;
+
+  //------------------------------------------------------------------
+  /// Get the data start pointer.
+  ///
+  /// @return
+  ///     Returns a pointer to the first byte contained in this
+  ///     object's data, or nullptr of there is no data in this object.
+  //------------------------------------------------------------------
+  const uint8_t *GetDataStart() const { return m_start; }
+
+  //------------------------------------------------------------------
+  /// Extract a float from \a *offset_ptr.
+  ///
+  /// Extract a single float value.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The floating value that was extracted, or zero on failure.
+  //------------------------------------------------------------------
+  float GetFloat(lldb::offset_t *offset_ptr) const;
+
+  double GetDouble(lldb::offset_t *offset_ptr) const;
+
+  long double GetLongDouble(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Extract an integer of size \a byte_size from \a *offset_ptr.
+  ///
+  /// Extract a single integer value and update the offset pointed to
+  /// by \a offset_ptr. The size of the extracted integer is specified
+  /// by the \a byte_size argument. \a byte_size should have a value
+  /// >= 1 and <= 4 since the return value is only 32 bits wide. Any
+  /// \a byte_size values less than 1 or greater than 4 will result in
+  /// nothing being extracted, and zero being returned.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[in] byte_size
+  ///     The size in byte of the integer to extract.
+  ///
+  /// @return
+  ///     The integer value that was extracted, or zero on failure.
+  //------------------------------------------------------------------
+  uint32_t GetMaxU32(lldb::offset_t *offset_ptr, size_t byte_size) const;
+
+  //------------------------------------------------------------------
+  /// Extract an unsigned integer of size \a byte_size from \a
+  /// *offset_ptr.
+  ///
+  /// Extract a single unsigned integer value and update the offset
+  /// pointed to by \a offset_ptr. The size of the extracted integer
+  /// is specified by the \a byte_size argument. \a byte_size should
+  /// have a value greater than or equal to one and less than or equal
+  /// to eight since the return value is 64 bits wide. Any
+  /// \a byte_size values less than 1 or greater than 8 will result in
+  /// nothing being extracted, and zero being returned.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[in] byte_size
+  ///     The size in byte of the integer to extract.
+  ///
+  /// @return
+  ///     The unsigned integer value that was extracted, or zero on
+  ///     failure.
+  //------------------------------------------------------------------
+  uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const;
+
+  uint64_t GetMaxU64_unchecked(lldb::offset_t *offset_ptr,
+                               size_t byte_size) const;
+
+  //------------------------------------------------------------------
+  /// Extract an signed integer of size \a byte_size from \a *offset_ptr.
+  ///
+  /// Extract a single signed integer value (sign extending if required)
+  /// and update the offset pointed to by \a offset_ptr. The size of
+  /// the extracted integer is specified by the \a byte_size argument.
+  /// \a byte_size should have a value greater than or equal to one
+  /// and less than or equal to eight since the return value is 64
+  /// bits wide. Any \a byte_size values less than 1 or greater than
+  /// 8 will result in nothing being extracted, and zero being returned.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[in] byte_size
+  ///     The size in byte of the integer to extract.
+  ///
+  /// @return
+  ///     The sign extended signed integer value that was extracted,
+  ///     or zero on failure.
+  //------------------------------------------------------------------
+  int64_t GetMaxS64(lldb::offset_t *offset_ptr, size_t size) const;
+
+  //------------------------------------------------------------------
+  /// Extract an unsigned integer of size \a byte_size from \a
+  /// *offset_ptr, then extract the bitfield from this value if
+  /// \a bitfield_bit_size is non-zero.
+  ///
+  /// Extract a single unsigned integer value and update the offset
+  /// pointed to by \a offset_ptr. The size of the extracted integer
+  /// is specified by the \a byte_size argument. \a byte_size should
+  /// have a value greater than or equal to one and less than or equal
+  /// to 8 since the return value is 64 bits wide. Any
+  /// \a byte_size values less than 1 or greater than 8 will result in
+  /// nothing being extracted, and zero being returned.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[in] byte_size
+  ///     The size in byte of the integer to extract.
+  ///
+  /// @param[in] bitfield_bit_size
+  ///     The size in bits of the bitfield value to extract, or zero
+  ///     to just extract the entire integer value.
+  ///
+  /// @param[in] bitfield_bit_offset
+  ///     The bit offset of the bitfield value in the extracted
+  ///     integer.  For little-endian data, this is the offset of
+  ///     the LSB of the bitfield from the LSB of the integer.
+  ///     For big-endian data, this is the offset of the MSB of the
+  ///     bitfield from the MSB of the integer.
+  ///
+  /// @return
+  ///     The unsigned bitfield integer value that was extracted, or
+  ///     zero on failure.
+  //------------------------------------------------------------------
+  uint64_t GetMaxU64Bitfield(lldb::offset_t *offset_ptr, size_t size,
+                             uint32_t bitfield_bit_size,
+                             uint32_t bitfield_bit_offset) const;
+
+  //------------------------------------------------------------------
+  /// Extract an signed integer of size \a byte_size from \a
+  /// *offset_ptr, then extract and signe extend the bitfield from
+  /// this value if \a bitfield_bit_size is non-zero.
+  ///
+  /// Extract a single signed integer value (sign extending if required)
+  /// and update the offset pointed to by \a offset_ptr. The size of
+  /// the extracted integer is specified by the \a byte_size argument.
+  /// \a byte_size should have a value greater than or equal to one
+  /// and less than or equal to eight since the return value is 64
+  /// bits wide. Any \a byte_size values less than 1 or greater than
+  /// 8 will result in nothing being extracted, and zero being returned.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[in] byte_size
+  ///     The size in bytes of the integer to extract.
+  ///
+  /// @param[in] bitfield_bit_size
+  ///     The size in bits of the bitfield value to extract, or zero
+  ///     to just extract the entire integer value.
+  ///
+  /// @param[in] bitfield_bit_offset
+  ///     The bit offset of the bitfield value in the extracted
+  ///     integer.  For little-endian data, this is the offset of
+  ///     the LSB of the bitfield from the LSB of the integer.
+  ///     For big-endian data, this is the offset of the MSB of the
+  ///     bitfield from the MSB of the integer.
+  ///
+  /// @return
+  ///     The signed bitfield integer value that was extracted, or
+  ///     zero on failure.
+  //------------------------------------------------------------------
+  int64_t GetMaxS64Bitfield(lldb::offset_t *offset_ptr, size_t size,
+                            uint32_t bitfield_bit_size,
+                            uint32_t bitfield_bit_offset) const;
+
+  //------------------------------------------------------------------
+  /// Extract an pointer from \a *offset_ptr.
+  ///
+  /// Extract a single pointer from the data and update the offset
+  /// pointed to by \a offset_ptr. The size of the extracted pointer
+  /// comes from the \a m_addr_size member variable and should be
+  /// set correctly prior to extracting any pointer values.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted pointer value as a 64 integer.
+  //------------------------------------------------------------------
+  uint64_t GetPointer(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Get the current byte order value.
+  ///
+  /// @return
+  ///     The current byte order value from this object's internal
+  ///     state.
+  //------------------------------------------------------------------
+  lldb::ByteOrder GetByteOrder() const { return m_byte_order; }
+
+  //------------------------------------------------------------------
+  /// Extract a uint8_t value from \a *offset_ptr.
+  ///
+  /// Extract a single uint8_t from the binary data at the offset
+  /// pointed to by \a offset_ptr, and advance the offset on success.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted uint8_t value.
+  //------------------------------------------------------------------
+  uint8_t GetU8(lldb::offset_t *offset_ptr) const;
+
+  uint8_t GetU8_unchecked(lldb::offset_t *offset_ptr) const {
+    uint8_t val = m_start[*offset_ptr];
+    *offset_ptr += 1;
+    return val;
+  }
+
+  uint16_t GetU16_unchecked(lldb::offset_t *offset_ptr) const;
+
+  uint32_t GetU32_unchecked(lldb::offset_t *offset_ptr) const;
+
+  uint64_t GetU64_unchecked(lldb::offset_t *offset_ptr) const;
+  //------------------------------------------------------------------
+  /// Extract \a count uint8_t values from \a *offset_ptr.
+  ///
+  /// Extract \a count uint8_t values from the binary data at the
+  /// offset pointed to by \a offset_ptr, and advance the offset on
+  /// success. The extracted values are copied into \a dst.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[out] dst
+  ///     A buffer to copy \a count uint8_t values into. \a dst must
+  ///     be large enough to hold all requested data.
+  ///
+  /// @param[in] count
+  ///     The number of uint8_t values to extract.
+  ///
+  /// @return
+  ///     \a dst if all values were properly extracted and copied,
+  ///     nullptr otherwise.
+  //------------------------------------------------------------------
+  void *GetU8(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
+
+  //------------------------------------------------------------------
+  /// Extract a uint16_t value from \a *offset_ptr.
+  ///
+  /// Extract a single uint16_t from the binary data at the offset
+  /// pointed to by \a offset_ptr, and update the offset on success.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted uint16_t value.
+  //------------------------------------------------------------------
+  uint16_t GetU16(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Extract \a count uint16_t values from \a *offset_ptr.
+  ///
+  /// Extract \a count uint16_t values from the binary data at the
+  /// offset pointed to by \a offset_ptr, and advance the offset on
+  /// success. The extracted values are copied into \a dst.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[out] dst
+  ///     A buffer to copy \a count uint16_t values into. \a dst must
+  ///     be large enough to hold all requested data.
+  ///
+  /// @param[in] count
+  ///     The number of uint16_t values to extract.
+  ///
+  /// @return
+  ///     \a dst if all values were properly extracted and copied,
+  ///     nullptr otherwise.
+  //------------------------------------------------------------------
+  void *GetU16(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
+
+  //------------------------------------------------------------------
+  /// Extract a uint32_t value from \a *offset_ptr.
+  ///
+  /// Extract a single uint32_t from the binary data at the offset
+  /// pointed to by \a offset_ptr, and update the offset on success.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted uint32_t value.
+  //------------------------------------------------------------------
+  uint32_t GetU32(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Extract \a count uint32_t values from \a *offset_ptr.
+  ///
+  /// Extract \a count uint32_t values from the binary data at the
+  /// offset pointed to by \a offset_ptr, and advance the offset on
+  /// success. The extracted values are copied into \a dst.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[out] dst
+  ///     A buffer to copy \a count uint32_t values into. \a dst must
+  ///     be large enough to hold all requested data.
+  ///
+  /// @param[in] count
+  ///     The number of uint32_t values to extract.
+  ///
+  /// @return
+  ///     \a dst if all values were properly extracted and copied,
+  ///     nullptr otherwise.
+  //------------------------------------------------------------------
+  void *GetU32(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
+
+  //------------------------------------------------------------------
+  /// Extract a uint64_t value from \a *offset_ptr.
+  ///
+  /// Extract a single uint64_t from the binary data at the offset
+  /// pointed to by \a offset_ptr, and update the offset on success.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted uint64_t value.
+  //------------------------------------------------------------------
+  uint64_t GetU64(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Extract \a count uint64_t values from \a *offset_ptr.
+  ///
+  /// Extract \a count uint64_t values from the binary data at the
+  /// offset pointed to by \a offset_ptr, and advance the offset on
+  /// success. The extracted values are copied into \a dst.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @param[out] dst
+  ///     A buffer to copy \a count uint64_t values into. \a dst must
+  ///     be large enough to hold all requested data.
+  ///
+  /// @param[in] count
+  ///     The number of uint64_t values to extract.
+  ///
+  /// @return
+  ///     \a dst if all values were properly extracted and copied,
+  ///     nullptr otherwise.
+  //------------------------------------------------------------------
+  void *GetU64(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
+
+  //------------------------------------------------------------------
+  /// Extract a signed LEB128 value from \a *offset_ptr.
+  ///
+  /// Extracts an signed LEB128 number from this object's data
+  /// starting at the offset pointed to by \a offset_ptr. The offset
+  /// pointed to by \a offset_ptr will be updated with the offset of
+  /// the byte following the last extracted byte.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted signed integer value.
+  //------------------------------------------------------------------
+  int64_t GetSLEB128(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Extract a unsigned LEB128 value from \a *offset_ptr.
+  ///
+  /// Extracts an unsigned LEB128 number from this object's data
+  /// starting at the offset pointed to by \a offset_ptr. The offset
+  /// pointed to by \a offset_ptr will be updated with the offset of
+  /// the byte following the last extracted byte.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  ///     The extracted unsigned integer value.
+  //------------------------------------------------------------------
+  uint64_t GetULEB128(lldb::offset_t *offset_ptr) const;
+
+  lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; }
+
+  //------------------------------------------------------------------
+  /// Peek at a C string at \a offset.
+  ///
+  /// Peeks at a string in the contained data. No verification is done
+  /// to make sure the entire string lies within the bounds of this
+  /// object's data, only \a offset is verified to be a valid offset.
+  ///
+  /// @param[in] offset
+  ///     An offset into the data.
+  ///
+  /// @return
+  ///     A non-nullptr C string pointer if \a offset is a valid offset,
+  ///     nullptr otherwise.
+  //------------------------------------------------------------------
+  const char *PeekCStr(lldb::offset_t offset) const;
+
+  //------------------------------------------------------------------
+  /// Peek at a bytes at \a offset.
+  ///
+  /// Returns a pointer to \a length bytes at \a offset as long as
+  /// there are \a length bytes available starting at \a offset.
+  ///
+  /// @return
+  ///     A non-nullptr data pointer if \a offset is a valid offset and
+  ///     there are \a length bytes available at that offset, nullptr
+  ///     otherwise.
+  //------------------------------------------------------------------
+  const uint8_t *PeekData(lldb::offset_t offset, lldb::offset_t length) const {
+    if (ValidOffsetForDataOfSize(offset, length))
+      return m_start + offset;
+    return nullptr;
+  }
+
+  //------------------------------------------------------------------
+  /// Set the address byte size.
+  ///
+  /// Set the size in bytes that will be used when extracting any
+  /// address and pointer values from data contained in this object.
+  ///
+  /// @param[in] addr_size
+  ///     The size in bytes to use when extracting addresses.
+  //------------------------------------------------------------------
+  void SetAddressByteSize(uint32_t addr_size) {
+#ifdef LLDB_CONFIGURATION_DEBUG
+    assert(addr_size == 4 || addr_size == 8);
+#endif
+    m_addr_size = addr_size;
+  }
+
+  //------------------------------------------------------------------
+  /// Set data with a buffer that is caller owned.
+  ///
+  /// Use data that is owned by the caller when extracting values.
+  /// The data must stay around as long as this object, or any object
+  /// that copies a subset of this object's data, is valid. If \a
+  /// bytes is nullptr, or \a length is zero, this object will contain
+  /// no data.
+  ///
+  /// @param[in] bytes
+  ///     A pointer to caller owned data.
+  ///
+  /// @param[in] length
+  ///     The length in bytes of \a bytes.
+  ///
+  /// @param[in] byte_order
+  ///     A byte order of the data that we are extracting from.
+  ///
+  /// @return
+  ///     The number of bytes that this object now contains.
+  //------------------------------------------------------------------
+  lldb::offset_t SetData(const void *bytes, lldb::offset_t length,
+                         lldb::ByteOrder byte_order);
+
+  //------------------------------------------------------------------
+  /// Adopt a subset of \a data.
+  ///
+  /// Set this object's data to be a subset of the data bytes in \a
+  /// data. If \a data contains shared data, then a reference to the
+  /// shared data will be added to ensure the shared data stays around
+  /// as long as any objects have references to the shared data. The
+  /// byte order and the address size settings are copied from \a
+  /// data. If \a offset is not a valid offset in \a data, then no
+  /// reference to the shared data will be added. If there are not
+  /// \a length bytes available in \a data starting at \a offset,
+  /// the length will be truncated to contains as many bytes as
+  /// possible.
+  ///
+  /// @param[in] data
+  ///     Another DataExtractor object that contains data.
+  ///
+  /// @param[in] offset
+  ///     The offset into \a data at which the subset starts.
+  ///
+  /// @param[in] length
+  ///     The length in bytes of the subset of \a data.
+  ///
+  /// @return
+  ///     The number of bytes that this object now contains.
+  //------------------------------------------------------------------
+  lldb::offset_t SetData(const DataExtractor &data, lldb::offset_t offset,
+                         lldb::offset_t length);
+
+  //------------------------------------------------------------------
+  /// Adopt a subset of shared data in \a data_sp.
+  ///
+  /// Copies the data shared pointer which adds a reference to the
+  /// contained in \a data_sp. The shared data reference is reference
+  /// counted to ensure the data lives as long as anyone still has a
+  /// valid shared pointer to the data in \a data_sp. The byte order
+  /// and address byte size settings remain the same. If
+  /// \a offset is not a valid offset in \a data_sp, then no reference
+  /// to the shared data will be added. If there are not \a length
+  /// bytes available in \a data starting at \a offset, the length
+  /// will be truncated to contains as many bytes as possible.
+  ///
+  /// @param[in] data_sp
+  ///     A shared pointer to data.
+  ///
+  /// @param[in] offset
+  ///     The offset into \a data_sp at which the subset starts.
+  ///
+  /// @param[in] length
+  ///     The length in bytes of the subset of \a data_sp.
+  ///
+  /// @return
+  ///     The number of bytes that this object now contains.
+  //------------------------------------------------------------------
+  lldb::offset_t SetData(const lldb::DataBufferSP &data_sp,
+                         lldb::offset_t offset = 0,
+                         lldb::offset_t length = LLDB_INVALID_OFFSET);
+
+  //------------------------------------------------------------------
+  /// 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.
+  //------------------------------------------------------------------
+  void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; }
+
+  //------------------------------------------------------------------
+  /// Skip an LEB128 number at \a *offset_ptr.
+  ///
+  /// Skips a LEB128 number (signed or unsigned) from this object's
+  /// data starting at the offset pointed to by \a offset_ptr. The
+  /// offset pointed to by \a offset_ptr will be updated with the
+  /// offset of the byte following the last extracted byte.
+  ///
+  /// @param[in,out] offset_ptr
+  ///     A pointer to an offset within the data that will be advanced
+  ///     by the appropriate number of bytes if the value is extracted
+  ///     correctly. If the offset is out of bounds or there are not
+  ///     enough bytes to extract this value, the offset will be left
+  ///     unmodified.
+  ///
+  /// @return
+  //      The number of bytes consumed during the extraction.
+  //------------------------------------------------------------------
+  uint32_t Skip_LEB128(lldb::offset_t *offset_ptr) const;
+
+  //------------------------------------------------------------------
+  /// Test the validity of \a offset.
+  ///
+  /// @return
+  ///     \b true if \a offset is a valid offset into the data in this
+  ///     object, \b false otherwise.
+  //------------------------------------------------------------------
+  bool ValidOffset(lldb::offset_t offset) const {
+    return offset < GetByteSize();
+  }
+
+  //------------------------------------------------------------------
+  /// Test the availability of \a length bytes of data from \a offset.
+  ///
+  /// @return
+  ///     \b true if \a offset is a valid offset and there are \a
+  ///     length bytes available at that offset, \b false otherwise.
+  //------------------------------------------------------------------
+  bool ValidOffsetForDataOfSize(lldb::offset_t offset,
+                                lldb::offset_t length) const {
+    return length <= BytesLeft(offset);
+  }
+
+  size_t Copy(DataExtractor &dest_data) const;
+
+  bool Append(DataExtractor &rhs);
+
+  bool Append(void *bytes, lldb::offset_t length);
+
+  lldb::offset_t BytesLeft(lldb::offset_t offset) const {
+    const lldb::offset_t size = GetByteSize();
+    if (size > offset)
+      return size - offset;
+    return 0;
+  }
+
+  void Checksum(llvm::SmallVectorImpl<uint8_t> &dest, uint64_t max_data = 0);
+
+protected:
+  //------------------------------------------------------------------
+  // Member variables
+  //------------------------------------------------------------------
+  const uint8_t *m_start; ///< A pointer to the first byte of data.
+  const uint8_t
+      *m_end; ///< A pointer to the byte that is past the end of the data.
+  lldb::ByteOrder
+      m_byte_order;     ///< The byte order of the data we are extracting from.
+  uint32_t m_addr_size; ///< The address size to use when extracting pointers or
+                        /// addresses
+  mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can
+                                        /// be shared among multiple instances
+  const uint32_t m_target_byte_size;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_DataExtractor_h_

Modified: lldb/trunk/source/API/SBData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBData.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/API/SBData.cpp (original)
+++ lldb/trunk/source/API/SBData.cpp Fri Mar  3 19:30:05 2017
@@ -13,9 +13,9 @@
 #include "lldb/API/SBError.h"
 #include "lldb/API/SBStream.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DumpDataExtractor.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"
 

Modified: lldb/trunk/source/API/SBInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstruction.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/API/SBInstruction.cpp (original)
+++ lldb/trunk/source/API/SBInstruction.cpp Fri Mar  3 19:30:05 2017
@@ -16,8 +16,6 @@
 #include "lldb/API/SBTarget.h"
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/Module.h"
@@ -25,6 +23,8 @@
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 
 //----------------------------------------------------------------------
 // We recently fixed a leak in one of the Instruction subclasses where

Modified: lldb/trunk/source/API/SBSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSection.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSection.cpp (original)
+++ lldb/trunk/source/API/SBSection.cpp Fri Mar  3 19:30:05 2017
@@ -10,11 +10,11 @@
 #include "lldb/API/SBSection.h"
 #include "lldb/API/SBStream.h"
 #include "lldb/API/SBTarget.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Fri Mar  3 19:30:05 2017
@@ -17,7 +17,6 @@
 #include "lldb/API/SBTypeSynthetic.h"
 
 #include "lldb/Breakpoint/Watchpoint.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/Section.h"
@@ -37,6 +36,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"
 

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Fri Mar  3 19:30:05 2017
@@ -17,7 +17,6 @@
 // Project includes
 #include "CommandObjectMemory.h"
 #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/Module.h"
@@ -41,6 +40,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/StreamString.h"
 
 #include "lldb/lldb-private.h"

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 // Other libraries and framework includes
 // Project includes
 #include "CommandObjectPlatform.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
@@ -27,6 +26,7 @@
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataExtractor.h"
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/Threading.h"

Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Fri Mar  3 19:30:05 2017
@@ -14,7 +14,6 @@
 
 // Project includes
 #include "CommandObjectRegister.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataExtractor.h"
 
 using namespace lldb;
 using namespace lldb_private;

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Fri Mar  3 19:30:05 2017
@@ -9,10 +9,6 @@ add_lldb_library(lldbCore
   Broadcaster.cpp
   Communication.cpp
   Connection.cpp
-  DataBufferHeap.cpp
-  DataBufferLLVM.cpp
-  DataEncoder.cpp
-  DataExtractor.cpp
   Debugger.cpp
   Disassembler.cpp
   DumpDataExtractor.cpp

Removed: lldb/trunk/source/Core/DataBufferHeap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferHeap.cpp?rev=296942&view=auto
==============================================================================
--- lldb/trunk/source/Core/DataBufferHeap.cpp (original)
+++ lldb/trunk/source/Core/DataBufferHeap.cpp (removed)
@@ -1,94 +0,0 @@
-//===-- DataBufferHeap.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/DataBufferHeap.h"
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-
-using namespace lldb_private;
-
-//----------------------------------------------------------------------
-// Default constructor
-//----------------------------------------------------------------------
-DataBufferHeap::DataBufferHeap() : m_data() {}
-
-//----------------------------------------------------------------------
-// Initialize this class with "n" characters and fill the buffer
-// with "ch".
-//----------------------------------------------------------------------
-DataBufferHeap::DataBufferHeap(lldb::offset_t n, uint8_t ch) : m_data() {
-  if (n < m_data.max_size())
-    m_data.assign(n, ch);
-}
-
-//----------------------------------------------------------------------
-// Initialize this class with a copy of the "n" bytes from the "bytes"
-// buffer.
-//----------------------------------------------------------------------
-DataBufferHeap::DataBufferHeap(const void *src, lldb::offset_t src_len)
-    : m_data() {
-  CopyData(src, src_len);
-}
-
-//----------------------------------------------------------------------
-// Virtual destructor since this class inherits from a pure virtual
-// base class.
-//----------------------------------------------------------------------
-DataBufferHeap::~DataBufferHeap() = default;
-
-//----------------------------------------------------------------------
-// Return a pointer to the bytes owned by this object, or nullptr if
-// the object contains no bytes.
-//----------------------------------------------------------------------
-uint8_t *DataBufferHeap::GetBytes() {
-  return (m_data.empty() ? nullptr : m_data.data());
-}
-
-//----------------------------------------------------------------------
-// Return a const pointer to the bytes owned by this object, or nullptr
-// if the object contains no bytes.
-//----------------------------------------------------------------------
-const uint8_t *DataBufferHeap::GetBytes() const {
-  return (m_data.empty() ? nullptr : m_data.data());
-}
-
-//----------------------------------------------------------------------
-// Return the number of bytes this object currently contains.
-//----------------------------------------------------------------------
-uint64_t DataBufferHeap::GetByteSize() const { return m_data.size(); }
-
-//----------------------------------------------------------------------
-// Sets the number of bytes that this object should be able to
-// contain. This can be used prior to copying data into the buffer.
-//----------------------------------------------------------------------
-uint64_t DataBufferHeap::SetByteSize(uint64_t new_size) {
-  m_data.resize(new_size);
-  return m_data.size();
-}
-
-void DataBufferHeap::CopyData(const void *src, uint64_t src_len) {
-  const uint8_t *src_u8 = (const uint8_t *)src;
-  if (src && src_len > 0)
-    m_data.assign(src_u8, src_u8 + src_len);
-  else
-    m_data.clear();
-}
-
-void DataBufferHeap::AppendData(const void *src, uint64_t src_len) {
-  m_data.insert(m_data.end(), (const uint8_t *)src,
-                (const uint8_t *)src + src_len);
-}
-
-void DataBufferHeap::Clear() {
-  buffer_t empty;
-  m_data.swap(empty);
-}

Removed: lldb/trunk/source/Core/DataBufferLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferLLVM.cpp?rev=296942&view=auto
==============================================================================
--- lldb/trunk/source/Core/DataBufferLLVM.cpp (original)
+++ lldb/trunk/source/Core/DataBufferLLVM.cpp (removed)
@@ -1,58 +0,0 @@
-//===--- DataBufferLLVM.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/DataBufferLLVM.h"
-
-#include "lldb/Host/FileSpec.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/MemoryBuffer.h"
-
-using namespace lldb_private;
-
-DataBufferLLVM::DataBufferLLVM(std::unique_ptr<llvm::MemoryBuffer> MemBuffer)
-    : Buffer(std::move(MemBuffer)) {
-  assert(Buffer != nullptr &&
-         "Cannot construct a DataBufferLLVM with a null buffer");
-}
-
-DataBufferLLVM::~DataBufferLLVM() {}
-
-std::shared_ptr<DataBufferLLVM>
-DataBufferLLVM::CreateFromPath(llvm::StringRef Path, uint64_t Size,
-                               uint64_t Offset) {
-  // If the file resides non-locally, pass the volatile flag so that we don't
-  // mmap it.
-  bool Volatile = !llvm::sys::fs::is_local(Path);
-
-  auto Buffer = llvm::MemoryBuffer::getFileSlice(Path, Size, Offset, Volatile);
-  if (!Buffer)
-    return nullptr;
-  return std::shared_ptr<DataBufferLLVM>(
-      new DataBufferLLVM(std::move(*Buffer)));
-}
-
-std::shared_ptr<DataBufferLLVM>
-DataBufferLLVM::CreateFromFileSpec(const FileSpec &F, uint64_t Size,
-                                   uint64_t Offset) {
-  return CreateFromPath(F.GetPath(), Size, Offset);
-}
-
-uint8_t *DataBufferLLVM::GetBytes() {
-  return const_cast<uint8_t *>(GetBuffer());
-}
-
-const uint8_t *DataBufferLLVM::GetBytes() const { return GetBuffer(); }
-
-lldb::offset_t DataBufferLLVM::GetByteSize() const {
-  return Buffer->getBufferSize();
-}
-
-const uint8_t *DataBufferLLVM::GetBuffer() const {
-  return reinterpret_cast<const uint8_t *>(Buffer->getBufferStart());
-}

Removed: lldb/trunk/source/Core/DataEncoder.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataEncoder.cpp?rev=296942&view=auto
==============================================================================
--- lldb/trunk/source/Core/DataEncoder.cpp (original)
+++ lldb/trunk/source/Core/DataEncoder.cpp (removed)
@@ -1,286 +0,0 @@
-//===-- DataEncoder.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/DataEncoder.h"
-
-// C Includes
-// C++ Includes
-#include <cassert>
-#include <cstddef>
-
-// Other libraries and framework includes
-#include "llvm/Support/MathExtras.h"
-
-// Project includes
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Utility/Endian.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-static inline void WriteInt16(unsigned char *ptr, unsigned offset,
-                              uint16_t value) {
-  *(uint16_t *)(ptr + offset) = value;
-}
-
-static inline void WriteInt32(unsigned char *ptr, unsigned offset,
-                              uint32_t value) {
-  *(uint32_t *)(ptr + offset) = value;
-}
-
-static inline void WriteInt64(unsigned char *ptr, unsigned offset,
-                              uint64_t value) {
-  *(uint64_t *)(ptr + offset) = value;
-}
-
-static inline void WriteSwappedInt16(unsigned char *ptr, unsigned offset,
-                                     uint16_t value) {
-  *(uint16_t *)(ptr + offset) = llvm::ByteSwap_16(value);
-}
-
-static inline void WriteSwappedInt32(unsigned char *ptr, unsigned offset,
-                                     uint32_t value) {
-  *(uint32_t *)(ptr + offset) = llvm::ByteSwap_32(value);
-}
-
-static inline void WriteSwappedInt64(unsigned char *ptr, unsigned offset,
-                                     uint64_t value) {
-  *(uint64_t *)(ptr + offset) = llvm::ByteSwap_64(value);
-}
-
-//----------------------------------------------------------------------
-// Default constructor.
-//----------------------------------------------------------------------
-DataEncoder::DataEncoder()
-    : m_start(nullptr), m_end(nullptr),
-      m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
-      m_data_sp() {}
-
-//----------------------------------------------------------------------
-// This constructor allows us to use data that is owned by someone else.
-// The data must stay around as long as this object is valid.
-//----------------------------------------------------------------------
-DataEncoder::DataEncoder(void *data, uint32_t length, ByteOrder endian,
-                         uint8_t addr_size)
-    : m_start((uint8_t *)data), m_end((uint8_t *)data + length),
-      m_byte_order(endian), m_addr_size(addr_size), m_data_sp() {}
-
-//----------------------------------------------------------------------
-// Make a shared pointer reference to the shared data in "data_sp" and
-// set the endian swapping setting to "swap", and the address size to
-// "addr_size". The shared data reference will ensure the data lives
-// as long as any DataEncoder objects exist that have a reference to
-// this data.
-//----------------------------------------------------------------------
-DataEncoder::DataEncoder(const DataBufferSP &data_sp, ByteOrder endian,
-                         uint8_t addr_size)
-    : m_start(nullptr), m_end(nullptr), m_byte_order(endian),
-      m_addr_size(addr_size), m_data_sp() {
-  SetData(data_sp);
-}
-
-DataEncoder::~DataEncoder() = default;
-
-//------------------------------------------------------------------
-// Clears the object contents back to a default invalid state, and
-// release any references to shared data that this object may
-// contain.
-//------------------------------------------------------------------
-void DataEncoder::Clear() {
-  m_start = nullptr;
-  m_end = nullptr;
-  m_byte_order = endian::InlHostByteOrder();
-  m_addr_size = sizeof(void *);
-  m_data_sp.reset();
-}
-
-//------------------------------------------------------------------
-// If this object contains shared data, this function returns the
-// offset into that shared data. Else zero is returned.
-//------------------------------------------------------------------
-size_t DataEncoder::GetSharedDataOffset() const {
-  if (m_start != nullptr) {
-    const DataBuffer *data = m_data_sp.get();
-    if (data != nullptr) {
-      const uint8_t *data_bytes = data->GetBytes();
-      if (data_bytes != nullptr) {
-        assert(m_start >= data_bytes);
-        return m_start - data_bytes;
-      }
-    }
-  }
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Set the data with which this object will extract from to data
-// starting at BYTES and set the length of the data to LENGTH bytes
-// long. The data is externally owned must be around at least as
-// long as this object points to the data. No copy of the data is
-// made, this object just refers to this data and can extract from
-// it. If this object refers to any shared data upon entry, the
-// reference to that data will be released. Is SWAP is set to true,
-// any data extracted will be endian swapped.
-//----------------------------------------------------------------------
-uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) {
-  m_byte_order = endian;
-  m_data_sp.reset();
-  if (bytes == nullptr || length == 0) {
-    m_start = nullptr;
-    m_end = nullptr;
-  } else {
-    m_start = (uint8_t *)bytes;
-    m_end = m_start + length;
-  }
-  return GetByteSize();
-}
-
-//----------------------------------------------------------------------
-// Assign the data for this object to be a subrange of the shared
-// data in "data_sp" starting "data_offset" bytes into "data_sp"
-// and ending "data_length" bytes later. If "data_offset" is not
-// a valid offset into "data_sp", then this object will contain no
-// bytes. If "data_offset" is within "data_sp" yet "data_length" is
-// too large, the length will be capped at the number of bytes
-// remaining in "data_sp". A ref counted pointer to the data in
-// "data_sp" will be made in this object IF the number of bytes this
-// object refers to in greater than zero (if at least one byte was
-// available starting at "data_offset") to ensure the data stays
-// around as long as it is needed. The address size and endian swap
-// settings will remain unchanged from their current settings.
-//----------------------------------------------------------------------
-uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset,
-                              uint32_t data_length) {
-  m_start = m_end = nullptr;
-
-  if (data_length > 0) {
-    m_data_sp = data_sp;
-    if (data_sp) {
-      const size_t data_size = data_sp->GetByteSize();
-      if (data_offset < data_size) {
-        m_start = data_sp->GetBytes() + data_offset;
-        const size_t bytes_left = data_size - data_offset;
-        // Cap the length of we asked for too many
-        if (data_length <= bytes_left)
-          m_end = m_start + data_length; // We got all the bytes we wanted
-        else
-          m_end = m_start + bytes_left; // Not all the bytes requested were
-                                        // available in the shared data
-      }
-    }
-  }
-
-  uint32_t new_size = GetByteSize();
-
-  // Don't hold a shared pointer to the data buffer if we don't share
-  // any valid bytes in the shared buffer.
-  if (new_size == 0)
-    m_data_sp.reset();
-
-  return new_size;
-}
-
-//----------------------------------------------------------------------
-// Extract a single unsigned char from the binary data and update
-// the offset pointed to by "offset_ptr".
-//
-// RETURNS the byte that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint32_t DataEncoder::PutU8(uint32_t offset, uint8_t value) {
-  if (ValidOffset(offset)) {
-    m_start[offset] = value;
-    return offset + 1;
-  }
-  return UINT32_MAX;
-}
-
-uint32_t DataEncoder::PutU16(uint32_t offset, uint16_t value) {
-  if (ValidOffsetForDataOfSize(offset, sizeof(value))) {
-    if (m_byte_order != endian::InlHostByteOrder())
-      WriteSwappedInt16(m_start, offset, value);
-    else
-      WriteInt16(m_start, offset, value);
-
-    return offset + sizeof(value);
-  }
-  return UINT32_MAX;
-}
-
-uint32_t DataEncoder::PutU32(uint32_t offset, uint32_t value) {
-  if (ValidOffsetForDataOfSize(offset, sizeof(value))) {
-    if (m_byte_order != endian::InlHostByteOrder())
-      WriteSwappedInt32(m_start, offset, value);
-    else
-      WriteInt32(m_start, offset, value);
-
-    return offset + sizeof(value);
-  }
-  return UINT32_MAX;
-}
-
-uint32_t DataEncoder::PutU64(uint32_t offset, uint64_t value) {
-  if (ValidOffsetForDataOfSize(offset, sizeof(value))) {
-    if (m_byte_order != endian::InlHostByteOrder())
-      WriteSwappedInt64(m_start, offset, value);
-    else
-      WriteInt64(m_start, offset, value);
-
-    return offset + sizeof(value);
-  }
-  return UINT32_MAX;
-}
-
-//----------------------------------------------------------------------
-// Extract a single integer value from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted integer
-// is specified by the "byte_size" argument. "byte_size" should have
-// a value >= 1 and <= 8 since the return value is only 64 bits
-// wide. Any "byte_size" values less than 1 or greater than 8 will
-// result in nothing being extracted, and zero being returned.
-//
-// RETURNS the integer value that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint32_t DataEncoder::PutMaxU64(uint32_t offset, uint32_t byte_size,
-                                uint64_t value) {
-  switch (byte_size) {
-  case 1:
-    return PutU8(offset, value);
-  case 2:
-    return PutU16(offset, value);
-  case 4:
-    return PutU32(offset, value);
-  case 8:
-    return PutU64(offset, value);
-  default:
-    llvm_unreachable("GetMax64 unhandled case!");
-  }
-  return UINT32_MAX;
-}
-
-uint32_t DataEncoder::PutData(uint32_t offset, const void *src,
-                              uint32_t src_len) {
-  if (src == nullptr || src_len == 0)
-    return offset;
-
-  if (ValidOffsetForDataOfSize(offset, src_len)) {
-    memcpy(m_start + offset, src, src_len);
-    return offset + src_len;
-  }
-  return UINT32_MAX;
-}
-
-uint32_t DataEncoder::PutAddress(uint32_t offset, lldb::addr_t addr) {
-  return PutMaxU64(offset, GetAddressByteSize(), addr);
-}
-
-uint32_t DataEncoder::PutCString(uint32_t offset, const char *cstr) {
-  if (cstr != nullptr)
-    return PutData(offset, cstr, strlen(cstr) + 1);
-  return UINT32_MAX;
-}

Removed: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=296942&view=auto
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp (removed)
@@ -1,1239 +0,0 @@
-//===-- DataExtractor.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
-// C++ Includes
-#include <cassert>
-#include <cmath>
-#include <cstddef>
-#include <string>
-
-// Other libraries and framework includes
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/MD5.h"
-#include "llvm/Support/MathExtras.h"
-
-// Project includes
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
-#include "lldb/Utility/UUID.h"
-#include "lldb/Utility/Endian.h"
-#include "lldb/Utility/Log.h"
-#include "lldb/Utility/Stream.h"
-#include "lldb/Utility/StreamString.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-static inline uint16_t ReadInt16(const unsigned char *ptr, offset_t offset) {
-  uint16_t value;
-  memcpy(&value, ptr + offset, 2);
-  return value;
-}
-
-static inline uint32_t ReadInt32(const unsigned char *ptr,
-                                 offset_t offset = 0) {
-  uint32_t value;
-  memcpy(&value, ptr + offset, 4);
-  return value;
-}
-
-static inline uint64_t ReadInt64(const unsigned char *ptr,
-                                 offset_t offset = 0) {
-  uint64_t value;
-  memcpy(&value, ptr + offset, 8);
-  return value;
-}
-
-static inline uint16_t ReadInt16(const void *ptr) {
-  uint16_t value;
-  memcpy(&value, ptr, 2);
-  return value;
-}
-
-static inline uint16_t ReadSwapInt16(const unsigned char *ptr,
-                                     offset_t offset) {
-  uint16_t value;
-  memcpy(&value, ptr + offset, 2);
-  return llvm::ByteSwap_16(value);
-}
-
-static inline uint32_t ReadSwapInt32(const unsigned char *ptr,
-                                     offset_t offset) {
-  uint32_t value;
-  memcpy(&value, ptr + offset, 4);
-  return llvm::ByteSwap_32(value);
-}
-
-static inline uint64_t ReadSwapInt64(const unsigned char *ptr,
-                                     offset_t offset) {
-  uint64_t value;
-  memcpy(&value, ptr + offset, 8);
-  return llvm::ByteSwap_64(value);
-}
-
-static inline uint16_t ReadSwapInt16(const void *ptr) {
-  uint16_t value;
-  memcpy(&value, ptr, 2);
-  return llvm::ByteSwap_16(value);
-}
-
-static inline uint32_t ReadSwapInt32(const void *ptr) {
-  uint32_t value;
-  memcpy(&value, ptr, 4);
-  return llvm::ByteSwap_32(value);
-}
-
-static inline uint64_t ReadSwapInt64(const void *ptr) {
-  uint64_t value;
-  memcpy(&value, ptr, 8);
-  return llvm::ByteSwap_64(value);
-}
-
-DataExtractor::DataExtractor()
-    : m_start(nullptr), m_end(nullptr),
-      m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
-      m_data_sp(), m_target_byte_size(1) {}
-
-//----------------------------------------------------------------------
-// This constructor allows us to use data that is owned by someone else.
-// The data must stay around as long as this object is valid.
-//----------------------------------------------------------------------
-DataExtractor::DataExtractor(const void *data, offset_t length,
-                             ByteOrder endian, uint32_t addr_size,
-                             uint32_t target_byte_size /*=1*/)
-    : m_start(const_cast<uint8_t *>(reinterpret_cast<const uint8_t *>(data))),
-      m_end(const_cast<uint8_t *>(reinterpret_cast<const uint8_t *>(data)) +
-            length),
-      m_byte_order(endian), m_addr_size(addr_size), m_data_sp(),
-      m_target_byte_size(target_byte_size) {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(addr_size == 4 || addr_size == 8);
-#endif
-}
-
-//----------------------------------------------------------------------
-// Make a shared pointer reference to the shared data in "data_sp" and
-// set the endian swapping setting to "swap", and the address size to
-// "addr_size". The shared data reference will ensure the data lives
-// as long as any DataExtractor objects exist that have a reference to
-// this data.
-//----------------------------------------------------------------------
-DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
-                             uint32_t addr_size,
-                             uint32_t target_byte_size /*=1*/)
-    : m_start(nullptr), m_end(nullptr), m_byte_order(endian),
-      m_addr_size(addr_size), m_data_sp(),
-      m_target_byte_size(target_byte_size) {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(addr_size == 4 || addr_size == 8);
-#endif
-  SetData(data_sp);
-}
-
-//----------------------------------------------------------------------
-// Initialize this object with a subset of the data bytes in "data".
-// If "data" contains shared data, then a reference to this shared
-// data will added and the shared data will stay around as long
-// as any object contains a reference to that data. The endian
-// swap and address size settings are copied from "data".
-//----------------------------------------------------------------------
-DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset,
-                             offset_t length, uint32_t target_byte_size /*=1*/)
-    : m_start(nullptr), m_end(nullptr), m_byte_order(data.m_byte_order),
-      m_addr_size(data.m_addr_size), m_data_sp(),
-      m_target_byte_size(target_byte_size) {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(m_addr_size == 4 || m_addr_size == 8);
-#endif
-  if (data.ValidOffset(offset)) {
-    offset_t bytes_available = data.GetByteSize() - offset;
-    if (length > bytes_available)
-      length = bytes_available;
-    SetData(data, offset, length);
-  }
-}
-
-DataExtractor::DataExtractor(const DataExtractor &rhs)
-    : m_start(rhs.m_start), m_end(rhs.m_end), m_byte_order(rhs.m_byte_order),
-      m_addr_size(rhs.m_addr_size), m_data_sp(rhs.m_data_sp),
-      m_target_byte_size(rhs.m_target_byte_size) {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(m_addr_size == 4 || m_addr_size == 8);
-#endif
-}
-
-//----------------------------------------------------------------------
-// Assignment operator
-//----------------------------------------------------------------------
-const DataExtractor &DataExtractor::operator=(const DataExtractor &rhs) {
-  if (this != &rhs) {
-    m_start = rhs.m_start;
-    m_end = rhs.m_end;
-    m_byte_order = rhs.m_byte_order;
-    m_addr_size = rhs.m_addr_size;
-    m_data_sp = rhs.m_data_sp;
-  }
-  return *this;
-}
-
-DataExtractor::~DataExtractor() = default;
-
-//------------------------------------------------------------------
-// Clears the object contents back to a default invalid state, and
-// release any references to shared data that this object may
-// contain.
-//------------------------------------------------------------------
-void DataExtractor::Clear() {
-  m_start = nullptr;
-  m_end = nullptr;
-  m_byte_order = endian::InlHostByteOrder();
-  m_addr_size = sizeof(void *);
-  m_data_sp.reset();
-}
-
-//------------------------------------------------------------------
-// If this object contains shared data, this function returns the
-// offset into that shared data. Else zero is returned.
-//------------------------------------------------------------------
-size_t DataExtractor::GetSharedDataOffset() const {
-  if (m_start != nullptr) {
-    const DataBuffer *data = m_data_sp.get();
-    if (data != nullptr) {
-      const uint8_t *data_bytes = data->GetBytes();
-      if (data_bytes != nullptr) {
-        assert(m_start >= data_bytes);
-        return m_start - data_bytes;
-      }
-    }
-  }
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Set the data with which this object will extract from to data
-// starting at BYTES and set the length of the data to LENGTH bytes
-// long. The data is externally owned must be around at least as
-// long as this object points to the data. No copy of the data is
-// made, this object just refers to this data and can extract from
-// it. If this object refers to any shared data upon entry, the
-// reference to that data will be released. Is SWAP is set to true,
-// any data extracted will be endian swapped.
-//----------------------------------------------------------------------
-lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length,
-                                      ByteOrder endian) {
-  m_byte_order = endian;
-  m_data_sp.reset();
-  if (bytes == nullptr || length == 0) {
-    m_start = nullptr;
-    m_end = nullptr;
-  } else {
-    m_start = const_cast<uint8_t *>(reinterpret_cast<const uint8_t *>(bytes));
-    m_end = m_start + length;
-  }
-  return GetByteSize();
-}
-
-//----------------------------------------------------------------------
-// Assign the data for this object to be a subrange in "data"
-// starting "data_offset" bytes into "data" and ending "data_length"
-// bytes later. If "data_offset" is not a valid offset into "data",
-// then this object will contain no bytes. If "data_offset" is
-// within "data" yet "data_length" is too large, the length will be
-// capped at the number of bytes remaining in "data". If "data"
-// contains a shared pointer to other data, then a ref counted
-// pointer to that data will be made in this object. If "data"
-// doesn't contain a shared pointer to data, then the bytes referred
-// to in "data" will need to exist at least as long as this object
-// refers to those bytes. The address size and endian swap settings
-// are copied from the current values in "data".
-//----------------------------------------------------------------------
-lldb::offset_t DataExtractor::SetData(const DataExtractor &data,
-                                      offset_t data_offset,
-                                      offset_t data_length) {
-  m_addr_size = data.m_addr_size;
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(m_addr_size == 4 || m_addr_size == 8);
-#endif
-  // If "data" contains shared pointer to data, then we can use that
-  if (data.m_data_sp) {
-    m_byte_order = data.m_byte_order;
-    return SetData(data.m_data_sp, data.GetSharedDataOffset() + data_offset,
-                   data_length);
-  }
-
-  // We have a DataExtractor object that just has a pointer to bytes
-  if (data.ValidOffset(data_offset)) {
-    if (data_length > data.GetByteSize() - data_offset)
-      data_length = data.GetByteSize() - data_offset;
-    return SetData(data.GetDataStart() + data_offset, data_length,
-                   data.GetByteOrder());
-  }
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Assign the data for this object to be a subrange of the shared
-// data in "data_sp" starting "data_offset" bytes into "data_sp"
-// and ending "data_length" bytes later. If "data_offset" is not
-// a valid offset into "data_sp", then this object will contain no
-// bytes. If "data_offset" is within "data_sp" yet "data_length" is
-// too large, the length will be capped at the number of bytes
-// remaining in "data_sp". A ref counted pointer to the data in
-// "data_sp" will be made in this object IF the number of bytes this
-// object refers to in greater than zero (if at least one byte was
-// available starting at "data_offset") to ensure the data stays
-// around as long as it is needed. The address size and endian swap
-// settings will remain unchanged from their current settings.
-//----------------------------------------------------------------------
-lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp,
-                                      offset_t data_offset,
-                                      offset_t data_length) {
-  m_start = m_end = nullptr;
-
-  if (data_length > 0) {
-    m_data_sp = data_sp;
-    if (data_sp) {
-      const size_t data_size = data_sp->GetByteSize();
-      if (data_offset < data_size) {
-        m_start = data_sp->GetBytes() + data_offset;
-        const size_t bytes_left = data_size - data_offset;
-        // Cap the length of we asked for too many
-        if (data_length <= bytes_left)
-          m_end = m_start + data_length; // We got all the bytes we wanted
-        else
-          m_end = m_start + bytes_left; // Not all the bytes requested were
-                                        // available in the shared data
-      }
-    }
-  }
-
-  size_t new_size = GetByteSize();
-
-  // Don't hold a shared pointer to the data buffer if we don't share
-  // any valid bytes in the shared buffer.
-  if (new_size == 0)
-    m_data_sp.reset();
-
-  return new_size;
-}
-
-//----------------------------------------------------------------------
-// Extract a single unsigned char from the binary data and update
-// the offset pointed to by "offset_ptr".
-//
-// RETURNS the byte that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint8_t DataExtractor::GetU8(offset_t *offset_ptr) const {
-  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, 1);
-  if (data)
-    return *data;
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Extract "count" unsigned chars from the binary data and update the
-// offset pointed to by "offset_ptr". The extracted data is copied into
-// "dst".
-//
-// RETURNS the non-nullptr buffer pointer upon successful extraction of
-// all the requested bytes, or nullptr when the data is not available in
-// the buffer due to being out of bounds, or insufficient data.
-//----------------------------------------------------------------------
-void *DataExtractor::GetU8(offset_t *offset_ptr, void *dst,
-                           uint32_t count) const {
-  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, count);
-  if (data) {
-    // Copy the data into the buffer
-    memcpy(dst, data, count);
-    // Return a non-nullptr pointer to the converted data as an indicator of
-    // success
-    return dst;
-  }
-  return nullptr;
-}
-
-//----------------------------------------------------------------------
-// Extract a single uint16_t from the data and update the offset
-// pointed to by "offset_ptr".
-//
-// RETURNS the uint16_t that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint16_t DataExtractor::GetU16(offset_t *offset_ptr) const {
-  uint16_t val = 0;
-  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val));
-  if (data) {
-    if (m_byte_order != endian::InlHostByteOrder())
-      val = ReadSwapInt16(data);
-    else
-      val = ReadInt16(data);
-  }
-  return val;
-}
-
-uint16_t DataExtractor::GetU16_unchecked(offset_t *offset_ptr) const {
-  uint16_t val;
-  if (m_byte_order == endian::InlHostByteOrder())
-    val = ReadInt16(m_start, *offset_ptr);
-  else
-    val = ReadSwapInt16(m_start, *offset_ptr);
-  *offset_ptr += sizeof(val);
-  return val;
-}
-
-uint32_t DataExtractor::GetU32_unchecked(offset_t *offset_ptr) const {
-  uint32_t val;
-  if (m_byte_order == endian::InlHostByteOrder())
-    val = ReadInt32(m_start, *offset_ptr);
-  else
-    val = ReadSwapInt32(m_start, *offset_ptr);
-  *offset_ptr += sizeof(val);
-  return val;
-}
-
-uint64_t DataExtractor::GetU64_unchecked(offset_t *offset_ptr) const {
-  uint64_t val;
-  if (m_byte_order == endian::InlHostByteOrder())
-    val = ReadInt64(m_start, *offset_ptr);
-  else
-    val = ReadSwapInt64(m_start, *offset_ptr);
-  *offset_ptr += sizeof(val);
-  return val;
-}
-
-//----------------------------------------------------------------------
-// Extract "count" uint16_t values from the binary data and update
-// the offset pointed to by "offset_ptr". The extracted data is
-// copied into "dst".
-//
-// RETURNS the non-nullptr buffer pointer upon successful extraction of
-// all the requested bytes, or nullptr when the data is not available
-// in the buffer due to being out of bounds, or insufficient data.
-//----------------------------------------------------------------------
-void *DataExtractor::GetU16(offset_t *offset_ptr, void *void_dst,
-                            uint32_t count) const {
-  const size_t src_size = sizeof(uint16_t) * count;
-  const uint16_t *src = (const uint16_t *)GetData(offset_ptr, src_size);
-  if (src) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      uint16_t *dst_pos = (uint16_t *)void_dst;
-      uint16_t *dst_end = dst_pos + count;
-      const uint16_t *src_pos = src;
-      while (dst_pos < dst_end) {
-        *dst_pos = ReadSwapInt16(src_pos);
-        ++dst_pos;
-        ++src_pos;
-      }
-    } else {
-      memcpy(void_dst, src, src_size);
-    }
-    // Return a non-nullptr pointer to the converted data as an indicator of
-    // success
-    return void_dst;
-  }
-  return nullptr;
-}
-
-//----------------------------------------------------------------------
-// Extract a single uint32_t from the data and update the offset
-// pointed to by "offset_ptr".
-//
-// RETURNS the uint32_t that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint32_t DataExtractor::GetU32(offset_t *offset_ptr) const {
-  uint32_t val = 0;
-  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val));
-  if (data) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      val = ReadSwapInt32(data);
-    } else {
-      memcpy(&val, data, 4);
-    }
-  }
-  return val;
-}
-
-//----------------------------------------------------------------------
-// Extract "count" uint32_t values from the binary data and update
-// the offset pointed to by "offset_ptr". The extracted data is
-// copied into "dst".
-//
-// RETURNS the non-nullptr buffer pointer upon successful extraction of
-// all the requested bytes, or nullptr when the data is not available
-// in the buffer due to being out of bounds, or insufficient data.
-//----------------------------------------------------------------------
-void *DataExtractor::GetU32(offset_t *offset_ptr, void *void_dst,
-                            uint32_t count) const {
-  const size_t src_size = sizeof(uint32_t) * count;
-  const uint32_t *src = (const uint32_t *)GetData(offset_ptr, src_size);
-  if (src) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      uint32_t *dst_pos = (uint32_t *)void_dst;
-      uint32_t *dst_end = dst_pos + count;
-      const uint32_t *src_pos = src;
-      while (dst_pos < dst_end) {
-        *dst_pos = ReadSwapInt32(src_pos);
-        ++dst_pos;
-        ++src_pos;
-      }
-    } else {
-      memcpy(void_dst, src, src_size);
-    }
-    // Return a non-nullptr pointer to the converted data as an indicator of
-    // success
-    return void_dst;
-  }
-  return nullptr;
-}
-
-//----------------------------------------------------------------------
-// Extract a single uint64_t from the data and update the offset
-// pointed to by "offset_ptr".
-//
-// RETURNS the uint64_t that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint64_t DataExtractor::GetU64(offset_t *offset_ptr) const {
-  uint64_t val = 0;
-  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val));
-  if (data) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      val = ReadSwapInt64(data);
-    } else {
-      memcpy(&val, data, 8);
-    }
-  }
-  return val;
-}
-
-//----------------------------------------------------------------------
-// GetU64
-//
-// Get multiple consecutive 64 bit values. Return true if the entire
-// read succeeds and increment the offset pointed to by offset_ptr, else
-// return false and leave the offset pointed to by offset_ptr unchanged.
-//----------------------------------------------------------------------
-void *DataExtractor::GetU64(offset_t *offset_ptr, void *void_dst,
-                            uint32_t count) const {
-  const size_t src_size = sizeof(uint64_t) * count;
-  const uint64_t *src = (const uint64_t *)GetData(offset_ptr, src_size);
-  if (src) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      uint64_t *dst_pos = (uint64_t *)void_dst;
-      uint64_t *dst_end = dst_pos + count;
-      const uint64_t *src_pos = src;
-      while (dst_pos < dst_end) {
-        *dst_pos = ReadSwapInt64(src_pos);
-        ++dst_pos;
-        ++src_pos;
-      }
-    } else {
-      memcpy(void_dst, src, src_size);
-    }
-    // Return a non-nullptr pointer to the converted data as an indicator of
-    // success
-    return void_dst;
-  }
-  return nullptr;
-}
-
-//----------------------------------------------------------------------
-// Extract a single integer value from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted integer
-// is specified by the "byte_size" argument. "byte_size" should have
-// a value between 1 and 4 since the return value is only 32 bits
-// wide. Any "byte_size" values less than 1 or greater than 4 will
-// result in nothing being extracted, and zero being returned.
-//
-// RETURNS the integer value that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint32_t DataExtractor::GetMaxU32(offset_t *offset_ptr,
-                                  size_t byte_size) const {
-  switch (byte_size) {
-  case 1:
-    return GetU8(offset_ptr);
-    break;
-  case 2:
-    return GetU16(offset_ptr);
-    break;
-  case 4:
-    return GetU32(offset_ptr);
-    break;
-  default:
-    assert(false && "GetMaxU32 unhandled case!");
-    break;
-  }
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Extract a single integer value from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted integer
-// is specified by the "byte_size" argument. "byte_size" should have
-// a value >= 1 and <= 8 since the return value is only 64 bits
-// wide. Any "byte_size" values less than 1 or greater than 8 will
-// result in nothing being extracted, and zero being returned.
-//
-// RETURNS the integer value that was extracted, or zero on failure.
-//----------------------------------------------------------------------
-uint64_t DataExtractor::GetMaxU64(offset_t *offset_ptr, size_t size) const {
-  switch (size) {
-  case 1:
-    return GetU8(offset_ptr);
-    break;
-  case 2:
-    return GetU16(offset_ptr);
-    break;
-  case 4:
-    return GetU32(offset_ptr);
-    break;
-  case 8:
-    return GetU64(offset_ptr);
-    break;
-  default:
-    assert(false && "GetMax64 unhandled case!");
-    break;
-  }
-  return 0;
-}
-
-uint64_t DataExtractor::GetMaxU64_unchecked(offset_t *offset_ptr,
-                                            size_t size) const {
-  switch (size) {
-  case 1:
-    return GetU8_unchecked(offset_ptr);
-    break;
-  case 2:
-    return GetU16_unchecked(offset_ptr);
-    break;
-  case 4:
-    return GetU32_unchecked(offset_ptr);
-    break;
-  case 8:
-    return GetU64_unchecked(offset_ptr);
-    break;
-  default:
-    assert(false && "GetMax64 unhandled case!");
-    break;
-  }
-  return 0;
-}
-
-int64_t DataExtractor::GetMaxS64(offset_t *offset_ptr, size_t size) const {
-  switch (size) {
-  case 1:
-    return (int8_t)GetU8(offset_ptr);
-    break;
-  case 2:
-    return (int16_t)GetU16(offset_ptr);
-    break;
-  case 4:
-    return (int32_t)GetU32(offset_ptr);
-    break;
-  case 8:
-    return (int64_t)GetU64(offset_ptr);
-    break;
-  default:
-    assert(false && "GetMax64 unhandled case!");
-    break;
-  }
-  return 0;
-}
-
-uint64_t DataExtractor::GetMaxU64Bitfield(offset_t *offset_ptr, size_t size,
-                                          uint32_t bitfield_bit_size,
-                                          uint32_t bitfield_bit_offset) const {
-  uint64_t uval64 = GetMaxU64(offset_ptr, size);
-  if (bitfield_bit_size > 0) {
-    int32_t lsbcount = bitfield_bit_offset;
-    if (m_byte_order == eByteOrderBig)
-      lsbcount = size * 8 - bitfield_bit_offset - bitfield_bit_size;
-    if (lsbcount > 0)
-      uval64 >>= lsbcount;
-    uint64_t bitfield_mask = ((1ul << bitfield_bit_size) - 1);
-    if (!bitfield_mask && bitfield_bit_offset == 0 && bitfield_bit_size == 64)
-      return uval64;
-    uval64 &= bitfield_mask;
-  }
-  return uval64;
-}
-
-int64_t DataExtractor::GetMaxS64Bitfield(offset_t *offset_ptr, size_t size,
-                                         uint32_t bitfield_bit_size,
-                                         uint32_t bitfield_bit_offset) const {
-  int64_t sval64 = GetMaxS64(offset_ptr, size);
-  if (bitfield_bit_size > 0) {
-    int32_t lsbcount = bitfield_bit_offset;
-    if (m_byte_order == eByteOrderBig)
-      lsbcount = size * 8 - bitfield_bit_offset - bitfield_bit_size;
-    if (lsbcount > 0)
-      sval64 >>= lsbcount;
-    uint64_t bitfield_mask = (((uint64_t)1) << bitfield_bit_size) - 1;
-    sval64 &= bitfield_mask;
-    // sign extend if needed
-    if (sval64 & (((uint64_t)1) << (bitfield_bit_size - 1)))
-      sval64 |= ~bitfield_mask;
-  }
-  return sval64;
-}
-
-float DataExtractor::GetFloat(offset_t *offset_ptr) const {
-  typedef float float_type;
-  float_type val = 0.0;
-  const size_t src_size = sizeof(float_type);
-  const float_type *src = (const float_type *)GetData(offset_ptr, src_size);
-  if (src) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      const uint8_t *src_data = (const uint8_t *)src;
-      uint8_t *dst_data = (uint8_t *)&val;
-      for (size_t i = 0; i < sizeof(float_type); ++i)
-        dst_data[sizeof(float_type) - 1 - i] = src_data[i];
-    } else {
-      val = *src;
-    }
-  }
-  return val;
-}
-
-double DataExtractor::GetDouble(offset_t *offset_ptr) const {
-  typedef double float_type;
-  float_type val = 0.0;
-  const size_t src_size = sizeof(float_type);
-  const float_type *src = (const float_type *)GetData(offset_ptr, src_size);
-  if (src) {
-    if (m_byte_order != endian::InlHostByteOrder()) {
-      const uint8_t *src_data = (const uint8_t *)src;
-      uint8_t *dst_data = (uint8_t *)&val;
-      for (size_t i = 0; i < sizeof(float_type); ++i)
-        dst_data[sizeof(float_type) - 1 - i] = src_data[i];
-    } else {
-      val = *src;
-    }
-  }
-  return val;
-}
-
-long double DataExtractor::GetLongDouble(offset_t *offset_ptr) const {
-  long double val = 0.0;
-#if defined(__i386__) || defined(__amd64__) || defined(__x86_64__) ||          \
-    defined(_M_IX86) || defined(_M_IA64) || defined(_M_X64)
-  *offset_ptr += CopyByteOrderedData(*offset_ptr, 10, &val, sizeof(val),
-                                     endian::InlHostByteOrder());
-#else
-  *offset_ptr += CopyByteOrderedData(*offset_ptr, sizeof(val), &val,
-                                     sizeof(val), endian::InlHostByteOrder());
-#endif
-  return val;
-}
-
-//------------------------------------------------------------------
-// Extract a single address from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted address
-// comes from the "this->m_addr_size" member variable and should be
-// set correctly prior to extracting any address values.
-//
-// RETURNS the address that was extracted, or zero on failure.
-//------------------------------------------------------------------
-uint64_t DataExtractor::GetAddress(offset_t *offset_ptr) const {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(m_addr_size == 4 || m_addr_size == 8);
-#endif
-  return GetMaxU64(offset_ptr, m_addr_size);
-}
-
-uint64_t DataExtractor::GetAddress_unchecked(offset_t *offset_ptr) const {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(m_addr_size == 4 || m_addr_size == 8);
-#endif
-  return GetMaxU64_unchecked(offset_ptr, m_addr_size);
-}
-
-//------------------------------------------------------------------
-// Extract a single pointer from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted pointer
-// comes from the "this->m_addr_size" member variable and should be
-// set correctly prior to extracting any pointer values.
-//
-// RETURNS the pointer that was extracted, or zero on failure.
-//------------------------------------------------------------------
-uint64_t DataExtractor::GetPointer(offset_t *offset_ptr) const {
-#ifdef LLDB_CONFIGURATION_DEBUG
-  assert(m_addr_size == 4 || m_addr_size == 8);
-#endif
-  return GetMaxU64(offset_ptr, m_addr_size);
-}
-
-
-size_t DataExtractor::ExtractBytes(offset_t offset, offset_t length,
-                                   ByteOrder dst_byte_order, void *dst) const {
-  const uint8_t *src = PeekData(offset, length);
-  if (src) {
-    if (dst_byte_order != GetByteOrder()) {
-      // Validate that only a word- or register-sized dst is byte swapped
-      assert(length == 1 || length == 2 || length == 4 || length == 8 ||
-             length == 10 || length == 16 || length == 32);
-
-      for (uint32_t i = 0; i < length; ++i)
-        ((uint8_t *)dst)[i] = src[length - i - 1];
-    } else
-      ::memcpy(dst, src, length);
-    return length;
-  }
-  return 0;
-}
-
-// Extract data as it exists in target memory
-lldb::offset_t DataExtractor::CopyData(offset_t offset, offset_t length,
-                                       void *dst) const {
-  const uint8_t *src = PeekData(offset, length);
-  if (src) {
-    ::memcpy(dst, src, length);
-    return length;
-  }
-  return 0;
-}
-
-// Extract data and swap if needed when doing the copy
-lldb::offset_t
-DataExtractor::CopyByteOrderedData(offset_t src_offset, offset_t src_len,
-                                   void *dst_void_ptr, offset_t dst_len,
-                                   ByteOrder dst_byte_order) const {
-  // Validate the source info
-  if (!ValidOffsetForDataOfSize(src_offset, src_len))
-    assert(ValidOffsetForDataOfSize(src_offset, src_len));
-  assert(src_len > 0);
-  assert(m_byte_order == eByteOrderBig || m_byte_order == eByteOrderLittle);
-
-  // Validate the destination info
-  assert(dst_void_ptr != nullptr);
-  assert(dst_len > 0);
-  assert(dst_byte_order == eByteOrderBig || dst_byte_order == eByteOrderLittle);
-
-  // Validate that only a word- or register-sized dst is byte swapped
-  assert(dst_byte_order == m_byte_order || dst_len == 1 || dst_len == 2 ||
-         dst_len == 4 || dst_len == 8 || dst_len == 10 || dst_len == 16 ||
-         dst_len == 32);
-
-  // Must have valid byte orders set in this object and for destination
-  if (!(dst_byte_order == eByteOrderBig ||
-        dst_byte_order == eByteOrderLittle) ||
-      !(m_byte_order == eByteOrderBig || m_byte_order == eByteOrderLittle))
-    return 0;
-
-  uint8_t *dst = (uint8_t *)dst_void_ptr;
-  const uint8_t *src = (const uint8_t *)PeekData(src_offset, src_len);
-  if (src) {
-    if (dst_len >= src_len) {
-      // We are copying the entire value from src into dst.
-      // Calculate how many, if any, zeroes we need for the most
-      // significant bytes if "dst_len" is greater than "src_len"...
-      const size_t num_zeroes = dst_len - src_len;
-      if (dst_byte_order == eByteOrderBig) {
-        // Big endian, so we lead with zeroes...
-        if (num_zeroes > 0)
-          ::memset(dst, 0, num_zeroes);
-        // Then either copy or swap the rest
-        if (m_byte_order == eByteOrderBig) {
-          ::memcpy(dst + num_zeroes, src, src_len);
-        } else {
-          for (uint32_t i = 0; i < src_len; ++i)
-            dst[i + num_zeroes] = src[src_len - 1 - i];
-        }
-      } else {
-        // Little endian destination, so we lead the value bytes
-        if (m_byte_order == eByteOrderBig) {
-          for (uint32_t i = 0; i < src_len; ++i)
-            dst[i] = src[src_len - 1 - i];
-        } else {
-          ::memcpy(dst, src, src_len);
-        }
-        // And zero the rest...
-        if (num_zeroes > 0)
-          ::memset(dst + src_len, 0, num_zeroes);
-      }
-      return src_len;
-    } else {
-      // We are only copying some of the value from src into dst..
-
-      if (dst_byte_order == eByteOrderBig) {
-        // Big endian dst
-        if (m_byte_order == eByteOrderBig) {
-          // Big endian dst, with big endian src
-          ::memcpy(dst, src + (src_len - dst_len), dst_len);
-        } else {
-          // Big endian dst, with little endian src
-          for (uint32_t i = 0; i < dst_len; ++i)
-            dst[i] = src[dst_len - 1 - i];
-        }
-      } else {
-        // Little endian dst
-        if (m_byte_order == eByteOrderBig) {
-          // Little endian dst, with big endian src
-          for (uint32_t i = 0; i < dst_len; ++i)
-            dst[i] = src[src_len - 1 - i];
-        } else {
-          // Little endian dst, with big endian src
-          ::memcpy(dst, src, dst_len);
-        }
-      }
-      return dst_len;
-    }
-  }
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Extracts a variable length NULL terminated C string from
-// the data at the offset pointed to by "offset_ptr".  The
-// "offset_ptr" will be updated with the offset of the byte that
-// follows the NULL terminator byte.
-//
-// If the offset pointed to by "offset_ptr" is out of bounds, or if
-// "length" is non-zero and there aren't enough available
-// bytes, nullptr will be returned and "offset_ptr" will not be
-// updated.
-//----------------------------------------------------------------------
-const char *DataExtractor::GetCStr(offset_t *offset_ptr) const {
-  const char *cstr = (const char *)PeekData(*offset_ptr, 1);
-  if (cstr) {
-    const char *cstr_end = cstr;
-    const char *end = (const char *)m_end;
-    while (cstr_end < end && *cstr_end)
-      ++cstr_end;
-
-    // Now we are either at the end of the data or we point to the
-    // NULL C string terminator with cstr_end...
-    if (*cstr_end == '\0') {
-      // Advance the offset with one extra byte for the NULL terminator
-      *offset_ptr += (cstr_end - cstr + 1);
-      return cstr;
-    }
-
-    // We reached the end of the data without finding a NULL C string
-    // terminator. Fall through and return nullptr otherwise anyone that
-    // would have used the result as a C string can wander into
-    // unknown memory...
-  }
-  return nullptr;
-}
-
-//----------------------------------------------------------------------
-// Extracts a NULL terminated C string from the fixed length field of
-// length "len" at the offset pointed to by "offset_ptr".
-// The "offset_ptr" will be updated with the offset of the byte that
-// follows the fixed length field.
-//
-// If the offset pointed to by "offset_ptr" is out of bounds, or if
-// the offset plus the length of the field is out of bounds, or if the
-// field does not contain a NULL terminator byte, nullptr will be returned
-// and "offset_ptr" will not be updated.
-//----------------------------------------------------------------------
-const char *DataExtractor::GetCStr(offset_t *offset_ptr, offset_t len) const {
-  const char *cstr = (const char *)PeekData(*offset_ptr, len);
-  if (cstr != nullptr) {
-    if (memchr(cstr, '\0', len) == nullptr) {
-      return nullptr;
-    }
-    *offset_ptr += len;
-    return cstr;
-  }
-  return nullptr;
-}
-
-//------------------------------------------------------------------
-// Peeks at a string in the contained data. No verification is done
-// to make sure the entire string lies within the bounds of this
-// object's data, only "offset" is verified to be a valid offset.
-//
-// Returns a valid C string pointer if "offset" is a valid offset in
-// this object's data, else nullptr is returned.
-//------------------------------------------------------------------
-const char *DataExtractor::PeekCStr(offset_t offset) const {
-  return (const char *)PeekData(offset, 1);
-}
-
-//----------------------------------------------------------------------
-// Extracts an unsigned LEB128 number from this object's data
-// starting at the offset pointed to by "offset_ptr". The offset
-// pointed to by "offset_ptr" will be updated with the offset of the
-// byte following the last extracted byte.
-//
-// Returned the extracted integer value.
-//----------------------------------------------------------------------
-uint64_t DataExtractor::GetULEB128(offset_t *offset_ptr) const {
-  const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1);
-  if (src == nullptr)
-    return 0;
-
-  const uint8_t *end = m_end;
-
-  if (src < end) {
-    uint64_t result = *src++;
-    if (result >= 0x80) {
-      result &= 0x7f;
-      int shift = 7;
-      while (src < end) {
-        uint8_t byte = *src++;
-        result |= (uint64_t)(byte & 0x7f) << shift;
-        if ((byte & 0x80) == 0)
-          break;
-        shift += 7;
-      }
-    }
-    *offset_ptr = src - m_start;
-    return result;
-  }
-
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Extracts an signed LEB128 number from this object's data
-// starting at the offset pointed to by "offset_ptr". The offset
-// pointed to by "offset_ptr" will be updated with the offset of the
-// byte following the last extracted byte.
-//
-// Returned the extracted integer value.
-//----------------------------------------------------------------------
-int64_t DataExtractor::GetSLEB128(offset_t *offset_ptr) const {
-  const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1);
-  if (src == nullptr)
-    return 0;
-
-  const uint8_t *end = m_end;
-
-  if (src < end) {
-    int64_t result = 0;
-    int shift = 0;
-    int size = sizeof(int64_t) * 8;
-
-    uint8_t byte = 0;
-    int bytecount = 0;
-
-    while (src < end) {
-      bytecount++;
-      byte = *src++;
-      result |= (int64_t)(byte & 0x7f) << shift;
-      shift += 7;
-      if ((byte & 0x80) == 0)
-        break;
-    }
-
-    // Sign bit of byte is 2nd high order bit (0x40)
-    if (shift < size && (byte & 0x40))
-      result |= -(1 << shift);
-
-    *offset_ptr += bytecount;
-    return result;
-  }
-  return 0;
-}
-
-//----------------------------------------------------------------------
-// Skips a ULEB128 number (signed or unsigned) from this object's
-// data starting at the offset pointed to by "offset_ptr". The
-// offset pointed to by "offset_ptr" will be updated with the offset
-// of the byte following the last extracted byte.
-//
-// Returns the number of bytes consumed during the extraction.
-//----------------------------------------------------------------------
-uint32_t DataExtractor::Skip_LEB128(offset_t *offset_ptr) const {
-  uint32_t bytes_consumed = 0;
-  const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1);
-  if (src == nullptr)
-    return 0;
-
-  const uint8_t *end = m_end;
-
-  if (src < end) {
-    const uint8_t *src_pos = src;
-    while ((src_pos < end) && (*src_pos++ & 0x80))
-      ++bytes_consumed;
-    *offset_ptr += src_pos - src;
-  }
-  return bytes_consumed;
-}
-
-//----------------------------------------------------------------------
-// Dumps bytes from this object's data to the stream "s" starting
-// "start_offset" bytes into this data, and ending with the byte
-// before "end_offset". "base_addr" will be added to the offset
-// into the dumped data when showing the offset into the data in the
-// output information. "num_per_line" objects of type "type" will
-// be dumped with the option to override the format for each object
-// with "type_format". "type_format" is a printf style formatting
-// string. If "type_format" is nullptr, then an appropriate format
-// string will be used for the supplied "type". If the stream "s"
-// is nullptr, then the output will be send to Log().
-//----------------------------------------------------------------------
-lldb::offset_t DataExtractor::PutToLog(Log *log, offset_t start_offset,
-                                       offset_t length, uint64_t base_addr,
-                                       uint32_t num_per_line,
-                                       DataExtractor::Type type,
-                                       const char *format) const {
-  if (log == nullptr)
-    return start_offset;
-
-  offset_t offset;
-  offset_t end_offset;
-  uint32_t count;
-  StreamString sstr;
-  for (offset = start_offset, end_offset = offset + length, count = 0;
-       ValidOffset(offset) && offset < end_offset; ++count) {
-    if ((count % num_per_line) == 0) {
-      // Print out any previous string
-      if (sstr.GetSize() > 0) {
-        log->PutString(sstr.GetString());
-        sstr.Clear();
-      }
-      // Reset string offset and fill the current line string with address:
-      if (base_addr != LLDB_INVALID_ADDRESS)
-        sstr.Printf("0x%8.8" PRIx64 ":",
-                    (uint64_t)(base_addr + (offset - start_offset)));
-    }
-
-    switch (type) {
-    case TypeUInt8:
-      sstr.Printf(format ? format : " %2.2x", GetU8(&offset));
-      break;
-    case TypeChar: {
-      char ch = GetU8(&offset);
-      sstr.Printf(format ? format : " %c", isprint(ch) ? ch : ' ');
-    } break;
-    case TypeUInt16:
-      sstr.Printf(format ? format : " %4.4x", GetU16(&offset));
-      break;
-    case TypeUInt32:
-      sstr.Printf(format ? format : " %8.8x", GetU32(&offset));
-      break;
-    case TypeUInt64:
-      sstr.Printf(format ? format : " %16.16" PRIx64, GetU64(&offset));
-      break;
-    case TypePointer:
-      sstr.Printf(format ? format : " 0x%" PRIx64, GetAddress(&offset));
-      break;
-    case TypeULEB128:
-      sstr.Printf(format ? format : " 0x%" PRIx64, GetULEB128(&offset));
-      break;
-    case TypeSLEB128:
-      sstr.Printf(format ? format : " %" PRId64, GetSLEB128(&offset));
-      break;
-    }
-  }
-
-  if (!sstr.Empty())
-    log->PutString(sstr.GetString());
-
-  return offset; // Return the offset at which we ended up
-}
-
-//----------------------------------------------------------------------
-// DumpUUID
-//
-// Dump out a UUID starting at 'offset' bytes into the buffer
-//----------------------------------------------------------------------
-void DataExtractor::DumpUUID(Stream *s, offset_t offset) const {
-  if (s) {
-    const uint8_t *uuid_data = PeekData(offset, 16);
-    if (uuid_data) {
-      lldb_private::UUID uuid(uuid_data, 16);
-      uuid.Dump(s);
-    } else {
-      s->Printf("<not enough data for UUID at offset 0x%8.8" PRIx64 ">",
-                offset);
-    }
-  }
-}
-
-size_t DataExtractor::Copy(DataExtractor &dest_data) const {
-  if (m_data_sp) {
-    // we can pass along the SP to the data
-    dest_data.SetData(m_data_sp);
-  } else {
-    const uint8_t *base_ptr = m_start;
-    size_t data_size = GetByteSize();
-    dest_data.SetData(DataBufferSP(new DataBufferHeap(base_ptr, data_size)));
-  }
-  return GetByteSize();
-}
-
-bool DataExtractor::Append(DataExtractor &rhs) {
-  if (rhs.GetByteOrder() != GetByteOrder())
-    return false;
-
-  if (rhs.GetByteSize() == 0)
-    return true;
-
-  if (GetByteSize() == 0)
-    return (rhs.Copy(*this) > 0);
-
-  size_t bytes = GetByteSize() + rhs.GetByteSize();
-
-  DataBufferHeap *buffer_heap_ptr = nullptr;
-  DataBufferSP buffer_sp(buffer_heap_ptr = new DataBufferHeap(bytes, 0));
-
-  if (!buffer_sp || buffer_heap_ptr == nullptr)
-    return false;
-
-  uint8_t *bytes_ptr = buffer_heap_ptr->GetBytes();
-
-  memcpy(bytes_ptr, GetDataStart(), GetByteSize());
-  memcpy(bytes_ptr + GetByteSize(), rhs.GetDataStart(), rhs.GetByteSize());
-
-  SetData(buffer_sp);
-
-  return true;
-}
-
-bool DataExtractor::Append(void *buf, offset_t length) {
-  if (buf == nullptr)
-    return false;
-
-  if (length == 0)
-    return true;
-
-  size_t bytes = GetByteSize() + length;
-
-  DataBufferHeap *buffer_heap_ptr = nullptr;
-  DataBufferSP buffer_sp(buffer_heap_ptr = new DataBufferHeap(bytes, 0));
-
-  if (!buffer_sp || buffer_heap_ptr == nullptr)
-    return false;
-
-  uint8_t *bytes_ptr = buffer_heap_ptr->GetBytes();
-
-  if (GetByteSize() > 0)
-    memcpy(bytes_ptr, GetDataStart(), GetByteSize());
-
-  memcpy(bytes_ptr + GetByteSize(), buf, length);
-
-  SetData(buffer_sp);
-
-  return true;
-}
-
-void DataExtractor::Checksum(llvm::SmallVectorImpl<uint8_t> &dest,
-                             uint64_t max_data) {
-  if (max_data == 0)
-    max_data = GetByteSize();
-  else
-    max_data = std::min(max_data, GetByteSize());
-
-  llvm::MD5 md5;
-
-  const llvm::ArrayRef<uint8_t> data(GetDataStart(), max_data);
-  md5.update(data);
-
-  llvm::MD5::MD5Result result;
-  md5.final(result);
-
-  dest.resize(16);
-  std::copy(result, result + 16, dest.begin());
-}

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Fri Mar  3 19:30:05 2017
@@ -16,8 +16,6 @@
 
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/Module.h"
@@ -37,6 +35,8 @@
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/lldb-private.h"

Modified: lldb/trunk/source/Core/DumpDataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DumpDataExtractor.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/DumpDataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DumpDataExtractor.cpp Fri Mar  3 19:30:05 2017
@@ -9,13 +9,13 @@
 
 #include "lldb/Core/DumpDataExtractor.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/ExecutionContextScope.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 
 #include <bitset>

Modified: lldb/trunk/source/Core/EmulateInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/EmulateInstruction.cpp (original)
+++ lldb/trunk/source/Core/EmulateInstruction.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Core/Address.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/StreamFile.h"
@@ -25,6 +24,7 @@
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Core/Event.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Event.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/Event.cpp (original)
+++ lldb/trunk/source/Core/Event.cpp Fri Mar  3 19:30:05 2017
@@ -14,11 +14,11 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Core/Broadcaster.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/Event.h"
 #include "lldb/Core/State.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Fri Mar  3 19:30:05 2017
@@ -19,8 +19,6 @@
 #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
 #include "Plugins/Language/ObjC/ObjCLanguage.h"
 #include "lldb/Core/AddressResolverFileLine.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
@@ -42,6 +40,8 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/RegularExpression.h"

Modified: lldb/trunk/source/Core/Opcode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Opcode.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/Opcode.cpp (original)
+++ lldb/trunk/source/Core/Opcode.cpp Fri Mar  3 19:30:05 2017
@@ -16,8 +16,8 @@
 
 // Project includes
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Stream.h"
 

Modified: lldb/trunk/source/Core/RegisterValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegisterValue.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/RegisterValue.cpp (original)
+++ lldb/trunk/source/Core/RegisterValue.cpp Fri Mar  3 19:30:05 2017
@@ -18,11 +18,11 @@
 #include "llvm/ADT/StringRef.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Core/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Fri Mar  3 19:30:05 2017
@@ -19,9 +19,9 @@
 #include "llvm/ADT/SmallString.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Core/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SourceManager.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/SourceManager.cpp (original)
+++ lldb/trunk/source/Core/SourceManager.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Host/FileSystem.h"
@@ -22,6 +21,7 @@
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/AnsiTerminal.h"
+#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/Utility/Stream.h"
 

Modified: lldb/trunk/source/Core/StructuredData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StructuredData.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/StructuredData.cpp (original)
+++ lldb/trunk/source/Core/StructuredData.cpp Fri Mar  3 19:30:05 2017
@@ -13,10 +13,10 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include "lldb/Core/DataBuffer.h"
 #include "lldb/Host/File.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/StringConvert.h"
+#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/JSON.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Fri Mar  3 19:30:05 2017
@@ -13,8 +13,6 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/State.h"
 #include "lldb/Symbol/ClangASTContext.h"
@@ -27,6 +25,8 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Fri Mar  3 19:30:05 2017
@@ -17,7 +17,6 @@
 #include "llvm/Support/raw_ostream.h"
 
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ValueObjectCast.h"
@@ -27,6 +26,7 @@
 #include "lldb/Core/ValueObjectList.h"
 #include "lldb/Core/ValueObjectMemory.h"
 #include "lldb/Core/ValueObjectSyntheticFilter.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Core/ValueObjectConstResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResult.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectConstResult.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResult.cpp Fri Mar  3 19:30:05 2017
@@ -9,12 +9,12 @@
 
 #include "lldb/Core/ValueObjectConstResult.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ValueObjectChild.h"
 #include "lldb/Core/ValueObjectConstResultChild.h"
 #include "lldb/Core/ValueObjectDynamicValue.h"
 #include "lldb/Core/ValueObjectList.h"
+#include "lldb/Utility/DataExtractor.h"
 
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Symbol/ObjectFile.h"

Modified: lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp Fri Mar  3 19:30:05 2017
@@ -10,7 +10,6 @@
 
 #include "lldb/Core/ValueObjectConstResultImpl.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ValueObjectChild.h"
 #include "lldb/Core/ValueObjectConstResult.h"
@@ -18,6 +17,7 @@
 #include "lldb/Core/ValueObjectConstResultChild.h"
 #include "lldb/Core/ValueObjectList.h"
 #include "lldb/Core/ValueObjectMemory.h"
+#include "lldb/Utility/DataExtractor.h"
 
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Symbol/ObjectFile.h"

Modified: lldb/trunk/source/DataFormatters/TypeFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeFormat.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/TypeFormat.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeFormat.cpp Fri Mar  3 19:30:05 2017
@@ -19,7 +19,6 @@
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-public.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/DataFormatters/FormatManager.h"
 #include "lldb/Symbol/CompilerType.h"
@@ -27,6 +26,7 @@
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Fri Mar  3 19:30:05 2017
@@ -15,12 +15,12 @@
 // C++ Includes
 #include <vector>
 
-#include "lldb/Core/DataEncoder.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/VMRange.h"
 #include "lldb/Core/Value.h"
 #include "lldb/Core/dwarf.h"
+#include "lldb/Utility/DataEncoder.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Expression/FunctionCaller.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/FunctionCaller.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Expression/FunctionCaller.cpp (original)
+++ lldb/trunk/source/Expression/FunctionCaller.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 
 // Project includes
 #include "lldb/Expression/FunctionCaller.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/State.h"
 #include "lldb/Core/ValueObject.h"
@@ -30,6 +29,7 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlan.h"
 #include "lldb/Target/ThreadPlanCallFunction.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 
 using namespace lldb_private;

Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Fri Mar  3 19:30:05 2017
@@ -15,8 +15,6 @@
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Module.h"
@@ -29,6 +27,8 @@
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Fri Mar  3 19:30:05 2017
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Expression/IRInterpreter.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/Scalar.h"
@@ -17,6 +16,7 @@
 #include "lldb/Expression/IRExecutionUnit.h"
 #include "lldb/Expression/IRMemoryMap.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"

Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/trunk/source/Expression/IRMemoryMap.cpp Fri Mar  3 19:30:05 2017
@@ -8,12 +8,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Expression/IRMemoryMap.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"

Modified: lldb/trunk/source/Host/common/File.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/File.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/File.cpp (original)
+++ lldb/trunk/source/Host/common/File.cpp Fri Mar  3 19:30:05 2017
@@ -25,10 +25,10 @@
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Process.h" // for llvm::sys::Process::FileDescriptorHasColors()
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Host/Config.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/FileSystem.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri Mar  3 19:30:05 2017
@@ -26,12 +26,12 @@
 #endif
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.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/DataBufferHeap.h"
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Fri Mar  3 19:30:05 2017
@@ -9,17 +9,17 @@
 
 #include "lldb/Host/Symbols.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/Timer.h"
-#include "lldb/Utility/UUID.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/SafeMachO.h"
 #include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/UUID.h"
 
 #include "llvm/Support/FileSystem.h"
 

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Fri Mar  3 19:30:05 2017
@@ -26,21 +26,21 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Utility/CleanUp.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/NameMatches.h"
 
 #include "llvm/Support/Host.h"

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Fri Mar  3 19:30:05 2017
@@ -25,10 +25,10 @@
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 
 #include "Plugins/Process/Linux/ProcFileReader.h"
 #include "lldb/Core/ModuleSpec.h"

Modified: lldb/trunk/source/Host/linux/HostThreadLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostThreadLinux.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/HostThreadLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/HostThreadLinux.cpp Fri Mar  3 19:30:05 2017
@@ -9,7 +9,7 @@
 
 #include "lldb/Host/linux/HostThreadLinux.h"
 #include "Plugins/Process/Linux/ProcFileReader.h"
-#include "lldb/Core/DataBuffer.h"
+#include "lldb/Utility/DataBuffer.h"
 
 #include "llvm/ADT/SmallVector.h"
 

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Fri Mar  3 19:30:05 2017
@@ -56,8 +56,6 @@
 
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/Communication.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/StreamFile.h"
@@ -70,6 +68,8 @@
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/CleanUp.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/NameMatches.h"

Modified: lldb/trunk/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Symbols.cpp (original)
+++ lldb/trunk/source/Host/macosx/Symbols.cpp Fri Mar  3 19:30:05 2017
@@ -24,18 +24,18 @@
 #include "Host/macosx/cfcpp/CFCReleaser.h"
 #include "Host/macosx/cfcpp/CFCString.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/Timer.h"
-#include "lldb/Utility/UUID.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Utility/CleanUp.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/UUID.h"
 #include "mach/machine.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Host/netbsd/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/Host.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/netbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/netbsd/Host.cpp Fri Mar  3 19:30:05 2017
@@ -27,21 +27,21 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Utility/CleanUp.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/NameMatches.h"
 
 #include "llvm/Support/Host.h"

Modified: lldb/trunk/source/Host/windows/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Host.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Host/windows/Host.cpp (original)
+++ lldb/trunk/source/Host/windows/Host.cpp Fri Mar  3 19:30:05 2017
@@ -19,12 +19,12 @@
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/StructuredData.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 
 #include "llvm/Support/ConvertUTF.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/IR/DerivedTypes.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "llvm/ADT/Triple.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegisterValue.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Fri Mar  3 19:30:05 2017
@@ -31,7 +31,6 @@
 #include "DisassemblerLLVMC.h"
 
 #include "lldb/Core/Address.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Target/ExecutionContext.h"
@@ -40,6 +39,7 @@
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"
 

Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Fri Mar  3 19:30:05 2017
@@ -12,8 +12,6 @@
 
 #include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -30,6 +28,8 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlanRunToAddress.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 
 #include "DynamicLoaderDarwinKernel.h"

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp Fri Mar  3 19:30:05 2017
@@ -10,8 +10,6 @@
 #include "DynamicLoaderDarwin.h"
 
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -31,6 +29,8 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlanCallFunction.h"
 #include "lldb/Target/ThreadPlanRunToAddress.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 
 //#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Fri Mar  3 19:30:05 2017
@@ -8,8 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -26,6 +24,8 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlanRunToAddress.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 
 #include "DynamicLoaderDarwin.h"

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp Fri Mar  3 19:30:05 2017
@@ -14,9 +14,9 @@
 
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 
 #if defined(__linux__) || defined(__FreeBSD__)

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp Fri Mar  3 19:30:05 2017
@@ -67,7 +67,6 @@
 #include "IRForTarget.h"
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Module.h"
@@ -86,6 +85,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/ThreadPlanCallFunction.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp Fri Mar  3 19:30:05 2017
@@ -9,12 +9,12 @@
 
 #include "ClangExpressionVariable.h"
 
-#include "lldb/Core/DataExtractor.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/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 #include "clang/AST/ASTContext.h"
 

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp Fri Mar  3 19:30:05 2017
@@ -26,7 +26,6 @@
 #include "llvm/IR/Module.h"
 
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/State.h"
 #include "lldb/Core/ValueObject.h"
@@ -43,6 +42,7 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlan.h"
 #include "lldb/Target/ThreadPlanCallFunction.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 
 using namespace lldb_private;

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp Fri Mar  3 19:30:05 2017
@@ -9,8 +9,8 @@
 
 #include "ClangPersistentVariables.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Value.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Fri Mar  3 19:30:05 2017
@@ -25,7 +25,6 @@
 
 #include "clang/AST/ASTContext.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/dwarf.h"
 #include "lldb/Expression/IRExecutionUnit.h"
@@ -34,6 +33,7 @@
 #include "lldb/Symbol/ClangUtil.h"
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp Fri Mar  3 19:30:05 2017
@@ -26,9 +26,6 @@
 // Project includes
 #include "GoUserExpression.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataEncoder.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/ValueObjectConstResult.h"
@@ -47,6 +44,9 @@
 #include "lldb/Target/ThreadPlan.h"
 #include "lldb/Target/ThreadPlanCallUserExpression.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataEncoder.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/lldb-private.h"

Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Fri Mar  3 19:30:05 2017
@@ -14,12 +14,12 @@
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Opcode.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Symbol/UnwindPlan.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 #include "llvm-c/Disassembler.h"
 #include "llvm/MC/MCAsmInfo.h"

Modified: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Fri Mar  3 19:30:05 2017
@@ -14,12 +14,12 @@
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Opcode.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Host/PosixApi.h"
 #include "lldb/Symbol/UnwindPlan.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 #include "llvm-c/Disassembler.h"
 #include "llvm/MC/MCAsmInfo.h"

Modified: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp (original)
+++ lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Fri Mar  3 19:30:05 2017
@@ -12,7 +12,6 @@
 #include "llvm/Support/MathExtras.h"
 
 #include "lldb/Breakpoint/Breakpoint.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
@@ -23,6 +22,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp Fri Mar  3 19:30:05 2017
@@ -11,7 +11,6 @@
 
 #include "llvm/Support/ConvertUTF.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -23,6 +22,7 @@
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/FormatEntity.h"
 #include "lldb/Core/ValueObject.h"
@@ -25,6 +24,7 @@
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp Fri Mar  3 19:30:05 2017
@@ -13,12 +13,12 @@
 // Project includes
 #include "LibCxx.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp Fri Mar  3 19:30:05 2017
@@ -13,12 +13,12 @@
 // Project includes
 #include "LibCxx.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp Fri Mar  3 19:30:05 2017
@@ -13,12 +13,12 @@
 // Project includes
 #include "LibCxx.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp Fri Mar  3 19:30:05 2017
@@ -13,13 +13,13 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/StringPrinter.h"
 #include "lldb/DataFormatters/VectorIterator.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CF.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/CF.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/CF.cpp Fri Mar  3 19:30:05 2017
@@ -10,7 +10,6 @@
 
 #include "CF.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -19,6 +18,7 @@
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 // Project includes
 #include "Cocoa.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Mangled.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
@@ -27,6 +26,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp Fri Mar  3 19:30:05 2017
@@ -16,7 +16,6 @@
 #include "Cocoa.h"
 
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -25,6 +24,7 @@
 #include "lldb/Target/Language.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp Fri Mar  3 19:30:05 2017
@@ -17,7 +17,6 @@
 // Project includes
 #include "NSDictionary.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -26,6 +25,7 @@
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp Fri Mar  3 19:30:05 2017
@@ -15,7 +15,6 @@
 // Project includes
 #include "Cocoa.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -23,6 +22,7 @@
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp Fri Mar  3 19:30:05 2017
@@ -15,7 +15,6 @@
 // Project includes
 #include "Cocoa.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -23,6 +22,7 @@
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 // Project includes
 #include "NSSet.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -21,6 +20,7 @@
 #include "lldb/Target/Language.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp Fri Mar  3 19:30:05 2017
@@ -10,7 +10,6 @@
 
 #include "NSString.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
@@ -19,6 +18,7 @@
 #include "lldb/Target/Language.h"
 #include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Stream.h"

Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp Fri Mar  3 19:30:05 2017
@@ -28,13 +28,13 @@ typedef struct ar_hdr {
 #endif
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferLLVM.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/Timer.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/Stream.h"
 
 #include "llvm/Support/MemoryBuffer.h"
@@ -314,7 +314,7 @@ ObjectContainer *ObjectContainerBSDArchi
       // file gets updated by a new build while this .a file is being used for
       // debugging
       DataBufferSP archive_data_sp =
-          DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+          DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
       if (!archive_data_sp)
         return nullptr;
 
@@ -468,7 +468,8 @@ size_t ObjectContainerBSDArchive::GetMod
   bool set_archive_arch = false;
   if (!archive_sp) {
     set_archive_arch = true;
-    data_sp = DataBufferLLVM::CreateFromFileSpec(file, file_size, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file.GetPath(), file_size, file_offset);
     if (data_sp) {
       data.SetData(data_sp, 0, data_sp->GetByteSize());
       archive_sp = Archive::ParseAndCacheArchiveForFile(

Modified: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp Fri Mar  3 19:30:05 2017
@@ -9,12 +9,12 @@
 
 #include "ObjectContainerUniversalMachO.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/Stream.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp Fri Mar  3 19:30:05 2017
@@ -9,8 +9,8 @@
 
 #include <cstring>
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Section.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 
 #include "ELFHeader.h"

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Fri Mar  3 19:30:05 2017
@@ -14,7 +14,6 @@
 #include <unordered_map>
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferLLVM.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -25,6 +24,7 @@
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"
@@ -387,7 +387,8 @@ ObjectFile *ObjectFileELF::CreateInstanc
                                           lldb::offset_t file_offset,
                                           lldb::offset_t length) {
   if (!data_sp) {
-    data_sp = DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
     if (!data_sp)
       return nullptr;
     data_offset = 0;
@@ -404,7 +405,8 @@ ObjectFile *ObjectFileELF::CreateInstanc
 
   // Update the data to contain the entire file if it doesn't already
   if (data_sp->GetByteSize() < length) {
-    data_sp = DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
     if (!data_sp)
       return nullptr;
     data_offset = 0;
@@ -663,8 +665,8 @@ size_t ObjectFileELF::GetModuleSpecifica
           size_t section_header_end = header.e_shoff + header.e_shentsize;
           if (header.HasHeaderExtension() &&
             section_header_end > data_sp->GetByteSize()) {
-            data_sp = DataBufferLLVM::CreateFromFileSpec(
-                file, section_header_end, file_offset);
+            data_sp = DataBufferLLVM::CreateFromPath(
+                file.GetPath(), section_header_end, file_offset);
             if (data_sp) {
               data.SetData(data_sp);
               lldb::offset_t header_offset = data_offset;
@@ -677,8 +679,8 @@ size_t ObjectFileELF::GetModuleSpecifica
           section_header_end =
               header.e_shoff + header.e_shnum * header.e_shentsize;
           if (section_header_end > data_sp->GetByteSize()) {
-            data_sp = DataBufferLLVM::CreateFromFileSpec(
-                file, section_header_end, file_offset);
+            data_sp = DataBufferLLVM::CreateFromPath(
+                file.GetPath(), section_header_end, file_offset);
             if (data_sp)
               data.SetData(data_sp);
           }
@@ -722,8 +724,8 @@ size_t ObjectFileELF::GetModuleSpecifica
                 size_t program_headers_end =
                     header.e_phoff + header.e_phnum * header.e_phentsize;
                 if (program_headers_end > data_sp->GetByteSize()) {
-                  data_sp = DataBufferLLVM::CreateFromFileSpec(
-                      file, program_headers_end, file_offset);
+                  data_sp = DataBufferLLVM::CreateFromPath(
+                      file.GetPath(), program_headers_end, file_offset);
                   if (data_sp)
                     data.SetData(data_sp);
                 }
@@ -738,8 +740,8 @@ size_t ObjectFileELF::GetModuleSpecifica
                 }
 
                 if (segment_data_end > data_sp->GetByteSize()) {
-                  data_sp = DataBufferLLVM::CreateFromFileSpec(
-                      file, segment_data_end, file_offset);
+                  data_sp = DataBufferLLVM::CreateFromPath(
+                      file.GetPath(), segment_data_end, file_offset);
                   if (data_sp)
                     data.SetData(data_sp);
                 }
@@ -748,8 +750,8 @@ size_t ObjectFileELF::GetModuleSpecifica
                     CalculateELFNotesSegmentsCRC32(program_headers, data);
               } else {
                 // Need to map entire file into memory to calculate the crc.
-                data_sp =
-                    DataBufferLLVM::CreateFromFileSpec(file, -1, file_offset);
+                data_sp = DataBufferLLVM::CreateFromPath(file.GetPath(), -1,
+                                                         file_offset);
                 if (data_sp) {
                   data.SetData(data_sp);
                   gnu_debuglink_crc = calc_gnu_debuglink_crc32(

Modified: lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp Fri Mar  3 19:30:05 2017
@@ -12,8 +12,6 @@
 #include "ObjectFileJIT.h"
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/Module.h"
@@ -23,7 +21,6 @@
 #include "lldb/Core/Section.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/Timer.h"
-#include "lldb/Utility/UUID.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/ObjectFile.h"
@@ -31,8 +28,11 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/UUID.h"
 
 #ifndef __APPLE__
 #include "Utility/UuidCompatibility.h"

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Fri Mar  3 19:30:05 2017
@@ -18,7 +18,6 @@
 #include "Plugins/Process/Utility/RegisterContextDarwin_i386.h"
 #include "Plugins/Process/Utility/RegisterContextDarwin_x86_64.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferLLVM.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/Module.h"
@@ -28,7 +27,6 @@
 #include "lldb/Core/Section.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/Timer.h"
-#include "lldb/Utility/UUID.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/DWARFCallFrameInfo.h"
@@ -41,9 +39,11 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadList.h"
+#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/UUID.h"
 
 #include "lldb/Utility/SafeMachO.h"
 
@@ -859,7 +859,8 @@ ObjectFile *ObjectFileMachO::CreateInsta
                                             lldb::offset_t file_offset,
                                             lldb::offset_t length) {
   if (!data_sp) {
-    data_sp = DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
     if (!data_sp)
       return nullptr;
     data_offset = 0;
@@ -870,7 +871,8 @@ ObjectFile *ObjectFileMachO::CreateInsta
 
   // Update the data to contain the entire file if it doesn't already
   if (data_sp->GetByteSize() < length) {
-    data_sp = DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
     if (!data_sp)
       return nullptr;
     data_offset = 0;
@@ -2093,8 +2095,9 @@ UUID ObjectFileMachO::GetSharedCacheUUID
                                          const ByteOrder byte_order,
                                          const uint32_t addr_byte_size) {
   UUID dsc_uuid;
-  DataBufferSP DscData = DataBufferLLVM::CreateFromFileSpec(
-      dyld_shared_cache, sizeof(struct lldb_copy_dyld_cache_header_v1), 0);
+  DataBufferSP DscData = DataBufferLLVM::CreateFromPath(
+      dyld_shared_cache.GetPath(),
+      sizeof(struct lldb_copy_dyld_cache_header_v1), 0);
   if (!DscData)
     return dsc_uuid;
   DataExtractor dsc_header_data(DscData, byte_order, addr_byte_size);
@@ -2700,8 +2703,9 @@ size_t ObjectFileMachO::ParseSymtab() {
 
       // Process the dyld shared cache header to find the unmapped symbols
 
-      DataBufferSP dsc_data_sp = DataBufferLLVM::CreateFromFileSpec(
-          dsc_filespec, sizeof(struct lldb_copy_dyld_cache_header_v1), 0);
+      DataBufferSP dsc_data_sp = DataBufferLLVM::CreateFromPath(
+          dsc_filespec.GetPath(), sizeof(struct lldb_copy_dyld_cache_header_v1),
+          0);
       if (!dsc_uuid.IsValid()) {
         dsc_uuid = GetSharedCacheUUID(dsc_filespec, byte_order, addr_byte_size);
       }
@@ -2734,8 +2738,8 @@ size_t ObjectFileMachO::ParseSymtab() {
             mappingOffset >= sizeof(struct lldb_copy_dyld_cache_header_v1)) {
 
           DataBufferSP dsc_mapping_info_data_sp =
-              DataBufferLLVM::CreateFromFileSpec(
-                  dsc_filespec,
+              DataBufferLLVM::CreateFromPath(
+                  dsc_filespec.GetPath(),
                   sizeof(struct lldb_copy_dyld_cache_mapping_info),
                   mappingOffset);
 
@@ -2761,8 +2765,9 @@ size_t ObjectFileMachO::ParseSymtab() {
           if (localSymbolsOffset && localSymbolsSize) {
             // Map the local symbols
             DataBufferSP dsc_local_symbols_data_sp =
-                DataBufferLLVM::CreateFromFileSpec(
-                    dsc_filespec, localSymbolsSize, localSymbolsOffset);
+                DataBufferLLVM::CreateFromPath(dsc_filespec.GetPath(),
+                                               localSymbolsSize,
+                                               localSymbolsOffset);
 
             if (dsc_local_symbols_data_sp) {
               DataExtractor dsc_local_symbols_data(dsc_local_symbols_data_sp,

Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Fri Mar  3 19:30:05 2017
@@ -13,8 +13,6 @@
 #include "llvm/Support/COFF.h"
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataBufferLLVM.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -22,13 +20,15 @@
 #include "lldb/Core/Section.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/Timer.h"
-#include "lldb/Utility/UUID.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/UUID.h"
 
 #include "llvm/Support/MemoryBuffer.h"
 
@@ -67,7 +67,8 @@ ObjectFile *ObjectFilePECOFF::CreateInst
                                              lldb::offset_t file_offset,
                                              lldb::offset_t length) {
   if (!data_sp) {
-    data_sp = DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
     if (!data_sp)
       return nullptr;
     data_offset = 0;
@@ -78,7 +79,8 @@ ObjectFile *ObjectFilePECOFF::CreateInst
 
   // Update the data to contain the entire file if it doesn't already
   if (data_sp->GetByteSize() < length) {
-    data_sp = DataBufferLLVM::CreateFromFileSpec(*file, length, file_offset);
+    data_sp =
+        DataBufferLLVM::CreateFromPath(file->GetPath(), length, file_offset);
     if (!data_sp)
       return nullptr;
   }

Modified: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp (original)
+++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp Fri Mar  3 19:30:05 2017
@@ -18,7 +18,6 @@
 #include "Plugins/Process/Utility/DynamicRegisterInfo.h"
 #include "Plugins/Process/Utility/RegisterContextMemory.h"
 #include "Plugins/Process/Utility/ThreadMemory.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
@@ -39,6 +38,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadList.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/StreamString.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp (original)
+++ lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp Fri Mar  3 19:30:05 2017
@@ -18,7 +18,6 @@
 #include "Plugins/Process/Utility/RegisterContextMemory.h"
 #include "Plugins/Process/Utility/ThreadMemory.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
@@ -34,6 +33,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadList.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/StreamString.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Fri Mar  3 19:30:05 2017
@@ -15,14 +15,14 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/FileUtilities.h"
 
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataEncoder.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/PosixApi.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataEncoder.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 
 #include <limits.h>

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Fri Mar  3 19:30:05 2017
@@ -17,7 +17,6 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -29,6 +28,7 @@
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Fri Mar  3 19:30:05 2017
@@ -14,7 +14,6 @@
 // Other libraries and framework includes
 // Project includes
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -31,6 +30,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/ProcessLaunchInfo.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp Fri Mar  3 19:30:05 2017
@@ -7,9 +7,9 @@
 //
 //===---------------------------------------------------------------------===//
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 #include "ProcessFreeBSD.h"
 #include "ProcessMonitor.h"

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp Fri Mar  3 19:30:05 2017
@@ -7,9 +7,9 @@
 //
 //===---------------------------------------------------------------------===//
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 #include "Plugins/Process/Utility/RegisterContextPOSIX_arm64.h"
 #include "ProcessFreeBSD.h"

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp Fri Mar  3 19:30:05 2017
@@ -7,9 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 #include "Plugins/Process/Utility/RegisterContextPOSIX_mips64.h"
 #include "ProcessFreeBSD.h"

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp Fri Mar  3 19:30:05 2017
@@ -7,9 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 #include "ProcessFreeBSD.h"
 #include "ProcessMonitor.h"

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp Fri Mar  3 19:30:05 2017
@@ -7,9 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 #include "Plugins/Process/FreeBSD/ProcessFreeBSD.h"
 #include "Plugins/Process/FreeBSD/ProcessMonitor.h"

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp Fri Mar  3 19:30:05 2017
@@ -11,8 +11,8 @@
 
 #include "NativeRegisterContextLinux_arm.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp Fri Mar  3 19:30:05 2017
@@ -16,9 +16,9 @@
 // C++ Includes
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Host/common/NativeProcessProtocol.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp Fri Mar  3 19:30:05 2017
@@ -20,11 +20,11 @@
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_mips.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_mips64.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp Fri Mar  3 19:30:05 2017
@@ -11,9 +11,9 @@
 
 #include "NativeRegisterContextLinux_s390x.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp Fri Mar  3 19:30:05 2017
@@ -11,9 +11,9 @@
 
 #include "NativeRegisterContextLinux_x86_64.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp Fri Mar  3 19:30:05 2017
@@ -20,7 +20,7 @@
 #include <fstream>
 
 // LLDB Headers
-#include "lldb/Core/DataBufferHeap.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 
 using namespace lldb_private;

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Fri Mar  3 19:30:05 2017
@@ -17,15 +17,15 @@
 // C++ Includes
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/State.h"
-#include "lldb/Utility/UUID.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
+#include "lldb/Utility/UUID.h"
 
 // Project includes
 #include "ProcessKDPLog.h"

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp Fri Mar  3 19:30:05 2017
@@ -13,13 +13,13 @@
 
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/State.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/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 
 #include "Plugins/Process/Utility/StopInfoMachException.h"

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Fri Mar  3 19:30:05 2017
@@ -17,10 +17,10 @@
 
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "llvm/Support/Compiler.h"

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp Fri Mar  3 19:30:05 2017
@@ -19,12 +19,12 @@
 
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "llvm/ADT/STLExtras.h"

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp Fri Mar  3 19:30:05 2017
@@ -12,10 +12,10 @@
 
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "llvm/ADT/STLExtras.h"

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp Fri Mar  3 19:30:05 2017
@@ -14,10 +14,10 @@
 
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Log.h"
 #include "llvm/ADT/STLExtras.h"

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.cpp Fri Mar  3 19:30:05 2017
@@ -10,7 +10,6 @@
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/AddressRange.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Value.h"
@@ -27,6 +26,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.cpp Fri Mar  3 19:30:05 2017
@@ -10,7 +10,6 @@
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/AddressRange.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Value.h"
@@ -27,6 +26,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Fri Mar  3 19:30:05 2017
@@ -9,7 +9,6 @@
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/AddressRange.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Value.h"
@@ -30,6 +29,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp Fri Mar  3 19:30:05 2017
@@ -12,11 +12,11 @@
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 // Project includes
 #include "Utility/StringExtractorGDBRemote.h"

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp Fri Mar  3 19:30:05 2017
@@ -14,10 +14,10 @@
 // Other libraries and framework includes
 // Project includes
 #include "DynamicRegisterInfo.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.h Fri Mar  3 19:30:05 2017
@@ -16,8 +16,8 @@
 
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Target/RegisterContext.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/lldb-private.h"
 
 class DynamicRegisterInfo;

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp Fri Mar  3 19:30:05 2017
@@ -11,12 +11,12 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "llvm/Support/Compiler.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp Fri Mar  3 19:30:05 2017
@@ -11,12 +11,12 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "llvm/Support/Compiler.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp Fri Mar  3 19:30:05 2017
@@ -11,12 +11,12 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "llvm/Support/Compiler.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp Fri Mar  3 19:30:05 2017
@@ -12,12 +12,12 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "llvm/Support/Compiler.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp Fri Mar  3 19:30:05 2017
@@ -11,13 +11,13 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "llvm/Support/Compiler.h"
 

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp Fri Mar  3 19:30:05 2017
@@ -11,13 +11,13 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "llvm/Support/Compiler.h"
 

Modified: lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp Fri Mar  3 19:30:05 2017
@@ -7,9 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Host/windows/HostThreadWindows.h"
 #include "lldb/Host/windows/windows.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/lldb-private-types.h"
 

Modified: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp Fri Mar  3 19:30:05 2017
@@ -14,7 +14,6 @@
 #include <mutex>
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
@@ -24,6 +23,7 @@
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 
 #include "llvm/Support/ELF.h"

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h Fri Mar  3 19:30:05 2017
@@ -15,8 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "Plugins/Process/Utility/RegisterContextPOSIX_arm.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 
 class RegisterContextCorePOSIX_arm : public RegisterContextPOSIX_arm {
 public:

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h Fri Mar  3 19:30:05 2017
@@ -15,8 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "Plugins/Process/Utility/RegisterContextPOSIX_arm64.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 
 class RegisterContextCorePOSIX_arm64 : public RegisterContextPOSIX_arm64 {
 public:

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h Fri Mar  3 19:30:05 2017
@@ -15,8 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "Plugins/Process/Utility/RegisterContextPOSIX_mips64.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 
 class RegisterContextCorePOSIX_mips64 : public RegisterContextPOSIX_mips64 {
 public:

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp Fri Mar  3 19:30:05 2017
@@ -9,9 +9,9 @@
 
 #include "RegisterContextPOSIXCore_powerpc.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 using namespace lldb_private;
 

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h Fri Mar  3 19:30:05 2017
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 
 class RegisterContextCorePOSIX_powerpc : public RegisterContextPOSIX_powerpc {
 public:

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp Fri Mar  3 19:30:05 2017
@@ -9,9 +9,9 @@
 
 #include "RegisterContextPOSIXCore_s390x.h"
 
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 using namespace lldb_private;
 

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h Fri Mar  3 19:30:05 2017
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "Plugins/Process/Utility/RegisterContextPOSIX_s390x.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 
 class RegisterContextCorePOSIX_s390x : public RegisterContextPOSIX_s390x {
 public:

Modified: lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp Fri Mar  3 19:30:05 2017
@@ -8,9 +8,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "RegisterContextPOSIXCore_x86_64.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataExtractor.h"
 
 using namespace lldb_private;
 

Modified: lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp Fri Mar  3 19:30:05 2017
@@ -7,11 +7,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Unwind.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 
 #include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"

Modified: lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h Fri Mar  3 19:30:05 2017
@@ -16,8 +16,8 @@
 
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataExtractor.h"
 
 struct compat_timeval {
   alignas(8) uint64_t tv_sec;

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Fri Mar  3 19:30:05 2017
@@ -18,7 +18,6 @@
 #include <sstream>
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/State.h"
 #include "lldb/Core/StreamGDBRemote.h"
@@ -29,6 +28,7 @@
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/JSON.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Fri Mar  3 19:30:05 2017
@@ -21,7 +21,6 @@
 #include <thread>
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/State.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
@@ -37,6 +36,7 @@
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Target/FileAction.h"
 #include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/JSON.h"
 #include "lldb/Utility/LLDBAssert.h"

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Fri Mar  3 19:30:05 2017
@@ -12,12 +12,12 @@
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 // Project includes
 #include "ProcessGDBRemote.h"

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Fri Mar  3 19:30:05 2017
@@ -17,9 +17,9 @@
 // Other libraries and framework includes
 // Project includes
 #include "Plugins/Process/Utility/DynamicRegisterInfo.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp Fri Mar  3 19:30:05 2017
@@ -11,7 +11,6 @@
 
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/State.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
@@ -21,6 +20,7 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/UnixSignals.h"
 #include "lldb/Target/Unwind.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 
 #include "ProcessGDBRemote.h"

Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Fri Mar  3 19:30:05 2017
@@ -18,7 +18,6 @@
 #include <mutex>
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -30,6 +29,7 @@
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/Log.h"
 
 // Project includes

Modified: lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp Fri Mar  3 19:30:05 2017
@@ -13,7 +13,6 @@
 
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/State.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Process.h"
@@ -21,6 +20,7 @@
 #include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Unwind.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 
 #include "ProcessMachCore.h"

Modified: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h (original)
+++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h Fri Mar  3 19:30:05 2017
@@ -16,7 +16,7 @@
 
 // Other libraries and framework includes
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBuffer.h"
+#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/Error.h"
 
 #include "llvm/ADT/ArrayRef.h"

Modified: lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp (original)
+++ lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp Fri Mar  3 19:30:05 2017
@@ -12,7 +12,6 @@
 #include "ThreadMinidump.h"
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferLLVM.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
@@ -22,6 +21,7 @@
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"
 
@@ -53,7 +53,7 @@ lldb::ProcessSP ProcessMinidump::CreateI
   // Read enough data for the Minidump header
   constexpr size_t header_size = sizeof(MinidumpHeader);
   auto DataPtr =
-      DataBufferLLVM::CreateFromFileSpec(*crash_file, header_size, 0);
+      DataBufferLLVM::CreateFromPath(crash_file->GetPath(), header_size, 0);
   if (!DataPtr)
     return nullptr;
 
@@ -65,7 +65,7 @@ lldb::ProcessSP ProcessMinidump::CreateI
   if (header == nullptr)
     return nullptr;
 
-  auto AllData = DataBufferLLVM::CreateFromFileSpec(*crash_file, -1, 0);
+  auto AllData = DataBufferLLVM::CreateFromPath(crash_file->GetPath(), -1, 0);
   if (!AllData)
     return nullptr;
 

Modified: lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp (original)
+++ lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp Fri Mar  3 19:30:05 2017
@@ -11,7 +11,7 @@
 #include "RegisterContextMinidump_x86_32.h"
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 // C includes
 // C++ includes

Modified: lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp Fri Mar  3 19:30:05 2017
@@ -11,7 +11,7 @@
 #include "RegisterContextMinidump_x86_64.h"
 
 // Other libraries and framework includes
-#include "lldb/Core/DataBufferHeap.h"
+#include "lldb/Utility/DataBufferHeap.h"
 
 // C includes
 // C++ includes

Modified: lldb/trunk/source/Plugins/Process/minidump/ThreadMinidump.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/ThreadMinidump.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/minidump/ThreadMinidump.cpp (original)
+++ lldb/trunk/source/Plugins/Process/minidump/ThreadMinidump.cpp Fri Mar  3 19:30:05 2017
@@ -20,11 +20,11 @@
 
 #include "Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Unwind.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 
 // C Includes

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h Fri Mar  3 19:30:05 2017
@@ -11,8 +11,8 @@
 #define liblldb_DWARFDataExtractor_h_
 
 // Other libraries and framework includes.
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/dwarf.h"
+#include "lldb/Utility/DataExtractor.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp Fri Mar  3 19:30:05 2017
@@ -9,8 +9,6 @@
 
 #include "Plugins/Process/Utility/HistoryThread.h"
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
@@ -25,6 +23,8 @@
 #include "lldb/Target/QueueList.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Fri Mar  3 19:30:05 2017
@@ -11,8 +11,6 @@
 
 #include "lldb/Core/Address.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/FormatEntity.h"
@@ -21,6 +19,8 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Mar  3 19:30:05 2017
@@ -73,7 +73,6 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Utility/Flags.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
@@ -94,6 +93,7 @@
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/RegularExpression.h"

Modified: lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompactUnwindInfo.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CompactUnwindInfo.cpp (original)
+++ lldb/trunk/source/Symbol/CompactUnwindInfo.cpp Fri Mar  3 19:30:05 2017
@@ -12,7 +12,6 @@
 #include <algorithm>
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Core/Section.h"
@@ -21,6 +20,7 @@
 #include "lldb/Symbol/UnwindPlan.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CompilerType.cpp (original)
+++ lldb/trunk/source/Symbol/CompilerType.cpp Fri Mar  3 19:30:05 2017
@@ -9,8 +9,6 @@
 
 #include "lldb/Symbol/CompilerType.h"
 
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/StreamFile.h"
@@ -20,6 +18,8 @@
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/StreamString.h"
 

Modified: lldb/trunk/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Fri Mar  3 19:30:05 2017
@@ -9,8 +9,6 @@
 
 #include "lldb/Symbol/ObjectFile.h"
 #include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
-#include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/PluginManager.h"
@@ -22,6 +20,8 @@
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/lldb-private.h"

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Fri Mar  3 19:30:05 2017
@@ -13,10 +13,10 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/StreamString.h"
 
 #include "lldb/Symbol/CompilerType.h"

Modified: lldb/trunk/source/Target/Memory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Memory.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Target/Memory.cpp (original)
+++ lldb/trunk/source/Target/Memory.cpp Fri Mar  3 19:30:05 2017
@@ -13,10 +13,10 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/RangeMap.h"
 #include "lldb/Core/State.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Log.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Fri Mar  3 19:30:05 2017
@@ -20,7 +20,6 @@
 // Project includes
 #include "lldb/Breakpoint/BreakpointIDList.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
@@ -39,6 +38,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/Log.h"
 

Modified: lldb/trunk/source/Target/RegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/RegisterContext.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Target/RegisterContext.cpp (original)
+++ lldb/trunk/source/Target/RegisterContext.cpp Fri Mar  3 19:30:05 2017
@@ -12,7 +12,6 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Target/RegisterContext.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
@@ -23,6 +22,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Fri Mar  3 19:30:05 2017
@@ -14,8 +14,6 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Module.h"
@@ -31,6 +29,8 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadPlan.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Log.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/Utility/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/CMakeLists.txt?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Utility/CMakeLists.txt Fri Mar  3 19:30:05 2017
@@ -1,5 +1,9 @@
 add_lldb_library(lldbUtility
   ConstString.cpp
+  DataBufferHeap.cpp
+  DataBufferLLVM.cpp
+  DataEncoder.cpp
+  DataExtractor.cpp
   Error.cpp
   JSON.cpp
   LLDBAssert.cpp

Added: lldb/trunk/source/Utility/DataBufferHeap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/DataBufferHeap.cpp?rev=296943&view=auto
==============================================================================
--- lldb/trunk/source/Utility/DataBufferHeap.cpp (added)
+++ lldb/trunk/source/Utility/DataBufferHeap.cpp Fri Mar  3 19:30:05 2017
@@ -0,0 +1,94 @@
+//===-- DataBufferHeap.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/DataBufferHeap.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+
+using namespace lldb_private;
+
+//----------------------------------------------------------------------
+// Default constructor
+//----------------------------------------------------------------------
+DataBufferHeap::DataBufferHeap() : m_data() {}
+
+//----------------------------------------------------------------------
+// Initialize this class with "n" characters and fill the buffer
+// with "ch".
+//----------------------------------------------------------------------
+DataBufferHeap::DataBufferHeap(lldb::offset_t n, uint8_t ch) : m_data() {
+  if (n < m_data.max_size())
+    m_data.assign(n, ch);
+}
+
+//----------------------------------------------------------------------
+// Initialize this class with a copy of the "n" bytes from the "bytes"
+// buffer.
+//----------------------------------------------------------------------
+DataBufferHeap::DataBufferHeap(const void *src, lldb::offset_t src_len)
+    : m_data() {
+  CopyData(src, src_len);
+}
+
+//----------------------------------------------------------------------
+// Virtual destructor since this class inherits from a pure virtual
+// base class.
+//----------------------------------------------------------------------
+DataBufferHeap::~DataBufferHeap() = default;
+
+//----------------------------------------------------------------------
+// Return a pointer to the bytes owned by this object, or nullptr if
+// the object contains no bytes.
+//----------------------------------------------------------------------
+uint8_t *DataBufferHeap::GetBytes() {
+  return (m_data.empty() ? nullptr : m_data.data());
+}
+
+//----------------------------------------------------------------------
+// Return a const pointer to the bytes owned by this object, or nullptr
+// if the object contains no bytes.
+//----------------------------------------------------------------------
+const uint8_t *DataBufferHeap::GetBytes() const {
+  return (m_data.empty() ? nullptr : m_data.data());
+}
+
+//----------------------------------------------------------------------
+// Return the number of bytes this object currently contains.
+//----------------------------------------------------------------------
+uint64_t DataBufferHeap::GetByteSize() const { return m_data.size(); }
+
+//----------------------------------------------------------------------
+// Sets the number of bytes that this object should be able to
+// contain. This can be used prior to copying data into the buffer.
+//----------------------------------------------------------------------
+uint64_t DataBufferHeap::SetByteSize(uint64_t new_size) {
+  m_data.resize(new_size);
+  return m_data.size();
+}
+
+void DataBufferHeap::CopyData(const void *src, uint64_t src_len) {
+  const uint8_t *src_u8 = (const uint8_t *)src;
+  if (src && src_len > 0)
+    m_data.assign(src_u8, src_u8 + src_len);
+  else
+    m_data.clear();
+}
+
+void DataBufferHeap::AppendData(const void *src, uint64_t src_len) {
+  m_data.insert(m_data.end(), (const uint8_t *)src,
+                (const uint8_t *)src + src_len);
+}
+
+void DataBufferHeap::Clear() {
+  buffer_t empty;
+  m_data.swap(empty);
+}

Added: lldb/trunk/source/Utility/DataBufferLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/DataBufferLLVM.cpp?rev=296943&view=auto
==============================================================================
--- lldb/trunk/source/Utility/DataBufferLLVM.cpp (added)
+++ lldb/trunk/source/Utility/DataBufferLLVM.cpp Fri Mar  3 19:30:05 2017
@@ -0,0 +1,52 @@
+//===--- DataBufferLLVM.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/DataBufferLLVM.h"
+
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/MemoryBuffer.h"
+
+using namespace lldb_private;
+
+DataBufferLLVM::DataBufferLLVM(std::unique_ptr<llvm::MemoryBuffer> MemBuffer)
+    : Buffer(std::move(MemBuffer)) {
+  assert(Buffer != nullptr &&
+         "Cannot construct a DataBufferLLVM with a null buffer");
+}
+
+DataBufferLLVM::~DataBufferLLVM() {}
+
+std::shared_ptr<DataBufferLLVM>
+DataBufferLLVM::CreateFromPath(const llvm::Twine &Path, uint64_t Size,
+                               uint64_t Offset) {
+  // If the file resides non-locally, pass the volatile flag so that we don't
+  // mmap it.
+  bool Volatile = !llvm::sys::fs::is_local(Path);
+
+  auto Buffer = llvm::MemoryBuffer::getFileSlice(Path, Size, Offset, Volatile);
+  if (!Buffer)
+    return nullptr;
+  return std::shared_ptr<DataBufferLLVM>(
+      new DataBufferLLVM(std::move(*Buffer)));
+}
+
+uint8_t *DataBufferLLVM::GetBytes() {
+  return const_cast<uint8_t *>(GetBuffer());
+}
+
+const uint8_t *DataBufferLLVM::GetBytes() const { return GetBuffer(); }
+
+lldb::offset_t DataBufferLLVM::GetByteSize() const {
+  return Buffer->getBufferSize();
+}
+
+const uint8_t *DataBufferLLVM::GetBuffer() const {
+  return reinterpret_cast<const uint8_t *>(Buffer->getBufferStart());
+}

Added: lldb/trunk/source/Utility/DataEncoder.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/DataEncoder.cpp?rev=296943&view=auto
==============================================================================
--- lldb/trunk/source/Utility/DataEncoder.cpp (added)
+++ lldb/trunk/source/Utility/DataEncoder.cpp Fri Mar  3 19:30:05 2017
@@ -0,0 +1,284 @@
+//===-- DataEncoder.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/DataEncoder.h"
+
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/Endian.h"
+
+#include "llvm/Support/MathExtras.h"
+
+// C Includes
+// C++ Includes
+#include <cassert>
+#include <cstddef>
+
+using namespace lldb;
+using namespace lldb_private;
+
+static inline void WriteInt16(unsigned char *ptr, unsigned offset,
+                              uint16_t value) {
+  *(uint16_t *)(ptr + offset) = value;
+}
+
+static inline void WriteInt32(unsigned char *ptr, unsigned offset,
+                              uint32_t value) {
+  *(uint32_t *)(ptr + offset) = value;
+}
+
+static inline void WriteInt64(unsigned char *ptr, unsigned offset,
+                              uint64_t value) {
+  *(uint64_t *)(ptr + offset) = value;
+}
+
+static inline void WriteSwappedInt16(unsigned char *ptr, unsigned offset,
+                                     uint16_t value) {
+  *(uint16_t *)(ptr + offset) = llvm::ByteSwap_16(value);
+}
+
+static inline void WriteSwappedInt32(unsigned char *ptr, unsigned offset,
+                                     uint32_t value) {
+  *(uint32_t *)(ptr + offset) = llvm::ByteSwap_32(value);
+}
+
+static inline void WriteSwappedInt64(unsigned char *ptr, unsigned offset,
+                                     uint64_t value) {
+  *(uint64_t *)(ptr + offset) = llvm::ByteSwap_64(value);
+}
+
+//----------------------------------------------------------------------
+// Default constructor.
+//----------------------------------------------------------------------
+DataEncoder::DataEncoder()
+    : m_start(nullptr), m_end(nullptr),
+      m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
+      m_data_sp() {}
+
+//----------------------------------------------------------------------
+// This constructor allows us to use data that is owned by someone else.
+// The data must stay around as long as this object is valid.
+//----------------------------------------------------------------------
+DataEncoder::DataEncoder(void *data, uint32_t length, ByteOrder endian,
+                         uint8_t addr_size)
+    : m_start((uint8_t *)data), m_end((uint8_t *)data + length),
+      m_byte_order(endian), m_addr_size(addr_size), m_data_sp() {}
+
+//----------------------------------------------------------------------
+// Make a shared pointer reference to the shared data in "data_sp" and
+// set the endian swapping setting to "swap", and the address size to
+// "addr_size". The shared data reference will ensure the data lives
+// as long as any DataEncoder objects exist that have a reference to
+// this data.
+//----------------------------------------------------------------------
+DataEncoder::DataEncoder(const DataBufferSP &data_sp, ByteOrder endian,
+                         uint8_t addr_size)
+    : m_start(nullptr), m_end(nullptr), m_byte_order(endian),
+      m_addr_size(addr_size), m_data_sp() {
+  SetData(data_sp);
+}
+
+DataEncoder::~DataEncoder() = default;
+
+//------------------------------------------------------------------
+// Clears the object contents back to a default invalid state, and
+// release any references to shared data that this object may
+// contain.
+//------------------------------------------------------------------
+void DataEncoder::Clear() {
+  m_start = nullptr;
+  m_end = nullptr;
+  m_byte_order = endian::InlHostByteOrder();
+  m_addr_size = sizeof(void *);
+  m_data_sp.reset();
+}
+
+//------------------------------------------------------------------
+// If this object contains shared data, this function returns the
+// offset into that shared data. Else zero is returned.
+//------------------------------------------------------------------
+size_t DataEncoder::GetSharedDataOffset() const {
+  if (m_start != nullptr) {
+    const DataBuffer *data = m_data_sp.get();
+    if (data != nullptr) {
+      const uint8_t *data_bytes = data->GetBytes();
+      if (data_bytes != nullptr) {
+        assert(m_start >= data_bytes);
+        return m_start - data_bytes;
+      }
+    }
+  }
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Set the data with which this object will extract from to data
+// starting at BYTES and set the length of the data to LENGTH bytes
+// long. The data is externally owned must be around at least as
+// long as this object points to the data. No copy of the data is
+// made, this object just refers to this data and can extract from
+// it. If this object refers to any shared data upon entry, the
+// reference to that data will be released. Is SWAP is set to true,
+// any data extracted will be endian swapped.
+//----------------------------------------------------------------------
+uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) {
+  m_byte_order = endian;
+  m_data_sp.reset();
+  if (bytes == nullptr || length == 0) {
+    m_start = nullptr;
+    m_end = nullptr;
+  } else {
+    m_start = (uint8_t *)bytes;
+    m_end = m_start + length;
+  }
+  return GetByteSize();
+}
+
+//----------------------------------------------------------------------
+// Assign the data for this object to be a subrange of the shared
+// data in "data_sp" starting "data_offset" bytes into "data_sp"
+// and ending "data_length" bytes later. If "data_offset" is not
+// a valid offset into "data_sp", then this object will contain no
+// bytes. If "data_offset" is within "data_sp" yet "data_length" is
+// too large, the length will be capped at the number of bytes
+// remaining in "data_sp". A ref counted pointer to the data in
+// "data_sp" will be made in this object IF the number of bytes this
+// object refers to in greater than zero (if at least one byte was
+// available starting at "data_offset") to ensure the data stays
+// around as long as it is needed. The address size and endian swap
+// settings will remain unchanged from their current settings.
+//----------------------------------------------------------------------
+uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset,
+                              uint32_t data_length) {
+  m_start = m_end = nullptr;
+
+  if (data_length > 0) {
+    m_data_sp = data_sp;
+    if (data_sp) {
+      const size_t data_size = data_sp->GetByteSize();
+      if (data_offset < data_size) {
+        m_start = data_sp->GetBytes() + data_offset;
+        const size_t bytes_left = data_size - data_offset;
+        // Cap the length of we asked for too many
+        if (data_length <= bytes_left)
+          m_end = m_start + data_length; // We got all the bytes we wanted
+        else
+          m_end = m_start + bytes_left; // Not all the bytes requested were
+                                        // available in the shared data
+      }
+    }
+  }
+
+  uint32_t new_size = GetByteSize();
+
+  // Don't hold a shared pointer to the data buffer if we don't share
+  // any valid bytes in the shared buffer.
+  if (new_size == 0)
+    m_data_sp.reset();
+
+  return new_size;
+}
+
+//----------------------------------------------------------------------
+// Extract a single unsigned char from the binary data and update
+// the offset pointed to by "offset_ptr".
+//
+// RETURNS the byte that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint32_t DataEncoder::PutU8(uint32_t offset, uint8_t value) {
+  if (ValidOffset(offset)) {
+    m_start[offset] = value;
+    return offset + 1;
+  }
+  return UINT32_MAX;
+}
+
+uint32_t DataEncoder::PutU16(uint32_t offset, uint16_t value) {
+  if (ValidOffsetForDataOfSize(offset, sizeof(value))) {
+    if (m_byte_order != endian::InlHostByteOrder())
+      WriteSwappedInt16(m_start, offset, value);
+    else
+      WriteInt16(m_start, offset, value);
+
+    return offset + sizeof(value);
+  }
+  return UINT32_MAX;
+}
+
+uint32_t DataEncoder::PutU32(uint32_t offset, uint32_t value) {
+  if (ValidOffsetForDataOfSize(offset, sizeof(value))) {
+    if (m_byte_order != endian::InlHostByteOrder())
+      WriteSwappedInt32(m_start, offset, value);
+    else
+      WriteInt32(m_start, offset, value);
+
+    return offset + sizeof(value);
+  }
+  return UINT32_MAX;
+}
+
+uint32_t DataEncoder::PutU64(uint32_t offset, uint64_t value) {
+  if (ValidOffsetForDataOfSize(offset, sizeof(value))) {
+    if (m_byte_order != endian::InlHostByteOrder())
+      WriteSwappedInt64(m_start, offset, value);
+    else
+      WriteInt64(m_start, offset, value);
+
+    return offset + sizeof(value);
+  }
+  return UINT32_MAX;
+}
+
+//----------------------------------------------------------------------
+// Extract a single integer value from the data and update the offset
+// pointed to by "offset_ptr". The size of the extracted integer
+// is specified by the "byte_size" argument. "byte_size" should have
+// a value >= 1 and <= 8 since the return value is only 64 bits
+// wide. Any "byte_size" values less than 1 or greater than 8 will
+// result in nothing being extracted, and zero being returned.
+//
+// RETURNS the integer value that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint32_t DataEncoder::PutMaxU64(uint32_t offset, uint32_t byte_size,
+                                uint64_t value) {
+  switch (byte_size) {
+  case 1:
+    return PutU8(offset, value);
+  case 2:
+    return PutU16(offset, value);
+  case 4:
+    return PutU32(offset, value);
+  case 8:
+    return PutU64(offset, value);
+  default:
+    llvm_unreachable("GetMax64 unhandled case!");
+  }
+  return UINT32_MAX;
+}
+
+uint32_t DataEncoder::PutData(uint32_t offset, const void *src,
+                              uint32_t src_len) {
+  if (src == nullptr || src_len == 0)
+    return offset;
+
+  if (ValidOffsetForDataOfSize(offset, src_len)) {
+    memcpy(m_start + offset, src, src_len);
+    return offset + src_len;
+  }
+  return UINT32_MAX;
+}
+
+uint32_t DataEncoder::PutAddress(uint32_t offset, lldb::addr_t addr) {
+  return PutMaxU64(offset, GetAddressByteSize(), addr);
+}
+
+uint32_t DataEncoder::PutCString(uint32_t offset, const char *cstr) {
+  if (cstr != nullptr)
+    return PutData(offset, cstr, strlen(cstr) + 1);
+  return UINT32_MAX;
+}

Added: lldb/trunk/source/Utility/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/DataExtractor.cpp?rev=296943&view=auto
==============================================================================
--- lldb/trunk/source/Utility/DataExtractor.cpp (added)
+++ lldb/trunk/source/Utility/DataExtractor.cpp Fri Mar  3 19:30:05 2017
@@ -0,0 +1,1238 @@
+//===-- DataExtractor.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
+// C++ Includes
+#include <cassert>
+#include <cmath>
+#include <cstddef>
+#include <string>
+
+// Project includes
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataExtractor.h"
+#include "lldb/Utility/Endian.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/UUID.h"
+
+// Other libraries and framework includes
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/MD5.h"
+#include "llvm/Support/MathExtras.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+static inline uint16_t ReadInt16(const unsigned char *ptr, offset_t offset) {
+  uint16_t value;
+  memcpy(&value, ptr + offset, 2);
+  return value;
+}
+
+static inline uint32_t ReadInt32(const unsigned char *ptr,
+                                 offset_t offset = 0) {
+  uint32_t value;
+  memcpy(&value, ptr + offset, 4);
+  return value;
+}
+
+static inline uint64_t ReadInt64(const unsigned char *ptr,
+                                 offset_t offset = 0) {
+  uint64_t value;
+  memcpy(&value, ptr + offset, 8);
+  return value;
+}
+
+static inline uint16_t ReadInt16(const void *ptr) {
+  uint16_t value;
+  memcpy(&value, ptr, 2);
+  return value;
+}
+
+static inline uint16_t ReadSwapInt16(const unsigned char *ptr,
+                                     offset_t offset) {
+  uint16_t value;
+  memcpy(&value, ptr + offset, 2);
+  return llvm::ByteSwap_16(value);
+}
+
+static inline uint32_t ReadSwapInt32(const unsigned char *ptr,
+                                     offset_t offset) {
+  uint32_t value;
+  memcpy(&value, ptr + offset, 4);
+  return llvm::ByteSwap_32(value);
+}
+
+static inline uint64_t ReadSwapInt64(const unsigned char *ptr,
+                                     offset_t offset) {
+  uint64_t value;
+  memcpy(&value, ptr + offset, 8);
+  return llvm::ByteSwap_64(value);
+}
+
+static inline uint16_t ReadSwapInt16(const void *ptr) {
+  uint16_t value;
+  memcpy(&value, ptr, 2);
+  return llvm::ByteSwap_16(value);
+}
+
+static inline uint32_t ReadSwapInt32(const void *ptr) {
+  uint32_t value;
+  memcpy(&value, ptr, 4);
+  return llvm::ByteSwap_32(value);
+}
+
+static inline uint64_t ReadSwapInt64(const void *ptr) {
+  uint64_t value;
+  memcpy(&value, ptr, 8);
+  return llvm::ByteSwap_64(value);
+}
+
+DataExtractor::DataExtractor()
+    : m_start(nullptr), m_end(nullptr),
+      m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)),
+      m_data_sp(), m_target_byte_size(1) {}
+
+//----------------------------------------------------------------------
+// This constructor allows us to use data that is owned by someone else.
+// The data must stay around as long as this object is valid.
+//----------------------------------------------------------------------
+DataExtractor::DataExtractor(const void *data, offset_t length,
+                             ByteOrder endian, uint32_t addr_size,
+                             uint32_t target_byte_size /*=1*/)
+    : m_start(const_cast<uint8_t *>(reinterpret_cast<const uint8_t *>(data))),
+      m_end(const_cast<uint8_t *>(reinterpret_cast<const uint8_t *>(data)) +
+            length),
+      m_byte_order(endian), m_addr_size(addr_size), m_data_sp(),
+      m_target_byte_size(target_byte_size) {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(addr_size == 4 || addr_size == 8);
+#endif
+}
+
+//----------------------------------------------------------------------
+// Make a shared pointer reference to the shared data in "data_sp" and
+// set the endian swapping setting to "swap", and the address size to
+// "addr_size". The shared data reference will ensure the data lives
+// as long as any DataExtractor objects exist that have a reference to
+// this data.
+//----------------------------------------------------------------------
+DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
+                             uint32_t addr_size,
+                             uint32_t target_byte_size /*=1*/)
+    : m_start(nullptr), m_end(nullptr), m_byte_order(endian),
+      m_addr_size(addr_size), m_data_sp(),
+      m_target_byte_size(target_byte_size) {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(addr_size == 4 || addr_size == 8);
+#endif
+  SetData(data_sp);
+}
+
+//----------------------------------------------------------------------
+// Initialize this object with a subset of the data bytes in "data".
+// If "data" contains shared data, then a reference to this shared
+// data will added and the shared data will stay around as long
+// as any object contains a reference to that data. The endian
+// swap and address size settings are copied from "data".
+//----------------------------------------------------------------------
+DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset,
+                             offset_t length, uint32_t target_byte_size /*=1*/)
+    : m_start(nullptr), m_end(nullptr), m_byte_order(data.m_byte_order),
+      m_addr_size(data.m_addr_size), m_data_sp(),
+      m_target_byte_size(target_byte_size) {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(m_addr_size == 4 || m_addr_size == 8);
+#endif
+  if (data.ValidOffset(offset)) {
+    offset_t bytes_available = data.GetByteSize() - offset;
+    if (length > bytes_available)
+      length = bytes_available;
+    SetData(data, offset, length);
+  }
+}
+
+DataExtractor::DataExtractor(const DataExtractor &rhs)
+    : m_start(rhs.m_start), m_end(rhs.m_end), m_byte_order(rhs.m_byte_order),
+      m_addr_size(rhs.m_addr_size), m_data_sp(rhs.m_data_sp),
+      m_target_byte_size(rhs.m_target_byte_size) {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(m_addr_size == 4 || m_addr_size == 8);
+#endif
+}
+
+//----------------------------------------------------------------------
+// Assignment operator
+//----------------------------------------------------------------------
+const DataExtractor &DataExtractor::operator=(const DataExtractor &rhs) {
+  if (this != &rhs) {
+    m_start = rhs.m_start;
+    m_end = rhs.m_end;
+    m_byte_order = rhs.m_byte_order;
+    m_addr_size = rhs.m_addr_size;
+    m_data_sp = rhs.m_data_sp;
+  }
+  return *this;
+}
+
+DataExtractor::~DataExtractor() = default;
+
+//------------------------------------------------------------------
+// Clears the object contents back to a default invalid state, and
+// release any references to shared data that this object may
+// contain.
+//------------------------------------------------------------------
+void DataExtractor::Clear() {
+  m_start = nullptr;
+  m_end = nullptr;
+  m_byte_order = endian::InlHostByteOrder();
+  m_addr_size = sizeof(void *);
+  m_data_sp.reset();
+}
+
+//------------------------------------------------------------------
+// If this object contains shared data, this function returns the
+// offset into that shared data. Else zero is returned.
+//------------------------------------------------------------------
+size_t DataExtractor::GetSharedDataOffset() const {
+  if (m_start != nullptr) {
+    const DataBuffer *data = m_data_sp.get();
+    if (data != nullptr) {
+      const uint8_t *data_bytes = data->GetBytes();
+      if (data_bytes != nullptr) {
+        assert(m_start >= data_bytes);
+        return m_start - data_bytes;
+      }
+    }
+  }
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Set the data with which this object will extract from to data
+// starting at BYTES and set the length of the data to LENGTH bytes
+// long. The data is externally owned must be around at least as
+// long as this object points to the data. No copy of the data is
+// made, this object just refers to this data and can extract from
+// it. If this object refers to any shared data upon entry, the
+// reference to that data will be released. Is SWAP is set to true,
+// any data extracted will be endian swapped.
+//----------------------------------------------------------------------
+lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length,
+                                      ByteOrder endian) {
+  m_byte_order = endian;
+  m_data_sp.reset();
+  if (bytes == nullptr || length == 0) {
+    m_start = nullptr;
+    m_end = nullptr;
+  } else {
+    m_start = const_cast<uint8_t *>(reinterpret_cast<const uint8_t *>(bytes));
+    m_end = m_start + length;
+  }
+  return GetByteSize();
+}
+
+//----------------------------------------------------------------------
+// Assign the data for this object to be a subrange in "data"
+// starting "data_offset" bytes into "data" and ending "data_length"
+// bytes later. If "data_offset" is not a valid offset into "data",
+// then this object will contain no bytes. If "data_offset" is
+// within "data" yet "data_length" is too large, the length will be
+// capped at the number of bytes remaining in "data". If "data"
+// contains a shared pointer to other data, then a ref counted
+// pointer to that data will be made in this object. If "data"
+// doesn't contain a shared pointer to data, then the bytes referred
+// to in "data" will need to exist at least as long as this object
+// refers to those bytes. The address size and endian swap settings
+// are copied from the current values in "data".
+//----------------------------------------------------------------------
+lldb::offset_t DataExtractor::SetData(const DataExtractor &data,
+                                      offset_t data_offset,
+                                      offset_t data_length) {
+  m_addr_size = data.m_addr_size;
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(m_addr_size == 4 || m_addr_size == 8);
+#endif
+  // If "data" contains shared pointer to data, then we can use that
+  if (data.m_data_sp) {
+    m_byte_order = data.m_byte_order;
+    return SetData(data.m_data_sp, data.GetSharedDataOffset() + data_offset,
+                   data_length);
+  }
+
+  // We have a DataExtractor object that just has a pointer to bytes
+  if (data.ValidOffset(data_offset)) {
+    if (data_length > data.GetByteSize() - data_offset)
+      data_length = data.GetByteSize() - data_offset;
+    return SetData(data.GetDataStart() + data_offset, data_length,
+                   data.GetByteOrder());
+  }
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Assign the data for this object to be a subrange of the shared
+// data in "data_sp" starting "data_offset" bytes into "data_sp"
+// and ending "data_length" bytes later. If "data_offset" is not
+// a valid offset into "data_sp", then this object will contain no
+// bytes. If "data_offset" is within "data_sp" yet "data_length" is
+// too large, the length will be capped at the number of bytes
+// remaining in "data_sp". A ref counted pointer to the data in
+// "data_sp" will be made in this object IF the number of bytes this
+// object refers to in greater than zero (if at least one byte was
+// available starting at "data_offset") to ensure the data stays
+// around as long as it is needed. The address size and endian swap
+// settings will remain unchanged from their current settings.
+//----------------------------------------------------------------------
+lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp,
+                                      offset_t data_offset,
+                                      offset_t data_length) {
+  m_start = m_end = nullptr;
+
+  if (data_length > 0) {
+    m_data_sp = data_sp;
+    if (data_sp) {
+      const size_t data_size = data_sp->GetByteSize();
+      if (data_offset < data_size) {
+        m_start = data_sp->GetBytes() + data_offset;
+        const size_t bytes_left = data_size - data_offset;
+        // Cap the length of we asked for too many
+        if (data_length <= bytes_left)
+          m_end = m_start + data_length; // We got all the bytes we wanted
+        else
+          m_end = m_start + bytes_left; // Not all the bytes requested were
+                                        // available in the shared data
+      }
+    }
+  }
+
+  size_t new_size = GetByteSize();
+
+  // Don't hold a shared pointer to the data buffer if we don't share
+  // any valid bytes in the shared buffer.
+  if (new_size == 0)
+    m_data_sp.reset();
+
+  return new_size;
+}
+
+//----------------------------------------------------------------------
+// Extract a single unsigned char from the binary data and update
+// the offset pointed to by "offset_ptr".
+//
+// RETURNS the byte that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint8_t DataExtractor::GetU8(offset_t *offset_ptr) const {
+  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, 1);
+  if (data)
+    return *data;
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Extract "count" unsigned chars from the binary data and update the
+// offset pointed to by "offset_ptr". The extracted data is copied into
+// "dst".
+//
+// RETURNS the non-nullptr buffer pointer upon successful extraction of
+// all the requested bytes, or nullptr when the data is not available in
+// the buffer due to being out of bounds, or insufficient data.
+//----------------------------------------------------------------------
+void *DataExtractor::GetU8(offset_t *offset_ptr, void *dst,
+                           uint32_t count) const {
+  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, count);
+  if (data) {
+    // Copy the data into the buffer
+    memcpy(dst, data, count);
+    // Return a non-nullptr pointer to the converted data as an indicator of
+    // success
+    return dst;
+  }
+  return nullptr;
+}
+
+//----------------------------------------------------------------------
+// Extract a single uint16_t from the data and update the offset
+// pointed to by "offset_ptr".
+//
+// RETURNS the uint16_t that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint16_t DataExtractor::GetU16(offset_t *offset_ptr) const {
+  uint16_t val = 0;
+  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val));
+  if (data) {
+    if (m_byte_order != endian::InlHostByteOrder())
+      val = ReadSwapInt16(data);
+    else
+      val = ReadInt16(data);
+  }
+  return val;
+}
+
+uint16_t DataExtractor::GetU16_unchecked(offset_t *offset_ptr) const {
+  uint16_t val;
+  if (m_byte_order == endian::InlHostByteOrder())
+    val = ReadInt16(m_start, *offset_ptr);
+  else
+    val = ReadSwapInt16(m_start, *offset_ptr);
+  *offset_ptr += sizeof(val);
+  return val;
+}
+
+uint32_t DataExtractor::GetU32_unchecked(offset_t *offset_ptr) const {
+  uint32_t val;
+  if (m_byte_order == endian::InlHostByteOrder())
+    val = ReadInt32(m_start, *offset_ptr);
+  else
+    val = ReadSwapInt32(m_start, *offset_ptr);
+  *offset_ptr += sizeof(val);
+  return val;
+}
+
+uint64_t DataExtractor::GetU64_unchecked(offset_t *offset_ptr) const {
+  uint64_t val;
+  if (m_byte_order == endian::InlHostByteOrder())
+    val = ReadInt64(m_start, *offset_ptr);
+  else
+    val = ReadSwapInt64(m_start, *offset_ptr);
+  *offset_ptr += sizeof(val);
+  return val;
+}
+
+//----------------------------------------------------------------------
+// Extract "count" uint16_t values from the binary data and update
+// the offset pointed to by "offset_ptr". The extracted data is
+// copied into "dst".
+//
+// RETURNS the non-nullptr buffer pointer upon successful extraction of
+// all the requested bytes, or nullptr when the data is not available
+// in the buffer due to being out of bounds, or insufficient data.
+//----------------------------------------------------------------------
+void *DataExtractor::GetU16(offset_t *offset_ptr, void *void_dst,
+                            uint32_t count) const {
+  const size_t src_size = sizeof(uint16_t) * count;
+  const uint16_t *src = (const uint16_t *)GetData(offset_ptr, src_size);
+  if (src) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      uint16_t *dst_pos = (uint16_t *)void_dst;
+      uint16_t *dst_end = dst_pos + count;
+      const uint16_t *src_pos = src;
+      while (dst_pos < dst_end) {
+        *dst_pos = ReadSwapInt16(src_pos);
+        ++dst_pos;
+        ++src_pos;
+      }
+    } else {
+      memcpy(void_dst, src, src_size);
+    }
+    // Return a non-nullptr pointer to the converted data as an indicator of
+    // success
+    return void_dst;
+  }
+  return nullptr;
+}
+
+//----------------------------------------------------------------------
+// Extract a single uint32_t from the data and update the offset
+// pointed to by "offset_ptr".
+//
+// RETURNS the uint32_t that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint32_t DataExtractor::GetU32(offset_t *offset_ptr) const {
+  uint32_t val = 0;
+  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val));
+  if (data) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      val = ReadSwapInt32(data);
+    } else {
+      memcpy(&val, data, 4);
+    }
+  }
+  return val;
+}
+
+//----------------------------------------------------------------------
+// Extract "count" uint32_t values from the binary data and update
+// the offset pointed to by "offset_ptr". The extracted data is
+// copied into "dst".
+//
+// RETURNS the non-nullptr buffer pointer upon successful extraction of
+// all the requested bytes, or nullptr when the data is not available
+// in the buffer due to being out of bounds, or insufficient data.
+//----------------------------------------------------------------------
+void *DataExtractor::GetU32(offset_t *offset_ptr, void *void_dst,
+                            uint32_t count) const {
+  const size_t src_size = sizeof(uint32_t) * count;
+  const uint32_t *src = (const uint32_t *)GetData(offset_ptr, src_size);
+  if (src) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      uint32_t *dst_pos = (uint32_t *)void_dst;
+      uint32_t *dst_end = dst_pos + count;
+      const uint32_t *src_pos = src;
+      while (dst_pos < dst_end) {
+        *dst_pos = ReadSwapInt32(src_pos);
+        ++dst_pos;
+        ++src_pos;
+      }
+    } else {
+      memcpy(void_dst, src, src_size);
+    }
+    // Return a non-nullptr pointer to the converted data as an indicator of
+    // success
+    return void_dst;
+  }
+  return nullptr;
+}
+
+//----------------------------------------------------------------------
+// Extract a single uint64_t from the data and update the offset
+// pointed to by "offset_ptr".
+//
+// RETURNS the uint64_t that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint64_t DataExtractor::GetU64(offset_t *offset_ptr) const {
+  uint64_t val = 0;
+  const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val));
+  if (data) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      val = ReadSwapInt64(data);
+    } else {
+      memcpy(&val, data, 8);
+    }
+  }
+  return val;
+}
+
+//----------------------------------------------------------------------
+// GetU64
+//
+// Get multiple consecutive 64 bit values. Return true if the entire
+// read succeeds and increment the offset pointed to by offset_ptr, else
+// return false and leave the offset pointed to by offset_ptr unchanged.
+//----------------------------------------------------------------------
+void *DataExtractor::GetU64(offset_t *offset_ptr, void *void_dst,
+                            uint32_t count) const {
+  const size_t src_size = sizeof(uint64_t) * count;
+  const uint64_t *src = (const uint64_t *)GetData(offset_ptr, src_size);
+  if (src) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      uint64_t *dst_pos = (uint64_t *)void_dst;
+      uint64_t *dst_end = dst_pos + count;
+      const uint64_t *src_pos = src;
+      while (dst_pos < dst_end) {
+        *dst_pos = ReadSwapInt64(src_pos);
+        ++dst_pos;
+        ++src_pos;
+      }
+    } else {
+      memcpy(void_dst, src, src_size);
+    }
+    // Return a non-nullptr pointer to the converted data as an indicator of
+    // success
+    return void_dst;
+  }
+  return nullptr;
+}
+
+//----------------------------------------------------------------------
+// Extract a single integer value from the data and update the offset
+// pointed to by "offset_ptr". The size of the extracted integer
+// is specified by the "byte_size" argument. "byte_size" should have
+// a value between 1 and 4 since the return value is only 32 bits
+// wide. Any "byte_size" values less than 1 or greater than 4 will
+// result in nothing being extracted, and zero being returned.
+//
+// RETURNS the integer value that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint32_t DataExtractor::GetMaxU32(offset_t *offset_ptr,
+                                  size_t byte_size) const {
+  switch (byte_size) {
+  case 1:
+    return GetU8(offset_ptr);
+    break;
+  case 2:
+    return GetU16(offset_ptr);
+    break;
+  case 4:
+    return GetU32(offset_ptr);
+    break;
+  default:
+    assert(false && "GetMaxU32 unhandled case!");
+    break;
+  }
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Extract a single integer value from the data and update the offset
+// pointed to by "offset_ptr". The size of the extracted integer
+// is specified by the "byte_size" argument. "byte_size" should have
+// a value >= 1 and <= 8 since the return value is only 64 bits
+// wide. Any "byte_size" values less than 1 or greater than 8 will
+// result in nothing being extracted, and zero being returned.
+//
+// RETURNS the integer value that was extracted, or zero on failure.
+//----------------------------------------------------------------------
+uint64_t DataExtractor::GetMaxU64(offset_t *offset_ptr, size_t size) const {
+  switch (size) {
+  case 1:
+    return GetU8(offset_ptr);
+    break;
+  case 2:
+    return GetU16(offset_ptr);
+    break;
+  case 4:
+    return GetU32(offset_ptr);
+    break;
+  case 8:
+    return GetU64(offset_ptr);
+    break;
+  default:
+    assert(false && "GetMax64 unhandled case!");
+    break;
+  }
+  return 0;
+}
+
+uint64_t DataExtractor::GetMaxU64_unchecked(offset_t *offset_ptr,
+                                            size_t size) const {
+  switch (size) {
+  case 1:
+    return GetU8_unchecked(offset_ptr);
+    break;
+  case 2:
+    return GetU16_unchecked(offset_ptr);
+    break;
+  case 4:
+    return GetU32_unchecked(offset_ptr);
+    break;
+  case 8:
+    return GetU64_unchecked(offset_ptr);
+    break;
+  default:
+    assert(false && "GetMax64 unhandled case!");
+    break;
+  }
+  return 0;
+}
+
+int64_t DataExtractor::GetMaxS64(offset_t *offset_ptr, size_t size) const {
+  switch (size) {
+  case 1:
+    return (int8_t)GetU8(offset_ptr);
+    break;
+  case 2:
+    return (int16_t)GetU16(offset_ptr);
+    break;
+  case 4:
+    return (int32_t)GetU32(offset_ptr);
+    break;
+  case 8:
+    return (int64_t)GetU64(offset_ptr);
+    break;
+  default:
+    assert(false && "GetMax64 unhandled case!");
+    break;
+  }
+  return 0;
+}
+
+uint64_t DataExtractor::GetMaxU64Bitfield(offset_t *offset_ptr, size_t size,
+                                          uint32_t bitfield_bit_size,
+                                          uint32_t bitfield_bit_offset) const {
+  uint64_t uval64 = GetMaxU64(offset_ptr, size);
+  if (bitfield_bit_size > 0) {
+    int32_t lsbcount = bitfield_bit_offset;
+    if (m_byte_order == eByteOrderBig)
+      lsbcount = size * 8 - bitfield_bit_offset - bitfield_bit_size;
+    if (lsbcount > 0)
+      uval64 >>= lsbcount;
+    uint64_t bitfield_mask = ((1ul << bitfield_bit_size) - 1);
+    if (!bitfield_mask && bitfield_bit_offset == 0 && bitfield_bit_size == 64)
+      return uval64;
+    uval64 &= bitfield_mask;
+  }
+  return uval64;
+}
+
+int64_t DataExtractor::GetMaxS64Bitfield(offset_t *offset_ptr, size_t size,
+                                         uint32_t bitfield_bit_size,
+                                         uint32_t bitfield_bit_offset) const {
+  int64_t sval64 = GetMaxS64(offset_ptr, size);
+  if (bitfield_bit_size > 0) {
+    int32_t lsbcount = bitfield_bit_offset;
+    if (m_byte_order == eByteOrderBig)
+      lsbcount = size * 8 - bitfield_bit_offset - bitfield_bit_size;
+    if (lsbcount > 0)
+      sval64 >>= lsbcount;
+    uint64_t bitfield_mask = (((uint64_t)1) << bitfield_bit_size) - 1;
+    sval64 &= bitfield_mask;
+    // sign extend if needed
+    if (sval64 & (((uint64_t)1) << (bitfield_bit_size - 1)))
+      sval64 |= ~bitfield_mask;
+  }
+  return sval64;
+}
+
+float DataExtractor::GetFloat(offset_t *offset_ptr) const {
+  typedef float float_type;
+  float_type val = 0.0;
+  const size_t src_size = sizeof(float_type);
+  const float_type *src = (const float_type *)GetData(offset_ptr, src_size);
+  if (src) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      const uint8_t *src_data = (const uint8_t *)src;
+      uint8_t *dst_data = (uint8_t *)&val;
+      for (size_t i = 0; i < sizeof(float_type); ++i)
+        dst_data[sizeof(float_type) - 1 - i] = src_data[i];
+    } else {
+      val = *src;
+    }
+  }
+  return val;
+}
+
+double DataExtractor::GetDouble(offset_t *offset_ptr) const {
+  typedef double float_type;
+  float_type val = 0.0;
+  const size_t src_size = sizeof(float_type);
+  const float_type *src = (const float_type *)GetData(offset_ptr, src_size);
+  if (src) {
+    if (m_byte_order != endian::InlHostByteOrder()) {
+      const uint8_t *src_data = (const uint8_t *)src;
+      uint8_t *dst_data = (uint8_t *)&val;
+      for (size_t i = 0; i < sizeof(float_type); ++i)
+        dst_data[sizeof(float_type) - 1 - i] = src_data[i];
+    } else {
+      val = *src;
+    }
+  }
+  return val;
+}
+
+long double DataExtractor::GetLongDouble(offset_t *offset_ptr) const {
+  long double val = 0.0;
+#if defined(__i386__) || defined(__amd64__) || defined(__x86_64__) ||          \
+    defined(_M_IX86) || defined(_M_IA64) || defined(_M_X64)
+  *offset_ptr += CopyByteOrderedData(*offset_ptr, 10, &val, sizeof(val),
+                                     endian::InlHostByteOrder());
+#else
+  *offset_ptr += CopyByteOrderedData(*offset_ptr, sizeof(val), &val,
+                                     sizeof(val), endian::InlHostByteOrder());
+#endif
+  return val;
+}
+
+//------------------------------------------------------------------
+// Extract a single address from the data and update the offset
+// pointed to by "offset_ptr". The size of the extracted address
+// comes from the "this->m_addr_size" member variable and should be
+// set correctly prior to extracting any address values.
+//
+// RETURNS the address that was extracted, or zero on failure.
+//------------------------------------------------------------------
+uint64_t DataExtractor::GetAddress(offset_t *offset_ptr) const {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(m_addr_size == 4 || m_addr_size == 8);
+#endif
+  return GetMaxU64(offset_ptr, m_addr_size);
+}
+
+uint64_t DataExtractor::GetAddress_unchecked(offset_t *offset_ptr) const {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(m_addr_size == 4 || m_addr_size == 8);
+#endif
+  return GetMaxU64_unchecked(offset_ptr, m_addr_size);
+}
+
+//------------------------------------------------------------------
+// Extract a single pointer from the data and update the offset
+// pointed to by "offset_ptr". The size of the extracted pointer
+// comes from the "this->m_addr_size" member variable and should be
+// set correctly prior to extracting any pointer values.
+//
+// RETURNS the pointer that was extracted, or zero on failure.
+//------------------------------------------------------------------
+uint64_t DataExtractor::GetPointer(offset_t *offset_ptr) const {
+#ifdef LLDB_CONFIGURATION_DEBUG
+  assert(m_addr_size == 4 || m_addr_size == 8);
+#endif
+  return GetMaxU64(offset_ptr, m_addr_size);
+}
+
+size_t DataExtractor::ExtractBytes(offset_t offset, offset_t length,
+                                   ByteOrder dst_byte_order, void *dst) const {
+  const uint8_t *src = PeekData(offset, length);
+  if (src) {
+    if (dst_byte_order != GetByteOrder()) {
+      // Validate that only a word- or register-sized dst is byte swapped
+      assert(length == 1 || length == 2 || length == 4 || length == 8 ||
+             length == 10 || length == 16 || length == 32);
+
+      for (uint32_t i = 0; i < length; ++i)
+        ((uint8_t *)dst)[i] = src[length - i - 1];
+    } else
+      ::memcpy(dst, src, length);
+    return length;
+  }
+  return 0;
+}
+
+// Extract data as it exists in target memory
+lldb::offset_t DataExtractor::CopyData(offset_t offset, offset_t length,
+                                       void *dst) const {
+  const uint8_t *src = PeekData(offset, length);
+  if (src) {
+    ::memcpy(dst, src, length);
+    return length;
+  }
+  return 0;
+}
+
+// Extract data and swap if needed when doing the copy
+lldb::offset_t
+DataExtractor::CopyByteOrderedData(offset_t src_offset, offset_t src_len,
+                                   void *dst_void_ptr, offset_t dst_len,
+                                   ByteOrder dst_byte_order) const {
+  // Validate the source info
+  if (!ValidOffsetForDataOfSize(src_offset, src_len))
+    assert(ValidOffsetForDataOfSize(src_offset, src_len));
+  assert(src_len > 0);
+  assert(m_byte_order == eByteOrderBig || m_byte_order == eByteOrderLittle);
+
+  // Validate the destination info
+  assert(dst_void_ptr != nullptr);
+  assert(dst_len > 0);
+  assert(dst_byte_order == eByteOrderBig || dst_byte_order == eByteOrderLittle);
+
+  // Validate that only a word- or register-sized dst is byte swapped
+  assert(dst_byte_order == m_byte_order || dst_len == 1 || dst_len == 2 ||
+         dst_len == 4 || dst_len == 8 || dst_len == 10 || dst_len == 16 ||
+         dst_len == 32);
+
+  // Must have valid byte orders set in this object and for destination
+  if (!(dst_byte_order == eByteOrderBig ||
+        dst_byte_order == eByteOrderLittle) ||
+      !(m_byte_order == eByteOrderBig || m_byte_order == eByteOrderLittle))
+    return 0;
+
+  uint8_t *dst = (uint8_t *)dst_void_ptr;
+  const uint8_t *src = (const uint8_t *)PeekData(src_offset, src_len);
+  if (src) {
+    if (dst_len >= src_len) {
+      // We are copying the entire value from src into dst.
+      // Calculate how many, if any, zeroes we need for the most
+      // significant bytes if "dst_len" is greater than "src_len"...
+      const size_t num_zeroes = dst_len - src_len;
+      if (dst_byte_order == eByteOrderBig) {
+        // Big endian, so we lead with zeroes...
+        if (num_zeroes > 0)
+          ::memset(dst, 0, num_zeroes);
+        // Then either copy or swap the rest
+        if (m_byte_order == eByteOrderBig) {
+          ::memcpy(dst + num_zeroes, src, src_len);
+        } else {
+          for (uint32_t i = 0; i < src_len; ++i)
+            dst[i + num_zeroes] = src[src_len - 1 - i];
+        }
+      } else {
+        // Little endian destination, so we lead the value bytes
+        if (m_byte_order == eByteOrderBig) {
+          for (uint32_t i = 0; i < src_len; ++i)
+            dst[i] = src[src_len - 1 - i];
+        } else {
+          ::memcpy(dst, src, src_len);
+        }
+        // And zero the rest...
+        if (num_zeroes > 0)
+          ::memset(dst + src_len, 0, num_zeroes);
+      }
+      return src_len;
+    } else {
+      // We are only copying some of the value from src into dst..
+
+      if (dst_byte_order == eByteOrderBig) {
+        // Big endian dst
+        if (m_byte_order == eByteOrderBig) {
+          // Big endian dst, with big endian src
+          ::memcpy(dst, src + (src_len - dst_len), dst_len);
+        } else {
+          // Big endian dst, with little endian src
+          for (uint32_t i = 0; i < dst_len; ++i)
+            dst[i] = src[dst_len - 1 - i];
+        }
+      } else {
+        // Little endian dst
+        if (m_byte_order == eByteOrderBig) {
+          // Little endian dst, with big endian src
+          for (uint32_t i = 0; i < dst_len; ++i)
+            dst[i] = src[src_len - 1 - i];
+        } else {
+          // Little endian dst, with big endian src
+          ::memcpy(dst, src, dst_len);
+        }
+      }
+      return dst_len;
+    }
+  }
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Extracts a variable length NULL terminated C string from
+// the data at the offset pointed to by "offset_ptr".  The
+// "offset_ptr" will be updated with the offset of the byte that
+// follows the NULL terminator byte.
+//
+// If the offset pointed to by "offset_ptr" is out of bounds, or if
+// "length" is non-zero and there aren't enough available
+// bytes, nullptr will be returned and "offset_ptr" will not be
+// updated.
+//----------------------------------------------------------------------
+const char *DataExtractor::GetCStr(offset_t *offset_ptr) const {
+  const char *cstr = (const char *)PeekData(*offset_ptr, 1);
+  if (cstr) {
+    const char *cstr_end = cstr;
+    const char *end = (const char *)m_end;
+    while (cstr_end < end && *cstr_end)
+      ++cstr_end;
+
+    // Now we are either at the end of the data or we point to the
+    // NULL C string terminator with cstr_end...
+    if (*cstr_end == '\0') {
+      // Advance the offset with one extra byte for the NULL terminator
+      *offset_ptr += (cstr_end - cstr + 1);
+      return cstr;
+    }
+
+    // We reached the end of the data without finding a NULL C string
+    // terminator. Fall through and return nullptr otherwise anyone that
+    // would have used the result as a C string can wander into
+    // unknown memory...
+  }
+  return nullptr;
+}
+
+//----------------------------------------------------------------------
+// Extracts a NULL terminated C string from the fixed length field of
+// length "len" at the offset pointed to by "offset_ptr".
+// The "offset_ptr" will be updated with the offset of the byte that
+// follows the fixed length field.
+//
+// If the offset pointed to by "offset_ptr" is out of bounds, or if
+// the offset plus the length of the field is out of bounds, or if the
+// field does not contain a NULL terminator byte, nullptr will be returned
+// and "offset_ptr" will not be updated.
+//----------------------------------------------------------------------
+const char *DataExtractor::GetCStr(offset_t *offset_ptr, offset_t len) const {
+  const char *cstr = (const char *)PeekData(*offset_ptr, len);
+  if (cstr != nullptr) {
+    if (memchr(cstr, '\0', len) == nullptr) {
+      return nullptr;
+    }
+    *offset_ptr += len;
+    return cstr;
+  }
+  return nullptr;
+}
+
+//------------------------------------------------------------------
+// Peeks at a string in the contained data. No verification is done
+// to make sure the entire string lies within the bounds of this
+// object's data, only "offset" is verified to be a valid offset.
+//
+// Returns a valid C string pointer if "offset" is a valid offset in
+// this object's data, else nullptr is returned.
+//------------------------------------------------------------------
+const char *DataExtractor::PeekCStr(offset_t offset) const {
+  return (const char *)PeekData(offset, 1);
+}
+
+//----------------------------------------------------------------------
+// Extracts an unsigned LEB128 number from this object's data
+// starting at the offset pointed to by "offset_ptr". The offset
+// pointed to by "offset_ptr" will be updated with the offset of the
+// byte following the last extracted byte.
+//
+// Returned the extracted integer value.
+//----------------------------------------------------------------------
+uint64_t DataExtractor::GetULEB128(offset_t *offset_ptr) const {
+  const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1);
+  if (src == nullptr)
+    return 0;
+
+  const uint8_t *end = m_end;
+
+  if (src < end) {
+    uint64_t result = *src++;
+    if (result >= 0x80) {
+      result &= 0x7f;
+      int shift = 7;
+      while (src < end) {
+        uint8_t byte = *src++;
+        result |= (uint64_t)(byte & 0x7f) << shift;
+        if ((byte & 0x80) == 0)
+          break;
+        shift += 7;
+      }
+    }
+    *offset_ptr = src - m_start;
+    return result;
+  }
+
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Extracts an signed LEB128 number from this object's data
+// starting at the offset pointed to by "offset_ptr". The offset
+// pointed to by "offset_ptr" will be updated with the offset of the
+// byte following the last extracted byte.
+//
+// Returned the extracted integer value.
+//----------------------------------------------------------------------
+int64_t DataExtractor::GetSLEB128(offset_t *offset_ptr) const {
+  const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1);
+  if (src == nullptr)
+    return 0;
+
+  const uint8_t *end = m_end;
+
+  if (src < end) {
+    int64_t result = 0;
+    int shift = 0;
+    int size = sizeof(int64_t) * 8;
+
+    uint8_t byte = 0;
+    int bytecount = 0;
+
+    while (src < end) {
+      bytecount++;
+      byte = *src++;
+      result |= (int64_t)(byte & 0x7f) << shift;
+      shift += 7;
+      if ((byte & 0x80) == 0)
+        break;
+    }
+
+    // Sign bit of byte is 2nd high order bit (0x40)
+    if (shift < size && (byte & 0x40))
+      result |= -(1 << shift);
+
+    *offset_ptr += bytecount;
+    return result;
+  }
+  return 0;
+}
+
+//----------------------------------------------------------------------
+// Skips a ULEB128 number (signed or unsigned) from this object's
+// data starting at the offset pointed to by "offset_ptr". The
+// offset pointed to by "offset_ptr" will be updated with the offset
+// of the byte following the last extracted byte.
+//
+// Returns the number of bytes consumed during the extraction.
+//----------------------------------------------------------------------
+uint32_t DataExtractor::Skip_LEB128(offset_t *offset_ptr) const {
+  uint32_t bytes_consumed = 0;
+  const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1);
+  if (src == nullptr)
+    return 0;
+
+  const uint8_t *end = m_end;
+
+  if (src < end) {
+    const uint8_t *src_pos = src;
+    while ((src_pos < end) && (*src_pos++ & 0x80))
+      ++bytes_consumed;
+    *offset_ptr += src_pos - src;
+  }
+  return bytes_consumed;
+}
+
+//----------------------------------------------------------------------
+// Dumps bytes from this object's data to the stream "s" starting
+// "start_offset" bytes into this data, and ending with the byte
+// before "end_offset". "base_addr" will be added to the offset
+// into the dumped data when showing the offset into the data in the
+// output information. "num_per_line" objects of type "type" will
+// be dumped with the option to override the format for each object
+// with "type_format". "type_format" is a printf style formatting
+// string. If "type_format" is nullptr, then an appropriate format
+// string will be used for the supplied "type". If the stream "s"
+// is nullptr, then the output will be send to Log().
+//----------------------------------------------------------------------
+lldb::offset_t DataExtractor::PutToLog(Log *log, offset_t start_offset,
+                                       offset_t length, uint64_t base_addr,
+                                       uint32_t num_per_line,
+                                       DataExtractor::Type type,
+                                       const char *format) const {
+  if (log == nullptr)
+    return start_offset;
+
+  offset_t offset;
+  offset_t end_offset;
+  uint32_t count;
+  StreamString sstr;
+  for (offset = start_offset, end_offset = offset + length, count = 0;
+       ValidOffset(offset) && offset < end_offset; ++count) {
+    if ((count % num_per_line) == 0) {
+      // Print out any previous string
+      if (sstr.GetSize() > 0) {
+        log->PutString(sstr.GetString());
+        sstr.Clear();
+      }
+      // Reset string offset and fill the current line string with address:
+      if (base_addr != LLDB_INVALID_ADDRESS)
+        sstr.Printf("0x%8.8" PRIx64 ":",
+                    (uint64_t)(base_addr + (offset - start_offset)));
+    }
+
+    switch (type) {
+    case TypeUInt8:
+      sstr.Printf(format ? format : " %2.2x", GetU8(&offset));
+      break;
+    case TypeChar: {
+      char ch = GetU8(&offset);
+      sstr.Printf(format ? format : " %c", isprint(ch) ? ch : ' ');
+    } break;
+    case TypeUInt16:
+      sstr.Printf(format ? format : " %4.4x", GetU16(&offset));
+      break;
+    case TypeUInt32:
+      sstr.Printf(format ? format : " %8.8x", GetU32(&offset));
+      break;
+    case TypeUInt64:
+      sstr.Printf(format ? format : " %16.16" PRIx64, GetU64(&offset));
+      break;
+    case TypePointer:
+      sstr.Printf(format ? format : " 0x%" PRIx64, GetAddress(&offset));
+      break;
+    case TypeULEB128:
+      sstr.Printf(format ? format : " 0x%" PRIx64, GetULEB128(&offset));
+      break;
+    case TypeSLEB128:
+      sstr.Printf(format ? format : " %" PRId64, GetSLEB128(&offset));
+      break;
+    }
+  }
+
+  if (!sstr.Empty())
+    log->PutString(sstr.GetString());
+
+  return offset; // Return the offset at which we ended up
+}
+
+//----------------------------------------------------------------------
+// DumpUUID
+//
+// Dump out a UUID starting at 'offset' bytes into the buffer
+//----------------------------------------------------------------------
+void DataExtractor::DumpUUID(Stream *s, offset_t offset) const {
+  if (s) {
+    const uint8_t *uuid_data = PeekData(offset, 16);
+    if (uuid_data) {
+      lldb_private::UUID uuid(uuid_data, 16);
+      uuid.Dump(s);
+    } else {
+      s->Printf("<not enough data for UUID at offset 0x%8.8" PRIx64 ">",
+                offset);
+    }
+  }
+}
+
+size_t DataExtractor::Copy(DataExtractor &dest_data) const {
+  if (m_data_sp) {
+    // we can pass along the SP to the data
+    dest_data.SetData(m_data_sp);
+  } else {
+    const uint8_t *base_ptr = m_start;
+    size_t data_size = GetByteSize();
+    dest_data.SetData(DataBufferSP(new DataBufferHeap(base_ptr, data_size)));
+  }
+  return GetByteSize();
+}
+
+bool DataExtractor::Append(DataExtractor &rhs) {
+  if (rhs.GetByteOrder() != GetByteOrder())
+    return false;
+
+  if (rhs.GetByteSize() == 0)
+    return true;
+
+  if (GetByteSize() == 0)
+    return (rhs.Copy(*this) > 0);
+
+  size_t bytes = GetByteSize() + rhs.GetByteSize();
+
+  DataBufferHeap *buffer_heap_ptr = nullptr;
+  DataBufferSP buffer_sp(buffer_heap_ptr = new DataBufferHeap(bytes, 0));
+
+  if (!buffer_sp || buffer_heap_ptr == nullptr)
+    return false;
+
+  uint8_t *bytes_ptr = buffer_heap_ptr->GetBytes();
+
+  memcpy(bytes_ptr, GetDataStart(), GetByteSize());
+  memcpy(bytes_ptr + GetByteSize(), rhs.GetDataStart(), rhs.GetByteSize());
+
+  SetData(buffer_sp);
+
+  return true;
+}
+
+bool DataExtractor::Append(void *buf, offset_t length) {
+  if (buf == nullptr)
+    return false;
+
+  if (length == 0)
+    return true;
+
+  size_t bytes = GetByteSize() + length;
+
+  DataBufferHeap *buffer_heap_ptr = nullptr;
+  DataBufferSP buffer_sp(buffer_heap_ptr = new DataBufferHeap(bytes, 0));
+
+  if (!buffer_sp || buffer_heap_ptr == nullptr)
+    return false;
+
+  uint8_t *bytes_ptr = buffer_heap_ptr->GetBytes();
+
+  if (GetByteSize() > 0)
+    memcpy(bytes_ptr, GetDataStart(), GetByteSize());
+
+  memcpy(bytes_ptr + GetByteSize(), buf, length);
+
+  SetData(buffer_sp);
+
+  return true;
+}
+
+void DataExtractor::Checksum(llvm::SmallVectorImpl<uint8_t> &dest,
+                             uint64_t max_data) {
+  if (max_data == 0)
+    max_data = GetByteSize();
+  else
+    max_data = std::min(max_data, GetByteSize());
+
+  llvm::MD5 md5;
+
+  const llvm::ArrayRef<uint8_t> data(GetDataStart(), max_data);
+  md5.update(data);
+
+  llvm::MD5::MD5Result result;
+  md5.final(result);
+
+  dest.resize(16);
+  std::copy(result, result + 16, dest.begin());
+}

Modified: lldb/trunk/source/Utility/UUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/UUID.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/source/Utility/UUID.cpp (original)
+++ lldb/trunk/source/Utility/UUID.cpp Fri Mar  3 19:30:05 2017
@@ -9,6 +9,12 @@
 
 #include "lldb/Utility/UUID.h"
 
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Utility/Stream.h"
+
+#include "llvm/ADT/StringRef.h"
+
 // C Includes
 #include <ctype.h>
 #include <stdio.h>
@@ -17,12 +23,6 @@
 // C++ Includes
 #include <string>
 
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Utility/Stream.h"
-
-#include "llvm/ADT/StringRef.h"
-
 namespace lldb_private {
 
 UUID::UUID() : m_num_uuid_bytes(16) { ::memset(m_uuid, 0, sizeof(m_uuid)); }

Modified: lldb/trunk/unittests/Core/DataExtractorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/DataExtractorTest.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/unittests/Core/DataExtractorTest.cpp (original)
+++ lldb/trunk/unittests/Core/DataExtractorTest.cpp Fri Mar  3 19:30:05 2017
@@ -9,7 +9,7 @@
 
 #include "gtest/gtest.h"
 
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 
 using namespace lldb_private;
 

Modified: lldb/trunk/unittests/Core/ScalarTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/ScalarTest.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/unittests/Core/ScalarTest.cpp (original)
+++ lldb/trunk/unittests/Core/ScalarTest.cpp Fri Mar  3 19:30:05 2017
@@ -9,8 +9,8 @@
 
 #include "gtest/gtest.h"
 
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Error.h"
 #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp (original)
+++ lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp Fri Mar  3 19:30:05 2017
@@ -9,7 +9,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "Plugins/ObjectFile/ELF/ELFHeader.h"
-#include "lldb/Core/DataExtractor.h"
+#include "lldb/Utility/DataExtractor.h"
 #include "gtest/gtest.h"
 
 using namespace lldb;

Modified: lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp (original)
+++ lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp Fri Mar  3 19:30:05 2017
@@ -11,9 +11,9 @@
 #include "GDBRemoteTestUtils.h"
 
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
-#include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/StructuredData.h"
+#include "lldb/Utility/DataBuffer.h"
 
 #include "llvm/ADT/ArrayRef.h"
 

Modified: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp?rev=296943&r1=296942&r2=296943&view=diff
==============================================================================
--- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp (original)
+++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp Fri Mar  3 19:30:05 2017
@@ -19,10 +19,10 @@
 #include "gtest/gtest.h"
 
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/DataBufferLLVM.h"
-#include "lldb/Core/DataExtractor.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Utility/DataBufferLLVM.h"
+#include "lldb/Utility/DataExtractor.h"
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Optional.h"




More information about the lldb-commits mailing list