[Lldb-commits] [lldb] r125078 - in /lldb/trunk: include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Host/ include/lldb/Symbol/ lldb.xcodeproj/ source/API/ source/Commands/ source/Core/ source/Host/common/ source/Host/macosx/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/ObjectContainer/BSD-Archive/ source/Plugins/ObjectContainer/Universal-Mach-O/ source/Plugins/ObjectFile/ELF/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/Proce...

Greg Clayton gclayton at apple.com
Mon Feb 7 21:05:52 PST 2011


Author: gclayton
Date: Mon Feb  7 23:05:52 2011
New Revision: 125078

URL: http://llvm.org/viewvc/llvm-project?rev=125078&view=rev
Log:
Moved FileSpec into the Host layer since it will vary from host to host.
We have a common unix implementation in lldb/source/Host/common/FileSpec.cpp.


Added:
    lldb/trunk/include/lldb/Host/FileSpec.h
      - copied, changed from r125077, lldb/trunk/include/lldb/Core/FileSpec.h
    lldb/trunk/source/Host/common/FileSpec.cpp
      - copied, changed from r125077, lldb/trunk/source/Core/FileSpec.cpp
Removed:
    lldb/trunk/include/lldb/Core/FileSpec.h
    lldb/trunk/source/Core/FileSpec.cpp
Modified:
    lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
    lldb/trunk/include/lldb/Core/AddressResolver.h
    lldb/trunk/include/lldb/Core/FileSpecList.h
    lldb/trunk/include/lldb/Core/PluginManager.h
    lldb/trunk/include/lldb/Core/SearchFilter.h
    lldb/trunk/include/lldb/Core/SourceManager.h
    lldb/trunk/include/lldb/Host/Symbols.h
    lldb/trunk/include/lldb/Symbol/Declaration.h
    lldb/trunk/include/lldb/Symbol/LineEntry.h
    lldb/trunk/include/lldb/Symbol/ObjectContainer.h
    lldb/trunk/include/lldb/Symbol/ObjectFile.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBFileSpec.cpp
    lldb/trunk/source/API/SBHostOS.cpp
    lldb/trunk/source/API/SBTarget.cpp
    lldb/trunk/source/Commands/CommandCompletions.cpp
    lldb/trunk/source/Commands/CommandObjectImage.cpp
    lldb/trunk/source/Commands/CommandObjectLog.cpp
    lldb/trunk/source/Commands/CommandObjectSource.cpp
    lldb/trunk/source/Core/DataBufferMemoryMap.cpp
    lldb/trunk/source/Core/PluginManager.cpp
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Interpreter/CommandObject.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
    lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h Mon Feb  7 23:05:52 2011
@@ -18,7 +18,7 @@
 #include "lldb/Core/Address.h"
 #include "lldb/Breakpoint/Breakpoint.h"
 #include "lldb/Breakpoint/BreakpointResolver.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/RegularExpression.h"
 #include "lldb/Core/SearchFilter.h"
 #include "lldb/Core/ConstString.h"

Modified: lldb/trunk/include/lldb/Core/AddressResolver.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressResolver.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/AddressResolver.h (original)
+++ lldb/trunk/include/lldb/Core/AddressResolver.h Mon Feb  7 23:05:52 2011
@@ -19,7 +19,7 @@
 #include "lldb/lldb-private.h"
 #include "lldb/Core/Address.h"
 #include "lldb/Core/AddressRange.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/RegularExpression.h"
 #include "lldb/Core/SearchFilter.h"
 #include "lldb/Core/ConstString.h"

Removed: lldb/trunk/include/lldb/Core/FileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpec.h?rev=125077&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/FileSpec.h (original)
+++ lldb/trunk/include/lldb/Core/FileSpec.h (removed)
@@ -1,591 +0,0 @@
-//===-- FileSpec.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_FileSpec_h_
-#define liblldb_FileSpec_h_
-#if defined(__cplusplus)
-
-#include "lldb/lldb-private.h"
-#include "lldb/Core/ConstString.h"
-#include "lldb/Core/STLUtils.h"
-#include "lldb/Host/TimeValue.h"
-#include "lldb/Host/Config.h"
-
-namespace lldb_private {
-
-//----------------------------------------------------------------------
-/// @class FileSpec FileSpec.h "lldb/Core/FileSpec.h"
-/// @brief A file utility class.
-///
-/// A file specification class that divides paths up into a directory
-/// and basename. These string values of the paths are put into uniqued
-/// string pools for fast comparisons and efficient memory usage.
-///
-/// Another reason the paths are split into the directory and basename 
-/// is to allow efficient debugger searching. Often in a debugger the 
-/// user types in the basename of the file, for example setting a 
-/// breakpoint by file and line, or specifying a module (shared library)
-/// to limit the scope in which to execute a command. The user rarely
-/// types in a full path. When the paths are already split up, it makes
-/// it easy for us to compare only the basenames of a lot of file 
-/// specifications without having to split up the file path each time
-/// to get to the basename.
-//----------------------------------------------------------------------
-class FileSpec
-{
-public:
-    typedef enum FileType
-    {
-        eFileTypeInvalid = -1,
-        eFileTypeUnknown = 0,
-        eFileTypeDirectory,
-        eFileTypePipe,
-        eFileTypeRegular,
-        eFileTypeSocket,
-        eFileTypeSymbolicLink,
-        eFileTypeOther
-    } FileType;
-
-    FileSpec();
-
-    //------------------------------------------------------------------
-    /// Constructor with path.
-    ///
-    /// Takes a path to a file which can be just a filename, or a full
-    /// path. If \a path is not NULL or empty, this function will call
-    /// FileSpec::SetFile (const char *path, bool resolve).
-    ///
-    /// @param[in] path
-    ///     The full or partial path to a file.
-    ///
-    /// @param[in] resolve_path
-    ///     If \b true, then we resolve the path with realpath,
-    ///     if \b false we trust the path is in canonical form already.
-    ///
-    /// @see FileSpec::SetFile (const char *path, bool resolve)
-    //------------------------------------------------------------------
-    explicit FileSpec (const char *path, bool resolve_path);
-
-    //------------------------------------------------------------------
-    /// Copy constructor
-    ///
-    /// Makes a copy of the uniqued directory and filename strings from
-    /// \a rhs.
-    ///
-    /// @param[in] rhs
-    ///     A const FileSpec object reference to copy.
-    //------------------------------------------------------------------
-    FileSpec (const FileSpec& rhs);
-
-    //------------------------------------------------------------------
-    /// Copy constructor
-    ///
-    /// Makes a copy of the uniqued directory and filename strings from
-    /// \a rhs if it is not NULL.
-    ///
-    /// @param[in] rhs
-    ///     A const FileSpec object pointer to copy if non-NULL.
-    //------------------------------------------------------------------
-    FileSpec (const FileSpec* rhs);
-
-    //------------------------------------------------------------------
-    /// Destructor.
-    ///
-    /// The destructor is virtual in case this class is subclassed.
-    //------------------------------------------------------------------
-    virtual
-    ~FileSpec ();
-
-    //------------------------------------------------------------------
-    /// Assignment operator.
-    ///
-    /// Makes a copy of the uniqued directory and filename strings from
-    /// \a rhs.
-    ///
-    /// @param[in] rhs
-    ///     A const FileSpec object reference to assign to this object.
-    ///
-    /// @return
-    ///     A const reference to this object.
-    //------------------------------------------------------------------
-    const FileSpec&
-    operator= (const FileSpec& rhs);
-
-    //------------------------------------------------------------------
-    /// Equal to operator
-    ///
-    /// Tests if this object is equal to \a rhs.
-    ///
-    /// @param[in] rhs
-    ///     A const FileSpec object reference to compare this object
-    ///     to.
-    ///
-    /// @return
-    ///     \b true if this object is equal to \a rhs, \b false
-    ///     otherwise.
-    //------------------------------------------------------------------
-    bool
-    operator== (const FileSpec& rhs) const;
-
-    //------------------------------------------------------------------
-    /// Not equal to operator
-    ///
-    /// Tests if this object is not equal to \a rhs.
-    ///
-    /// @param[in] rhs
-    ///     A const FileSpec object reference to compare this object
-    ///     to.
-    ///
-    /// @return
-    ///     \b true if this object is equal to \a rhs, \b false
-    ///     otherwise.
-    //------------------------------------------------------------------
-    bool
-    operator!= (const FileSpec& rhs) const;
-
-    //------------------------------------------------------------------
-    /// Less than to operator
-    ///
-    /// Tests if this object is less than \a rhs.
-    ///
-    /// @param[in] rhs
-    ///     A const FileSpec object reference to compare this object
-    ///     to.
-    ///
-    /// @return
-    ///     \b true if this object is less than \a rhs, \b false
-    ///     otherwise.
-    //------------------------------------------------------------------
-    bool
-    operator< (const FileSpec& rhs) const;
-
-    //------------------------------------------------------------------
-    /// Convert to pointer operator.
-    ///
-    /// This allows code to check a FileSpec object to see if it
-    /// contains anything valid using code such as:
-    ///
-    /// @code
-    /// FileSpec file_spec(...);
-    /// if (file_spec)
-    /// { ...
-    /// @endcode
-    ///
-    /// @return
-    ///     A pointer to this object if either the directory or filename
-    ///     is valid, NULL otherwise.
-    //------------------------------------------------------------------
-    operator
-    void* () const;
-
-    //------------------------------------------------------------------
-    /// Logical NOT operator.
-    ///
-    /// This allows code to check a FileSpec object to see if it is
-    /// invalid using code such as:
-    ///
-    /// @code
-    /// FileSpec file_spec(...);
-    /// if (!file_spec)
-    /// { ...
-    /// @endcode
-    ///
-    /// @return
-    ///     Returns \b true if the object has an empty directory and
-    ///     filename, \b false otherwise.
-    //------------------------------------------------------------------
-    bool
-    operator! () const;
-
-    //------------------------------------------------------------------
-    /// Clears the object state.
-    ///
-    /// Clear this object by releasing both the directory and filename
-    /// string values and reverting them to empty strings.
-    //------------------------------------------------------------------
-    void
-    Clear ();
-
-    //------------------------------------------------------------------
-    /// Compare two FileSpec objects.
-    ///
-    /// If \a full is true, then both the directory and the filename
-    /// must match. If \a full is false, then the directory names for
-    /// \a lhs and \a rhs are only compared if they are both not empty.
-    /// This allows a FileSpec object to only contain a filename
-    /// and it can match FileSpec objects that have matching
-    /// filenames with different paths.
-    ///
-    /// @param[in] lhs
-    ///     A const reference to the Left Hand Side object to compare.
-    ///
-    /// @param[in] rhs
-    ///     A const reference to the Right Hand Side object to compare.
-    ///
-    /// @param[in] full
-    ///     If true, then both the directory and filenames will have to
-    ///     match for a compare to return zero (equal to). If false
-    ///     and either directory from \a lhs or \a rhs is empty, then
-    ///     only the filename will be compared, else a full comparison
-    ///     is done.
-    ///
-    /// @return
-    ///     @li -1 if \a lhs is less than \a rhs
-    ///     @li 0 if \a lhs is equal to \a rhs
-    ///     @li 1 if \a lhs is greater than \a rhs
-    //------------------------------------------------------------------
-    static int
-    Compare (const FileSpec& lhs, const FileSpec& rhs, bool full);
-
-    static bool
-    Equal (const FileSpec& a, const FileSpec& b, bool full);
-
-    //------------------------------------------------------------------
-    /// Dump this object to a Stream.
-    ///
-    /// Dump the object to the supplied stream \a s. If the object
-    /// contains a valid directory name, it will be displayed followed
-    /// by a directory delimiter, and the filename.
-    ///
-    /// @param[in] s
-    ///     The stream to which to dump the object descripton.
-    //------------------------------------------------------------------
-    void
-    Dump (Stream *s) const;
-
-    //------------------------------------------------------------------
-    /// Existence test.
-    ///
-    /// @return
-    ///     \b true if the file exists on disk, \b false otherwise.
-    //------------------------------------------------------------------
-    bool
-    Exists () const;
-
-     
-    //------------------------------------------------------------------
-    /// Expanded existence test.
-    ///
-    /// Call into the Host to see if it can help find the file (e.g. by
-    /// searching paths set in the environment, etc.).
-    ///
-    /// If found, sets the value of m_directory to the directory where 
-    /// the file was found.
-    ///
-    /// @return
-    ///     \b true if was able to find the file using expanded search 
-    ///     methods, \b false otherwise.
-    //------------------------------------------------------------------
-    bool
-    ResolveExecutableLocation ();
-    
-    //------------------------------------------------------------------
-    /// Canonicalize this file path (basically running the static 
-    /// FileSpec::Resolve method on it). Useful if you asked us not to 
-    /// resolve the file path when you set the file.
-    //------------------------------------------------------------------
-    bool
-    ResolvePath ();
-
-    uint64_t
-    GetByteSize() const;
-
-    //------------------------------------------------------------------
-    /// Directory string get accessor.
-    ///
-    /// @return
-    ///     A reference to the directory string object.
-    //------------------------------------------------------------------
-    ConstString &
-    GetDirectory ();
-
-    //------------------------------------------------------------------
-    /// Directory string const get accessor.
-    ///
-    /// @return
-    ///     A const reference to the directory string object.
-    //------------------------------------------------------------------
-    const ConstString &
-    GetDirectory () const;
-
-    //------------------------------------------------------------------
-    /// Filename string get accessor.
-    ///
-    /// @return
-    ///     A reference to the filename string object.
-    //------------------------------------------------------------------
-    ConstString &
-    GetFilename ();
-
-    //------------------------------------------------------------------
-    /// Filename string const get accessor.
-    ///
-    /// @return
-    ///     A const reference to the filename string object.
-    //------------------------------------------------------------------
-    const ConstString &
-    GetFilename () const;
-
-    TimeValue
-    GetModificationTime () const;
-
-    //------------------------------------------------------------------
-    /// Extract the full path to the file.
-    ///
-    /// Extract the directory and path into a fixed buffer. This is
-    /// needed as the directory and path are stored in separate string
-    /// values.
-    ///
-    /// @param[out] path
-    ///     The buffer in which to place the extracted full path.
-    ///
-    /// @param[in] max_path_length
-    ///     The maximum length or \a path.
-    ///
-    /// @return
-    ///     Returns the number of characters that would be needed to 
-    ///     properly copy the full path into \a path. If the returned
-    ///     number is less than \a max_path_length, then the path is
-    ///     properly copied and terminated. If the return value is 
-    ///     >= \a max_path_length, then the path was truncated (but is
-    ///     still NULL terminated).
-    //------------------------------------------------------------------
-    size_t
-    GetPath (char *path, size_t max_path_length) const;
-
-    FileType
-    GetFileType () const;
-
-    //------------------------------------------------------------------
-    /// Get the memory cost of this object.
-    ///
-    /// Return the size in bytes that this object takes in memory. This
-    /// returns the size in bytes of this object, not any shared string
-    /// values it may refer to.
-    ///
-    /// @return
-    ///     The number of bytes that this object occupies in memory.
-    ///
-    /// @see ConstString::StaticMemorySize ()
-    //------------------------------------------------------------------
-    size_t
-    MemorySize () const;
-
-    //------------------------------------------------------------------
-    /// Memory map part of, or the entire contents of, a file.
-    ///
-    /// Returns a shared pointer to a data buffer that contains all or
-    /// part of the contents of a file. The data is memory mapped and
-    /// will lazily page in data from the file as memory is accessed.
-    /// The data that is mappped will start \a offset bytes into the
-    /// file, and \a length bytes will be mapped. If \a length is
-    /// greater than the number of bytes available in the file starting
-    /// at \a offset, the number of bytes will be appropriately
-    /// truncated. The final number of bytes that get mapped can be
-    /// verified using the DataBuffer::GetByteSize() function on the return
-    /// shared data pointer object contents.
-    ///
-    /// @param[in] offset
-    ///     The offset in bytes from the beginning of the file where
-    ///     memory mapping should begin.
-    ///
-    /// @param[in] length
-    ///     The size in bytes that should be mapped starting \a offset
-    ///     bytes into the file. If \a length is \c SIZE_MAX, map
-    ///     as many bytes as possible.
-    ///
-    /// @return
-    ///     A shared pointer to the memeory mapped data. This shared
-    ///     pointer can contain a NULL DataBuffer pointer, so the contained
-    ///     pointer must be checked prior to using it.
-    //------------------------------------------------------------------
-    lldb::DataBufferSP
-    MemoryMapFileContents (off_t offset = 0, size_t length = SIZE_MAX) const;
-
-    //------------------------------------------------------------------
-    /// Read part of, or the entire contents of, a file into a heap based data buffer.
-    ///
-    /// Returns a shared pointer to a data buffer that contains all or
-    /// part of the contents of a file. The data copies into a heap based
-    /// buffer that lives in the DataBuffer shared pointer object returned.
-    /// The data that is cached will start \a offset bytes into the
-    /// file, and \a length bytes will be mapped. If \a length is
-    /// greater than the number of bytes available in the file starting
-    /// at \a offset, the number of bytes will be appropriately
-    /// truncated. The final number of bytes that get mapped can be
-    /// verified using the DataBuffer::GetByteSize() function.
-    ///
-    /// @param[in] offset
-    ///     The offset in bytes from the beginning of the file where
-    ///     memory mapping should begin.
-    ///
-    /// @param[in] length
-    ///     The size in bytes that should be mapped starting \a offset
-    ///     bytes into the file. If \a length is \c SIZE_MAX, map
-    ///     as many bytes as possible.
-    ///
-    /// @return
-    ///     A shared pointer to the memeory mapped data. This shared
-    ///     pointer can contain a NULL DataBuffer pointer, so the contained
-    ///     pointer must be checked prior to using it.
-    //------------------------------------------------------------------
-    lldb::DataBufferSP
-    ReadFileContents (off_t offset = 0, size_t length = SIZE_MAX) const;
-
-    size_t
-    ReadFileContents (off_t file_offset, void *dst, size_t dst_len) const;
-
-    //------------------------------------------------------------------
-    /// Change the file specificed with a new path.
-    ///
-    /// Update the contents of this object with a new path. The path will
-    /// be split up into a directory and filename and stored as uniqued
-    /// string values for quick comparison and efficient memory usage.
-    ///
-    /// @param[in] path
-    ///     A full, partial, or relative path to a file.
-    ///
-    /// @param[in] resolve_path
-    ///     If \b true, then we will try to resolve links the path using
-    ///     the static FileSpec::Resolve.
-    //------------------------------------------------------------------
-    void
-    SetFile (const char *path, bool resolve_path);
-
-    bool
-    IsResolved () const
-    {
-        return m_is_resolved;
-    }
-
-    //------------------------------------------------------------------
-    /// Set if the file path has been resolved or not.
-    ///
-    /// If you know a file path is already resolved and avoided passing
-    /// a \b true parameter for any functions that take a "bool 
-    /// resolve_path" parameter, you can set the value manually using
-    /// this call to make sure we don't try and resolve it later, or try
-    /// and resolve a path that has already been resolved.
-    ///
-    /// @param[in] is_resolved
-    ///     A boolean value that will replace the current value that
-    ///     indicates if the paths in this object have been resolved.
-    //------------------------------------------------------------------
-    void
-    SetIsResolved (bool is_resolved)
-    {
-        m_is_resolved = is_resolved;
-    }
-    //------------------------------------------------------------------
-    /// Read the file into an array of strings, one per line.
-    ///
-    /// Opens and reads the file in this object into an array of strings,
-    /// one string per line of the file. Returns a boolean indicating
-    /// success or failure.
-    ///
-    /// @param[out] lines
-    ///     The string array into which to read the file.
-    ///
-    /// @result
-    ///     Returns the number of lines that were read from the file.
-    //------------------------------------------------------------------
-    size_t
-    ReadFileLines (STLStringArray &lines);
-
-    //------------------------------------------------------------------
-    /// Resolves user name and links in \a src_path, and writes the output
-    /// to \a dst_path.  Note if the path pointed to by \a src_path does not
-    /// exist, the contents of \a src_path will be copied to \a dst_path 
-    /// unchanged.
-    ///
-    /// @param[in] src_path
-    ///     Input path to be resolved.
-    ///
-    /// @param[in] dst_path
-    ///     Buffer to store the resolved path.
-    ///
-    /// @param[in] dst_len 
-    ///     Size of the buffer pointed to by dst_path.
-    ///
-    /// @result 
-    ///     The number of characters required to write the resolved path.  If the
-    ///     resolved path doesn't fit in dst_len, dst_len-1 characters will
-    ///     be written to \a dst_path, but the actual required length will still be returned.
-    //------------------------------------------------------------------
-    static size_t
-    Resolve (const char *src_path, char *dst_path, size_t dst_len);
-
-#ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
-
-
-    //------------------------------------------------------------------
-    /// Resolves the user name at the beginning of \a src_path, and writes the output
-    /// to \a dst_path.  Note, \a src_path can contain other path components after the
-    /// user name, they will be copied over, and if the path doesn't start with "~" it
-    /// will also be copied over to \a dst_path.
-    ///
-    /// @param[in] src_path
-    ///     Input path to be resolved.
-    ///
-    /// @param[in] dst_path
-    ///     Buffer to store the resolved path.
-    ///
-    /// @param[in] dst_len 
-    ///     Size of the buffer pointed to by dst_path.
-    ///
-    /// @result 
-    ///     The number of characters required to write the resolved path, or 0 if
-    ///     the user name could not be found.  If the
-    ///     resolved path doesn't fit in dst_len, dst_len-1 characters will
-    ///     be written to \a dst_path, but the actual required length will still be returned.
-    //------------------------------------------------------------------
-    static size_t
-    ResolveUsername (const char *src_path, char *dst_path, size_t dst_len);
-
-#endif
-
-    enum EnumerateDirectoryResult
-    {
-        eEnumerateDirectoryResultNext,  // Enumerate next entry in the current directory
-        eEnumerateDirectoryResultEnter, // Recurse into the current entry if it is a directory or symlink, or next if not
-        eEnumerateDirectoryResultExit,  // Exit from the current directory at the current level.
-        eEnumerateDirectoryResultQuit   // Stop directory enumerations at any level
-    };
-
-    typedef EnumerateDirectoryResult (*EnumerateDirectoryCallbackType) (void *baton,
-                                                                        FileType file_type,
-                                                                        const FileSpec &spec
-);
-
-    static EnumerateDirectoryResult
-    EnumerateDirectory (const char *dir_path,
-                        bool find_directories,
-                        bool find_files,
-                        bool find_other,
-                        EnumerateDirectoryCallbackType callback,
-                        void *callback_baton);
-
-protected:
-    //------------------------------------------------------------------
-    // Member variables
-    //------------------------------------------------------------------
-    ConstString m_directory;    ///< The uniqued directory path
-    ConstString m_filename;     ///< The uniqued filename path
-    mutable bool m_is_resolved; ///< True if this path has been resolved.
-};
-
-//----------------------------------------------------------------------
-/// Dump a FileSpec object to a stream
-//----------------------------------------------------------------------
-Stream& operator << (Stream& s, const FileSpec& f);
-
-} // namespace lldb_private
-
-#endif  // #if defined(__cplusplus)
-#endif  // liblldb_FileSpec_h_

Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
+++ lldb/trunk/include/lldb/Core/FileSpecList.h Mon Feb  7 23:05:52 2011
@@ -12,7 +12,7 @@
 #if defined(__cplusplus)
 
 #include "lldb/lldb-private.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include <vector>
 
 namespace lldb_private {

Modified: lldb/trunk/include/lldb/Core/PluginManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)
+++ lldb/trunk/include/lldb/Core/PluginManager.h Mon Feb  7 23:05:52 2011
@@ -12,7 +12,7 @@
 #define liblldb_PluginManager_h_
 
 #include "lldb/lldb-private.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Core/SearchFilter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/SearchFilter.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/SearchFilter.h (original)
+++ lldb/trunk/include/lldb/Core/SearchFilter.h Mon Feb  7 23:05:52 2011
@@ -16,7 +16,7 @@
 // Project includes
 #include "lldb/lldb-private.h"
 #include "lldb/Core/Stream.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Address.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Core/Module.h"

Modified: lldb/trunk/include/lldb/Core/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/SourceManager.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/SourceManager.h (original)
+++ lldb/trunk/include/lldb/Core/SourceManager.h Mon Feb  7 23:05:52 2011
@@ -18,7 +18,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/lldb-private.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 
 namespace lldb_private {
 

Copied: lldb/trunk/include/lldb/Host/FileSpec.h (from r125077, lldb/trunk/include/lldb/Core/FileSpec.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?p2=lldb/trunk/include/lldb/Host/FileSpec.h&p1=lldb/trunk/include/lldb/Core/FileSpec.h&r1=125077&r2=125078&rev=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FileSpec.h (original)
+++ lldb/trunk/include/lldb/Host/FileSpec.h Mon Feb  7 23:05:52 2011
@@ -20,7 +20,7 @@
 namespace lldb_private {
 
 //----------------------------------------------------------------------
-/// @class FileSpec FileSpec.h "lldb/Core/FileSpec.h"
+/// @class FileSpec FileSpec.h "lldb/Host/FileSpec.h"
 /// @brief A file utility class.
 ///
 /// A file specification class that divides paths up into a directory

Modified: lldb/trunk/include/lldb/Host/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Symbols.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/Symbols.h (original)
+++ lldb/trunk/include/lldb/Host/Symbols.h Mon Feb  7 23:05:52 2011
@@ -17,7 +17,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Symbol/Declaration.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Declaration.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Declaration.h (original)
+++ lldb/trunk/include/lldb/Symbol/Declaration.h Mon Feb  7 23:05:52 2011
@@ -11,7 +11,7 @@
 #define liblldb_Declaration_h_
 
 #include "lldb/lldb-private.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Symbol/LineEntry.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/LineEntry.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/LineEntry.h (original)
+++ lldb/trunk/include/lldb/Symbol/LineEntry.h Mon Feb  7 23:05:52 2011
@@ -12,7 +12,7 @@
 
 #include "lldb/lldb-private.h"
 #include "lldb/Core/AddressRange.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.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=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectContainer.h (original)
+++ lldb/trunk/include/lldb/Symbol/ObjectContainer.h Mon Feb  7 23:05:52 2011
@@ -17,7 +17,7 @@
 
 #include "lldb/lldb-private.h"
 #include "lldb/Core/DataExtractor.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Host/Endian.h"

Modified: lldb/trunk/include/lldb/Symbol/ObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ObjectFile.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h Mon Feb  7 23:05:52 2011
@@ -12,7 +12,7 @@
 
 #include "lldb/lldb-private.h"
 #include "lldb/Core/DataExtractor.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Host/Endian.h"

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Feb  7 23:05:52 2011
@@ -124,7 +124,6 @@
 		26D5B09C11B07550009A862E /* DynamicLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */; };
 		26D5B09D11B07550009A862E /* Error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7810F1B85900F91463 /* Error.cpp */; };
 		26D5B09E11B07550009A862E /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7910F1B85900F91463 /* Event.cpp */; };
-		26D5B09F11B07550009A862E /* FileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7A10F1B85900F91463 /* FileSpec.cpp */; };
 		26D5B0A011B07550009A862E /* FileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */; };
 		26D5B0A211B07550009A862E /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7D10F1B85900F91463 /* Language.cpp */; };
 		26D5B0A311B07550009A862E /* Listener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7E10F1B85900F91463 /* Listener.cpp */; };
@@ -321,6 +320,8 @@
 		26F5C32D10F3DFDD009D5894 /* libtermcap.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */; };
 		26F5C37510F3F61B009D5894 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C37410F3F61B009D5894 /* libobjc.dylib */; };
 		26F5C39110F3FA26009D5894 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; };
+		26FA4316130103F400E71120 /* FileSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FA4315130103F400E71120 /* FileSpec.h */; };
+		26FA43181301048600E71120 /* FileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FA43171301048600E71120 /* FileSpec.cpp */; };
 		4906FD4212F2255300A2A77C /* ASTDumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4906FD4012F2255300A2A77C /* ASTDumper.cpp */; };
 		491193521226386000578B7F /* ASTStructExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 491193501226386000578B7F /* ASTStructExtractor.cpp */; };
 		49307AAE11DEA4D90081F992 /* IRForTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */; };
@@ -687,7 +688,6 @@
 		26BC7D5F10F1B77400F91463 /* dwarf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf.h; path = include/lldb/Core/dwarf.h; sourceTree = "<group>"; };
 		26BC7D6010F1B77400F91463 /* Error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Error.h; path = include/lldb/Core/Error.h; sourceTree = "<group>"; };
 		26BC7D6110F1B77400F91463 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = include/lldb/Core/Event.h; sourceTree = "<group>"; };
-		26BC7D6210F1B77400F91463 /* FileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpec.h; path = include/lldb/Core/FileSpec.h; sourceTree = "<group>"; };
 		26BC7D6310F1B77400F91463 /* FileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpecList.h; path = include/lldb/Core/FileSpecList.h; sourceTree = "<group>"; };
 		26BC7D6410F1B77400F91463 /* Flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Flags.h; path = include/lldb/Core/Flags.h; sourceTree = "<group>"; };
 		26BC7D6510F1B77400F91463 /* IOStreamMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOStreamMacros.h; path = include/lldb/Core/IOStreamMacros.h; sourceTree = "<group>"; };
@@ -792,7 +792,6 @@
 		26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicLoader.cpp; path = source/Core/DynamicLoader.cpp; sourceTree = "<group>"; };
 		26BC7E7810F1B85900F91463 /* Error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Error.cpp; path = source/Core/Error.cpp; sourceTree = "<group>"; };
 		26BC7E7910F1B85900F91463 /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Event.cpp; path = source/Core/Event.cpp; sourceTree = "<group>"; };
-		26BC7E7A10F1B85900F91463 /* FileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpec.cpp; path = source/Core/FileSpec.cpp; sourceTree = "<group>"; };
 		26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpecList.cpp; path = source/Core/FileSpecList.cpp; sourceTree = "<group>"; };
 		26BC7E7D10F1B85900F91463 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Language.cpp; path = source/Core/Language.cpp; sourceTree = "<group>"; };
 		26BC7E7E10F1B85900F91463 /* Listener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Listener.cpp; path = source/Core/Listener.cpp; sourceTree = "<group>"; };
@@ -930,6 +929,8 @@
 		26F5C39010F3FA26009D5894 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
 		26F996A7119B79C300412154 /* ARM_DWARF_Registers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM_DWARF_Registers.h; path = source/Utility/ARM_DWARF_Registers.h; sourceTree = "<group>"; };
 		26F996A8119B79C300412154 /* ARM_GCC_Registers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM_GCC_Registers.h; path = source/Utility/ARM_GCC_Registers.h; sourceTree = "<group>"; };
+		26FA4315130103F400E71120 /* FileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpec.h; path = include/lldb/Host/FileSpec.h; sourceTree = "<group>"; };
+		26FA43171301048600E71120 /* FileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSpec.cpp; sourceTree = "<group>"; };
 		26FE25221146CADE00F4085A /* GDBRemoteCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GDBRemoteCommunication.cpp; path = "source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp"; sourceTree = "<group>"; };
 		26FE25231146CADE00F4085A /* GDBRemoteCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDBRemoteCommunication.h; path = "source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h"; sourceTree = "<group>"; };
 		4906FD4012F2255300A2A77C /* ASTDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTDumper.cpp; path = source/Expression/ASTDumper.cpp; sourceTree = "<group>"; };
@@ -1694,8 +1695,6 @@
 				26BC7E7810F1B85900F91463 /* Error.cpp */,
 				26BC7D6110F1B77400F91463 /* Event.h */,
 				26BC7E7910F1B85900F91463 /* Event.cpp */,
-				26BC7D6210F1B77400F91463 /* FileSpec.h */,
-				26BC7E7A10F1B85900F91463 /* FileSpec.cpp */,
 				26BC7D6310F1B77400F91463 /* FileSpecList.h */,
 				26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */,
 				26BC7D6410F1B77400F91463 /* Flags.h */,
@@ -1973,6 +1972,7 @@
 				26BC7DD210F1B7D500F91463 /* Condition.h */,
 				266F5CBB12FC846200DFCE33 /* Config.h */,
 				26BC7DD310F1B7D500F91463 /* Endian.h */,
+				26FA4315130103F400E71120 /* FileSpec.h */,
 				26BC7DD410F1B7D500F91463 /* Host.h */,
 				26BC7DD510F1B7D500F91463 /* Mutex.h */,
 				26BC7DD610F1B7D500F91463 /* Predicate.h */,
@@ -2273,6 +2273,7 @@
 		69A01E1A1236C5D400C660B5 /* common */ = {
 			isa = PBXGroup;
 			children = (
+				26FA43171301048600E71120 /* FileSpec.cpp */,
 				69A01E1B1236C5D400C660B5 /* Condition.cpp */,
 				69A01E1C1236C5D400C660B5 /* Host.cpp */,
 				69A01E1E1236C5D400C660B5 /* Mutex.cpp */,
@@ -2347,6 +2348,7 @@
 				26D9FDCF12F7853F0003F2EE /* EmulateInstructionARM.h in Headers */,
 				266F5CBC12FC846200DFCE33 /* Config.h in Headers */,
 				268DA872130095D000C9483A /* Terminal.h in Headers */,
+				26FA4316130103F400E71120 /* FileSpec.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2592,7 +2594,6 @@
 				26D5B09C11B07550009A862E /* DynamicLoader.cpp in Sources */,
 				26D5B09D11B07550009A862E /* Error.cpp in Sources */,
 				26D5B09E11B07550009A862E /* Event.cpp in Sources */,
-				26D5B09F11B07550009A862E /* FileSpec.cpp in Sources */,
 				26D5B0A011B07550009A862E /* FileSpecList.cpp in Sources */,
 				26D5B0A211B07550009A862E /* Language.cpp in Sources */,
 				26D5B0A311B07550009A862E /* Listener.cpp in Sources */,
@@ -2852,6 +2853,7 @@
 				26B8B42512EEC52A00A831B2 /* UniqueDWARFASTType.cpp in Sources */,
 				4906FD4212F2255300A2A77C /* ASTDumper.cpp in Sources */,
 				268DA874130095ED00C9483A /* Terminal.cpp in Sources */,
+				26FA43181301048600E71120 /* FileSpec.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Mon Feb  7 23:05:52 2011
@@ -9,7 +9,7 @@
 
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBStream.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 
 using namespace lldb;

Modified: lldb/trunk/source/API/SBHostOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBHostOS.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/API/SBHostOS.cpp (original)
+++ lldb/trunk/source/API/SBHostOS.cpp Mon Feb  7 23:05:52 2011
@@ -9,7 +9,7 @@
 
 #include "lldb/API/SBHostOS.h"
 #include "lldb/API/SBError.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Host/Host.h"
 

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Mon Feb  7 23:05:52 2011
@@ -25,7 +25,7 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Disassembler.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/RegularExpression.h"
 #include "lldb/Core/SearchFilter.h"

Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Mon Feb  7 23:05:52 2011
@@ -18,7 +18,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/CommandCompletions.h"

Modified: lldb/trunk/source/Commands/CommandObjectImage.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectImage.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectImage.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectImage.cpp Mon Feb  7 23:05:52 2011
@@ -14,7 +14,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Core/Debugger.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/RegularExpression.h"
 #include "lldb/Core/Stream.h"

Modified: lldb/trunk/source/Commands/CommandObjectLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLog.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectLog.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectLog.cpp Mon Feb  7 23:05:52 2011
@@ -17,7 +17,7 @@
 
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Debugger.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Interpreter/Options.h"

Modified: lldb/trunk/source/Commands/CommandObjectSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSource.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSource.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSource.cpp Mon Feb  7 23:05:52 2011
@@ -17,7 +17,7 @@
 #include "lldb/Core/Debugger.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Target/TargetList.h"

Modified: lldb/trunk/source/Core/DataBufferMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferMemoryMap.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataBufferMemoryMap.cpp (original)
+++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp Mon Feb  7 23:05:52 2011
@@ -15,7 +15,7 @@
 
 #include "lldb/Core/DataBufferMemoryMap.h"
 #include "lldb/Core/Error.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Host.h"
 
 using namespace lldb_private;

Removed: lldb/trunk/source/Core/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpec.cpp?rev=125077&view=auto
==============================================================================
--- lldb/trunk/source/Core/FileSpec.cpp (original)
+++ lldb/trunk/source/Core/FileSpec.cpp (removed)
@@ -1,918 +0,0 @@
-//===-- FileSpec.cpp --------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <libgen.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <fstream>
-
-#include "lldb/Host/Config.h" // Have to include this before we test the define...
-#ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
-#include <pwd.h>
-#endif
-
-#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Path.h"
-#include "llvm/Support/Program.h"
-
-#include "lldb/Core/FileSpec.h"
-#include "lldb/Core/DataBufferHeap.h"
-#include "lldb/Core/DataBufferMemoryMap.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Host/Host.h"
-#include "lldb/Utility/CleanUp.h"
-
-using namespace lldb;
-using namespace lldb_private;
-using namespace std;
-
-static bool
-GetFileStats (const FileSpec *file_spec, struct stat *stats_ptr)
-{
-    char resolved_path[PATH_MAX];
-    if (file_spec->GetPath(&resolved_path[0], sizeof(resolved_path)))
-        return ::stat (resolved_path, stats_ptr) == 0;
-    return false;
-}
-
-#ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
-
-static const char*
-GetCachedGlobTildeSlash()
-{
-    static std::string g_tilde;
-    if (g_tilde.empty())
-    {
-        struct passwd *user_entry;
-        user_entry = getpwuid(geteuid());
-        if (user_entry != NULL)
-            g_tilde = user_entry->pw_dir;
-
-        if (g_tilde.empty())
-            return NULL;
-    }
-    return g_tilde.c_str();
-}
-
-// Resolves the username part of a path of the form ~user/other/directories, and
-// writes the result into dst_path.
-// Returns 0 if there WAS a ~ in the path but the username couldn't be resolved.
-// Otherwise returns the number of characters copied into dst_path.  If the return
-// is >= dst_len, then the resolved path is too long...
-size_t
-FileSpec::ResolveUsername (const char *src_path, char *dst_path, size_t dst_len)
-{
-    char user_home[PATH_MAX];
-    const char *user_name;
-    
-    if (src_path == NULL || src_path[0] == '\0')
-        return 0;
-    
-    // If there's no ~, then just copy src_path straight to dst_path (they may be the same string...)
-    if (src_path[0] != '~')
-    {
-        size_t len = strlen (src_path);
-        if (len >= dst_len)
-        {
-            ::bcopy (src_path, dst_path, dst_len - 1);
-            dst_path[dst_len] = '\0';
-        }
-        else
-            ::bcopy (src_path, dst_path, len + 1);
-        
-        return len;
-    }
-    
-    const char *first_slash = ::strchr (src_path, '/');
-    char remainder[PATH_MAX];
-    
-    if (first_slash == NULL)
-    {
-        // The whole name is the username (minus the ~):
-        user_name = src_path + 1;
-        remainder[0] = '\0';
-    }
-    else
-    {
-        int user_name_len = first_slash - src_path - 1;
-        ::memcpy (user_home, src_path + 1, user_name_len);
-        user_home[user_name_len] = '\0';
-        user_name = user_home;
-        
-        ::strcpy (remainder, first_slash);
-    }
-    
-    if (user_name == NULL)
-        return 0;
-    // User name of "" means the current user...
-    
-    struct passwd *user_entry;
-    const char *home_dir = NULL;
-    
-    if (user_name[0] == '\0')
-    {
-        home_dir = GetCachedGlobTildeSlash();
-    }
-    else
-    {
-        user_entry = ::getpwnam (user_name);
-        if (user_entry != NULL)
-            home_dir = user_entry->pw_dir;
-    }
-    
-    if (home_dir == NULL)
-        return 0;
-    else 
-        return ::snprintf (dst_path, dst_len, "%s%s", home_dir, remainder);
-}
-#endif // #ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
-
-size_t
-FileSpec::Resolve (const char *src_path, char *dst_path, size_t dst_len)
-{
-    if (src_path == NULL || src_path[0] == '\0')
-        return 0;
-
-    // Glob if needed for ~/, otherwise copy in case src_path is same as dst_path...
-    char unglobbed_path[PATH_MAX];
-#ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
-    if (src_path[0] == '~')
-    {
-        size_t return_count = ResolveUsername(src_path, unglobbed_path, sizeof(unglobbed_path));
-        
-        // If we couldn't find the user referred to, or the resultant path was too long,
-        // then just copy over the src_path.
-        if (return_count == 0 || return_count >= sizeof(unglobbed_path)) 
-            ::snprintf (unglobbed_path, sizeof(unglobbed_path), "%s", src_path);
-    }
-    else
-#endif // #ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
-    {
-    	::snprintf(unglobbed_path, sizeof(unglobbed_path), "%s", src_path);
-    }
-
-    // Now resolve the path if needed
-    char resolved_path[PATH_MAX];
-    if (::realpath (unglobbed_path, resolved_path))
-    {
-        // Success, copy the resolved path
-        return ::snprintf(dst_path, dst_len, "%s", resolved_path);
-    }
-    else
-    {
-        // Failed, just copy the unglobbed path
-        return ::snprintf(dst_path, dst_len, "%s", unglobbed_path);
-    }
-}
-
-FileSpec::FileSpec() :
-    m_directory(),
-    m_filename()
-{
-}
-
-//------------------------------------------------------------------
-// Default constructor that can take an optional full path to a
-// file on disk.
-//------------------------------------------------------------------
-FileSpec::FileSpec(const char *pathname, bool resolve_path) :
-    m_directory(),
-    m_filename(),
-    m_is_resolved(false)
-{
-    if (pathname && pathname[0])
-        SetFile(pathname, resolve_path);
-}
-
-//------------------------------------------------------------------
-// Copy constructor
-//------------------------------------------------------------------
-FileSpec::FileSpec(const FileSpec& rhs) :
-    m_directory (rhs.m_directory),
-    m_filename (rhs.m_filename),
-    m_is_resolved (rhs.m_is_resolved)
-{
-}
-
-//------------------------------------------------------------------
-// Copy constructor
-//------------------------------------------------------------------
-FileSpec::FileSpec(const FileSpec* rhs) :
-    m_directory(),
-    m_filename()
-{
-    if (rhs)
-        *this = *rhs;
-}
-
-//------------------------------------------------------------------
-// Virtual destrcuctor in case anyone inherits from this class.
-//------------------------------------------------------------------
-FileSpec::~FileSpec()
-{
-}
-
-//------------------------------------------------------------------
-// Assignment operator.
-//------------------------------------------------------------------
-const FileSpec&
-FileSpec::operator= (const FileSpec& rhs)
-{
-    if (this != &rhs)
-    {
-        m_directory = rhs.m_directory;
-        m_filename = rhs.m_filename;
-        m_is_resolved = rhs.m_is_resolved;
-    }
-    return *this;
-}
-
-//------------------------------------------------------------------
-// Update the contents of this object with a new path. The path will
-// be split up into a directory and filename and stored as uniqued
-// string values for quick comparison and efficient memory usage.
-//------------------------------------------------------------------
-void
-FileSpec::SetFile (const char *pathname, bool resolve)
-{
-    m_filename.Clear();
-    m_directory.Clear();
-    m_is_resolved = false;
-    if (pathname == NULL || pathname[0] == '\0')
-        return;
-
-    char resolved_path[PATH_MAX];
-    bool path_fit = true;
-    
-    if (resolve)
-    {
-        path_fit = (FileSpec::Resolve (pathname, resolved_path, sizeof(resolved_path)) < sizeof(resolved_path) - 1);
-        m_is_resolved = path_fit;
-    }
-    else
-    {
-        // Copy the path because "basename" and "dirname" want to muck with the
-        // path buffer
-        if (::strlen (pathname) > sizeof(resolved_path) - 1)
-            path_fit = false;
-        else
-            ::strcpy (resolved_path, pathname);
-    }
-
-    
-    if (path_fit)
-    {
-        char *filename = ::basename (resolved_path);
-        if (filename)
-        {
-            m_filename.SetCString (filename);
-            // Truncate the basename off the end of the resolved path
-
-            // Only attempt to get the dirname if it looks like we have a path
-            if (strchr(resolved_path, '/'))
-            {
-                char *directory = ::dirname (resolved_path);
-
-                // Make sure we didn't get our directory resolved to "." without having
-                // specified
-                if (directory)
-                    m_directory.SetCString(directory);
-                else
-                {
-                    char *last_resolved_path_slash = strrchr(resolved_path, '/');
-                    if (last_resolved_path_slash)
-                    {
-                        *last_resolved_path_slash = '\0';
-                        m_directory.SetCString(resolved_path);
-                    }
-                }
-            }
-        }
-        else
-            m_directory.SetCString(resolved_path);
-    }
-}
-
-//----------------------------------------------------------------------
-// Convert to pointer operator. This allows code to check any FileSpec
-// objects to see if they contain anything valid using code such as:
-//
-//  if (file_spec)
-//  {}
-//----------------------------------------------------------------------
-FileSpec::operator
-void*() const
-{
-    return (m_directory || m_filename) ? const_cast<FileSpec*>(this) : NULL;
-}
-
-//----------------------------------------------------------------------
-// Logical NOT operator. This allows code to check any FileSpec
-// objects to see if they are invalid using code such as:
-//
-//  if (!file_spec)
-//  {}
-//----------------------------------------------------------------------
-bool
-FileSpec::operator!() const
-{
-    return !m_directory && !m_filename;
-}
-
-//------------------------------------------------------------------
-// Equal to operator
-//------------------------------------------------------------------
-bool
-FileSpec::operator== (const FileSpec& rhs) const
-{
-    if (m_filename == rhs.m_filename)
-    {
-        if (m_directory == rhs.m_directory)
-            return true;
-        
-        // TODO: determine if we want to keep this code in here.
-        // The code below was added to handle a case where we were
-        // trying to set a file and line breakpoint and one path
-        // was resolved, and the other not and the directory was
-        // in a mount point that resolved to a more complete path:
-        // "/tmp/a.c" == "/private/tmp/a.c". I might end up pulling
-        // this out...
-        if (IsResolved() && rhs.IsResolved())
-        {
-            // Both paths are resolved, no need to look further...
-            return false;
-        }
-        
-        FileSpec resolved_lhs(*this);
-
-        // If "this" isn't resolved, resolve it
-        if (!IsResolved())
-        {
-            if (resolved_lhs.ResolvePath())
-            {
-                // This path wasn't resolved but now it is. Check if the resolved
-                // directory is the same as our unresolved directory, and if so, 
-                // we can mark this object as resolved to avoid more future resolves
-                m_is_resolved = (m_directory == resolved_lhs.m_directory);
-            }
-            else
-                return false;
-        }
-        
-        FileSpec resolved_rhs(rhs);
-        if (!rhs.IsResolved())
-        {
-            if (resolved_rhs.ResolvePath())
-            {
-                // rhs's path wasn't resolved but now it is. Check if the resolved
-                // directory is the same as rhs's unresolved directory, and if so, 
-                // we can mark this object as resolved to avoid more future resolves
-                rhs.m_is_resolved = (m_directory == resolved_rhs.m_directory);
-            }
-            else
-                return false;
-        }
-
-        // If we reach this point in the code we were able to resolve both paths
-        // and since we only resolve the paths if the basenames are equal, then
-        // we can just check if both directories are equal...
-        return resolved_lhs.GetDirectory() == resolved_rhs.GetDirectory();
-    }
-    return false;
-}
-
-//------------------------------------------------------------------
-// Not equal to operator
-//------------------------------------------------------------------
-bool
-FileSpec::operator!= (const FileSpec& rhs) const
-{
-    return !(*this == rhs);
-}
-
-//------------------------------------------------------------------
-// Less than operator
-//------------------------------------------------------------------
-bool
-FileSpec::operator< (const FileSpec& rhs) const
-{
-    return FileSpec::Compare(*this, rhs, true) < 0;
-}
-
-//------------------------------------------------------------------
-// Dump a FileSpec object to a stream
-//------------------------------------------------------------------
-Stream&
-lldb_private::operator << (Stream &s, const FileSpec& f)
-{
-    f.Dump(&s);
-    return s;
-}
-
-//------------------------------------------------------------------
-// Clear this object by releasing both the directory and filename
-// string values and making them both the empty string.
-//------------------------------------------------------------------
-void
-FileSpec::Clear()
-{
-    m_directory.Clear();
-    m_filename.Clear();
-}
-
-//------------------------------------------------------------------
-// Compare two FileSpec objects. If "full" is true, then both
-// the directory and the filename must match. If "full" is false,
-// then the directory names for "a" and "b" are only compared if
-// they are both non-empty. This allows a FileSpec object to only
-// contain a filename and it can match FileSpec objects that have
-// matching filenames with different paths.
-//
-// Return -1 if the "a" is less than "b", 0 if "a" is equal to "b"
-// and "1" if "a" is greater than "b".
-//------------------------------------------------------------------
-int
-FileSpec::Compare(const FileSpec& a, const FileSpec& b, bool full)
-{
-    int result = 0;
-
-    // If full is true, then we must compare both the directory and filename.
-
-    // If full is false, then if either directory is empty, then we match on
-    // the basename only, and if both directories have valid values, we still
-    // do a full compare. This allows for matching when we just have a filename
-    // in one of the FileSpec objects.
-
-    if (full || (a.m_directory && b.m_directory))
-    {
-        result = ConstString::Compare(a.m_directory, b.m_directory);
-        if (result)
-            return result;
-    }
-    return ConstString::Compare (a.m_filename, b.m_filename);
-}
-
-bool
-FileSpec::Equal (const FileSpec& a, const FileSpec& b, bool full)
-{
-    if (full)
-        return a == b;
-    else
-        return a.m_filename == b.m_filename;
-}
-
-
-
-//------------------------------------------------------------------
-// Dump the object to the supplied stream. If the object contains
-// a valid directory name, it will be displayed followed by a
-// directory delimiter, and the filename.
-//------------------------------------------------------------------
-void
-FileSpec::Dump(Stream *s) const
-{
-    if (m_filename)
-        m_directory.Dump(s, "");    // Provide a default for m_directory when we dump it in case it is invalid
-
-    if (m_directory)
-    {
-        // If dirname was valid, then we need to print a slash between
-        // the directory and the filename
-        s->PutChar('/');
-    }
-    m_filename.Dump(s);
-}
-
-//------------------------------------------------------------------
-// Returns true if the file exists.
-//------------------------------------------------------------------
-bool
-FileSpec::Exists () const
-{
-    struct stat file_stats;
-    return GetFileStats (this, &file_stats);
-}
-
-bool
-FileSpec::ResolveExecutableLocation ()
-{
-    if (!m_directory)
-    {
-        const char *file_cstr = m_filename.GetCString();
-        if (file_cstr)
-        {
-            const std::string file_str (file_cstr);
-            llvm::sys::Path path = llvm::sys::Program::FindProgramByName (file_str);
-            const std::string &path_str = path.str();
-            llvm::StringRef dir_ref = llvm::sys::path::parent_path(path_str);
-            //llvm::StringRef dir_ref = path.getDirname();
-            if (! dir_ref.empty())
-            {
-                // FindProgramByName returns "." if it can't find the file.
-                if (strcmp (".", dir_ref.data()) == 0)
-                    return false;
-
-                m_directory.SetCString (dir_ref.data());
-                if (Exists())
-                    return true;
-                else
-                {
-                    // If FindProgramByName found the file, it returns the directory + filename in its return results.
-                    // We need to separate them.
-                    FileSpec tmp_file (dir_ref.data(), false);
-                    if (tmp_file.Exists())
-                    {
-                        m_directory = tmp_file.m_directory;
-                        return true;
-                    }
-                }
-            }
-        }
-    }
-    
-    return false;
-}
-
-bool
-FileSpec::ResolvePath ()
-{
-    if (m_is_resolved)
-        return true;    // We have already resolved this path
-
-    char path_buf[PATH_MAX];    
-    if (!GetPath (path_buf, PATH_MAX))
-        return false;
-    // SetFile(...) will set m_is_resolved correctly if it can resolve the path
-    SetFile (path_buf, true);
-    return m_is_resolved; 
-}
-
-uint64_t
-FileSpec::GetByteSize() const
-{
-    struct stat file_stats;
-    if (GetFileStats (this, &file_stats))
-        return file_stats.st_size;
-    return 0;
-}
-
-FileSpec::FileType
-FileSpec::GetFileType () const
-{
-    struct stat file_stats;
-    if (GetFileStats (this, &file_stats))
-    {
-        mode_t file_type = file_stats.st_mode & S_IFMT;
-        switch (file_type)
-        {
-        case S_IFDIR:   return eFileTypeDirectory;
-        case S_IFIFO:   return eFileTypePipe;
-        case S_IFREG:   return eFileTypeRegular;
-        case S_IFSOCK:  return eFileTypeSocket;
-        case S_IFLNK:   return eFileTypeSymbolicLink;
-        default:
-            break;
-        }
-        return eFileTypeUnknown;
-    }
-    return eFileTypeInvalid;
-}
-
-TimeValue
-FileSpec::GetModificationTime () const
-{
-    TimeValue mod_time;
-    struct stat file_stats;
-    if (GetFileStats (this, &file_stats))
-        mod_time.OffsetWithSeconds(file_stats.st_mtime);
-    return mod_time;
-}
-
-//------------------------------------------------------------------
-// Directory string get accessor.
-//------------------------------------------------------------------
-ConstString &
-FileSpec::GetDirectory()
-{
-    return m_directory;
-}
-
-//------------------------------------------------------------------
-// Directory string const get accessor.
-//------------------------------------------------------------------
-const ConstString &
-FileSpec::GetDirectory() const
-{
-    return m_directory;
-}
-
-//------------------------------------------------------------------
-// Filename string get accessor.
-//------------------------------------------------------------------
-ConstString &
-FileSpec::GetFilename()
-{
-    return m_filename;
-}
-
-//------------------------------------------------------------------
-// Filename string const get accessor.
-//------------------------------------------------------------------
-const ConstString &
-FileSpec::GetFilename() const
-{
-    return m_filename;
-}
-
-//------------------------------------------------------------------
-// Extract the directory and path into a fixed buffer. This is
-// needed as the directory and path are stored in separate string
-// values.
-//------------------------------------------------------------------
-size_t
-FileSpec::GetPath(char *path, size_t path_max_len) const
-{
-    if (path_max_len)
-    {
-        const char *dirname = m_directory.GetCString();
-        const char *filename = m_filename.GetCString();
-        if (dirname)
-        {
-            if (filename)
-                return ::snprintf (path, path_max_len, "%s/%s", dirname, filename);
-            else
-                return ::snprintf (path, path_max_len, "%s", dirname);
-        }
-        else if (filename)
-        {
-            return ::snprintf (path, path_max_len, "%s", filename);
-        }
-    }
-    path[0] = '\0';
-    return 0;
-}
-
-//------------------------------------------------------------------
-// Returns a shared pointer to a data buffer that contains all or
-// part of the contents of a file. The data is memory mapped and
-// will lazily page in data from the file as memory is accessed.
-// The data that is mappped will start "file_offset" bytes into the
-// file, and "file_size" bytes will be mapped. If "file_size" is
-// greater than the number of bytes available in the file starting
-// at "file_offset", the number of bytes will be appropriately
-// truncated. The final number of bytes that get mapped can be
-// verified using the DataBuffer::GetByteSize() function.
-//------------------------------------------------------------------
-DataBufferSP
-FileSpec::MemoryMapFileContents(off_t file_offset, size_t file_size) const
-{
-    DataBufferSP data_sp;
-    auto_ptr<DataBufferMemoryMap> mmap_data(new DataBufferMemoryMap());
-    if (mmap_data.get())
-    {
-        if (mmap_data->MemoryMapFromFileSpec (this, file_offset, file_size) >= file_size)
-            data_sp.reset(mmap_data.release());
-    }
-    return data_sp;
-}
-
-
-//------------------------------------------------------------------
-// Return the size in bytes that this object takes in memory. This
-// returns the size in bytes of this object, not any shared string
-// values it may refer to.
-//------------------------------------------------------------------
-size_t
-FileSpec::MemorySize() const
-{
-    return m_filename.MemorySize() + m_directory.MemorySize();
-}
-
-
-size_t
-FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len) const
-{
-    size_t bytes_read = 0;
-    char resolved_path[PATH_MAX];
-    if (GetPath(resolved_path, sizeof(resolved_path)))
-    {
-        int fd = ::open (resolved_path, O_RDONLY, 0);
-        if (fd != -1)
-        {
-            struct stat file_stats;
-            if (::fstat (fd, &file_stats) == 0)
-            {
-                // Read bytes directly into our basic_string buffer
-                if (file_stats.st_size > 0)
-                {
-                    off_t lseek_result = 0;
-                    if (file_offset > 0)
-                        lseek_result = ::lseek (fd, file_offset, SEEK_SET);
-
-                    if (lseek_result == file_offset)
-                    {
-                        ssize_t n = ::read (fd, dst, dst_len);
-                        if (n >= 0)
-                            bytes_read = n;
-                    }
-                }
-            }
-        }
-        close(fd);
-    }
-    return bytes_read;
-}
-
-//------------------------------------------------------------------
-// Returns a shared pointer to a data buffer that contains all or
-// part of the contents of a file. The data copies into a heap based
-// buffer that lives in the DataBuffer shared pointer object returned.
-// The data that is cached will start "file_offset" bytes into the
-// file, and "file_size" bytes will be mapped. If "file_size" is
-// greater than the number of bytes available in the file starting
-// at "file_offset", the number of bytes will be appropriately
-// truncated. The final number of bytes that get mapped can be
-// verified using the DataBuffer::GetByteSize() function.
-//------------------------------------------------------------------
-DataBufferSP
-FileSpec::ReadFileContents (off_t file_offset, size_t file_size) const
-{
-    DataBufferSP data_sp;
-    char resolved_path[PATH_MAX];
-    if (GetPath(resolved_path, sizeof(resolved_path)))
-    {
-        int fd = ::open (resolved_path, O_RDONLY, 0);
-        if (fd != -1)
-        {
-            struct stat file_stats;
-            if (::fstat (fd, &file_stats) == 0)
-            {
-                if (file_stats.st_size > 0)
-                {
-                    off_t lseek_result = 0;
-                    if (file_offset > 0)
-                        lseek_result = ::lseek (fd, file_offset, SEEK_SET);
-
-                    if (lseek_result < 0)
-                    {
-                        // Get error from errno
-                    }
-                    else if (lseek_result == file_offset)
-                    {
-                        const size_t bytes_left = file_stats.st_size - file_offset;
-                        size_t num_bytes_to_read = file_size;
-                        if (num_bytes_to_read > bytes_left)
-                            num_bytes_to_read = bytes_left;
-
-                        std::auto_ptr<DataBufferHeap> data_heap_ap;
-                        data_heap_ap.reset(new DataBufferHeap(num_bytes_to_read, '\0'));
-
-                        if (data_heap_ap.get())
-                        {
-                            ssize_t bytesRead = ::read (fd, (void *)data_heap_ap->GetBytes(), data_heap_ap->GetByteSize());
-                            if (bytesRead >= 0)
-                            {
-                                // Make sure we read exactly what we asked for and if we got
-                                // less, adjust the array
-                                if ((size_t)bytesRead < data_heap_ap->GetByteSize())
-                                    data_heap_ap->SetByteSize(bytesRead);
-                                data_sp.reset(data_heap_ap.release());
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        close(fd);
-    }
-    return data_sp;
-}
-
-size_t
-FileSpec::ReadFileLines (STLStringArray &lines)
-{
-    lines.clear();
-    char path[PATH_MAX];
-    if (GetPath(path, sizeof(path)))
-    {
-        ifstream file_stream (path);
-
-        if (file_stream)
-        {
-            std::string line;
-            while (getline (file_stream, line))
-                lines.push_back (line);
-        }
-    }
-    return lines.size();
-}
-
-FileSpec::EnumerateDirectoryResult
-FileSpec::EnumerateDirectory
-(
-    const char *dir_path, 
-    bool find_directories,
-    bool find_files,
-    bool find_other,
-    EnumerateDirectoryCallbackType callback,
-    void *callback_baton
-)
-{
-    if (dir_path && dir_path[0])
-    {
-        lldb_utility::CleanUp <DIR *, int> dir_path_dir (opendir(dir_path), NULL, closedir);
-        if (dir_path_dir.is_valid())
-        {
-            struct dirent* dp;
-            while ((dp = readdir(dir_path_dir.get())) != NULL)
-            {
-                // Only search directories
-                if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN)
-                {
-                    size_t len = strlen(dp->d_name);
-
-                    if (len == 1 && dp->d_name[0] == '.')
-                        continue;
-
-                    if (len == 2 && dp->d_name[0] == '.' && dp->d_name[1] == '.')
-                        continue;
-                }
-            
-                bool call_callback = false;
-                FileSpec::FileType file_type = eFileTypeUnknown;
-
-                switch (dp->d_type)
-                {
-                default:
-                case DT_UNKNOWN:    file_type = eFileTypeUnknown;       call_callback = true;               break;
-                case DT_FIFO:       file_type = eFileTypePipe;          call_callback = find_other;         break;
-                case DT_CHR:        file_type = eFileTypeOther;         call_callback = find_other;         break;
-                case DT_DIR:        file_type = eFileTypeDirectory;     call_callback = find_directories;   break;
-                case DT_BLK:        file_type = eFileTypeOther;         call_callback = find_other;         break;
-                case DT_REG:        file_type = eFileTypeRegular;       call_callback = find_files;         break;
-                case DT_LNK:        file_type = eFileTypeSymbolicLink;  call_callback = find_other;         break;
-                case DT_SOCK:       file_type = eFileTypeSocket;        call_callback = find_other;         break;
-                case DT_WHT:        file_type = eFileTypeOther;         call_callback = find_other;         break;
-                }
-
-                if (call_callback)
-                {
-                    char child_path[PATH_MAX];
-                    const int child_path_len = ::snprintf (child_path, sizeof(child_path), "%s/%s", dir_path, dp->d_name);
-                    if (child_path_len < sizeof(child_path) - 1)
-                    {
-                        // Don't resolve the file type or path
-                        FileSpec child_path_spec (child_path, false);
-
-                        EnumerateDirectoryResult result = callback (callback_baton, file_type, child_path_spec);
-                        
-                        switch (result)
-                        {
-                        default:
-                        case eEnumerateDirectoryResultNext:  
-                            // Enumerate next entry in the current directory. We just
-                            // exit this switch and will continue enumerating the
-                            // current directory as we currently are...
-                            break;
-
-                        case eEnumerateDirectoryResultEnter: // Recurse into the current entry if it is a directory or symlink, or next if not
-                            if (FileSpec::EnumerateDirectory (child_path, 
-                                                              find_directories, 
-                                                              find_files, 
-                                                              find_other, 
-                                                              callback, 
-                                                              callback_baton) == eEnumerateDirectoryResultQuit)
-                            {
-                                // The subdirectory returned Quit, which means to 
-                                // stop all directory enumerations at all levels.
-                                return eEnumerateDirectoryResultQuit;
-                            }
-                            break;
-                        
-                        case eEnumerateDirectoryResultExit:  // Exit from the current directory at the current level.
-                            // Exit from this directory level and tell parent to 
-                            // keep enumerating.
-                            return eEnumerateDirectoryResultNext;
-
-                        case eEnumerateDirectoryResultQuit:  // Stop directory enumerations at any level
-                            return eEnumerateDirectoryResultQuit;
-                        }
-                    }
-                }
-            }
-        }
-    }
-    // By default when exiting a directory, we tell the parent enumeration
-    // to continue enumerating.
-    return eEnumerateDirectoryResultNext;    
-}
-

Modified: lldb/trunk/source/Core/PluginManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Core/PluginManager.cpp (original)
+++ lldb/trunk/source/Core/PluginManager.cpp Mon Feb  7 23:05:52 2011
@@ -13,7 +13,7 @@
 #include <vector>
 
 #include "lldb/Core/Error.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/Mutex.h"
 

Copied: lldb/trunk/source/Host/common/FileSpec.cpp (from r125077, lldb/trunk/source/Core/FileSpec.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?p2=lldb/trunk/source/Host/common/FileSpec.cpp&p1=lldb/trunk/source/Core/FileSpec.cpp&r1=125077&r2=125078&rev=125078&view=diff
==============================================================================
--- lldb/trunk/source/Core/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Mon Feb  7 23:05:52 2011
@@ -24,7 +24,7 @@
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Program.h"
 
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/DataBufferMemoryMap.h"
 #include "lldb/Core/Stream.h"

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Mon Feb  7 23:05:52 2011
@@ -11,7 +11,7 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Error.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/Config.h"

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Feb  7 23:05:52 2011
@@ -21,7 +21,7 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/Communication.h"
 #include "lldb/Core/ConnectionFileDescriptor.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/StreamString.h"

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Mon Feb  7 23:05:52 2011
@@ -21,7 +21,7 @@
 
 // These are for the Sourcename completers.
 // FIXME: Make a separate file for the completers.
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Mon Feb  7 23:05:52 2011
@@ -20,7 +20,7 @@
 #include "llvm/Support/MachO.h"
 
 #include "lldb/Target/DynamicLoader.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/UUID.h"
 #include "lldb/Host/Mutex.h"
 #include "lldb/Target/Process.h"

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Mon Feb  7 23:05:52 2011
@@ -18,7 +18,7 @@
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Debugger.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Value.h"

Modified: lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h Mon Feb  7 23:05:52 2011
@@ -14,7 +14,7 @@
 
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/ConstString.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/UniqueCStringMap.h"
 #include "lldb/Host/TimeValue.h"
 

Modified: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h Mon Feb  7 23:05:52 2011
@@ -11,7 +11,7 @@
 #define liblldb_ObjectContainerUniversalMachO_h_
 
 #include "lldb/Symbol/ObjectContainer.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 
 #include "llvm/Support/MachO.h"
 

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h Mon Feb  7 23:05:52 2011
@@ -14,7 +14,7 @@
 #include <vector>
 
 #include "lldb/lldb-private.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Symbol/ObjectFile.h"
 
 #include "ELFHeader.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=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Feb  7 23:05:52 2011
@@ -11,7 +11,7 @@
 
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBuffer.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h Mon Feb  7 23:05:52 2011
@@ -12,7 +12,7 @@
 
 #include "llvm/Support/MachO.h"
 
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Mutex.h"
 #include "lldb/Symbol/ObjectFile.h"
 

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp Mon Feb  7 23:05:52 2011
@@ -27,7 +27,7 @@
 
 #include "lldb/Breakpoint/WatchpointLocation.h"
 #include "lldb/Core/ArchSpec.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/State.h"

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=125078&r1=125077&r2=125078&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Feb  7 23:05:52 2011
@@ -24,7 +24,7 @@
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/ConnectionFileDescriptor.h"
-#include "lldb/Core/FileSpec.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/InputReader.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"





More information about the lldb-commits mailing list