Skip to content
  1. Apr 14, 2012
    • Greg Clayton's avatar
      Added a new host function that allows us to run shell command and get the... · d1cf11a7
      Greg Clayton authored
      Added a new host function that allows us to run shell command and get the output from them along with the status and signal:
      
      Error
      Host::RunShellCommand (const char *command,
                             const char *working_dir,
                             int *status_ptr,
                             int *signo_ptr,
                             std::string *command_output_ptr,
                             uint32_t timeout_sec);
      
      This will allow us to use this functionality in the host lldb_private::Platform, and also use it in our lldb-platform binary. It leverages the existing code in Host::LaunchProcess and ProcessLaunchInfo.
      
      llvm-svn: 154730
      d1cf11a7
  2. Apr 07, 2012
    • Jim Ingham's avatar
      We sometimes need to be able to call functions (via Process::RunThreadPlan)... · 372787fc
      Jim Ingham authored
      We sometimes need to be able to call functions (via Process::RunThreadPlan) from code run on the private state thread.  To do that we have to 
      spin up a temporary "private state thread" that will respond to events from the lower level process plugins.  This check-in should work to do
      that, but it is still buggy.  However, if you don't call functions on the private state thread, these changes make no difference.
      
      This patch also moves the code in the AppleObjCRuntime step-through-trampoline handler that might call functions (in the case where the debug
      server doesn't support the memory allocate/deallocate packet) out to a safe place to do that call.
      
      llvm-svn: 154230
      372787fc
  3. Feb 25, 2012
    • Han Ming Ong's avatar
      <rdar://problem/3535148> · 84647048
      Han Ming Ong authored
      Added ability to debug root processes on OS X. This uses XPC service that is available on Lion and above only.
      
      llvm-svn: 151419
      84647048
  4. Feb 14, 2012
    • Greg Clayton's avatar
      Full core file support has been added for mach-o core files. · c859e2d5
      Greg Clayton authored
      Tracking modules down when you have a UUID and a path has been improved.
      
      DynamicLoaderDarwinKernel no longer parses mach-o load commands and it
      now uses the memory based modules now that we can load modules from memory.
      
      Added a target setting named "target.exec-search-paths" which can be used
      to supply a list of directories to use when trying to look for executables.
      This allows one or more directories to be used when searching for modules
      that may not exist in the SDK/PDK. The target automatically adds the directory
      for the main executable to this list so this should help us in tracking down
      shared libraries and other binaries. 
      
      llvm-svn: 150426
      c859e2d5
  5. Jan 05, 2012
    • Greg Clayton's avatar
      Added code in the Host layer that can report system log messages · e38a5edd
      Greg Clayton authored
      so that we don't have "fprintf (stderr, ...)" calls sprinkled everywhere.
      Changed all needed locations over to using this.
      
      For non-darwin, we log to stderr only. On darwin, we log to stderr _and_
      to ASL (Apple System Log facility). This will allow GUI apps to have a place
      for these error and warning messages to go, and also allows the command line
      apps to log directly to the terminal.
      
      llvm-svn: 147596
      e38a5edd
  6. Nov 17, 2011
  7. Nov 16, 2011
    • Greg Clayton's avatar
      Made the darwin host layer properly reap any child processes that it spawns. · e4e45924
      Greg Clayton authored
      After recent changes we weren't reaping child processes resulting in many
      zombie processes. 
      
      This was fixed by adding more settings to the ProcessLaunchOptions class
      that allow clients to specify a callback function and baton to be notified
      when their process dies. If one is not supplied a default callback will be
      used that "does the right thing". 
      
      Cleaned up a race condition in the ProcessGDBRemote class that would attempt
      to monitor when debugserver died. 
      
      Added an extra boolean to the process monitor callbacks that indicate if a
      process exited or not. If your process exited with a zero exit status and no
      signal, both items could be zero.
      
      Modified the process monitor functions to not require a callback function
      in order to reap the child process.
      
      llvm-svn: 144780
      e4e45924
  8. Nov 05, 2011
  9. Nov 04, 2011
    • Benjamin Kramer's avatar
      Fix linux build after r143679. · 44030f12
      Benjamin Kramer authored
      llvm-svn: 143703
      44030f12
    • Greg Clayton's avatar
      Fixed a build issue on an older Xcode. · 0ddf6be1
      Greg Clayton authored
      llvm-svn: 143679
      0ddf6be1
    • Greg Clayton's avatar
      Fixed the Xcode project building of LLVM to be a bit more user friendly: · dce502ed
      Greg Clayton authored
      - If you download and build the sources in the Xcode project, x86_64 builds
        by default using the "llvm.zip" checkpointed LLVM.
      - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the
        Xcode project will download the right LLVM sources and build them from 
        scratch
      - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib"
        directory, we will use the sources you have placed in the LLDB directory.
        
      Python can now be disabled for platforms that don't support it. 
      
      Changed the way the libllvmclang.a files get used. They now all get built into
      arch specific directories and never get merged into universal binaries as this
      was causing issues where you would have to go and delete the file if you wanted
      to build an extra architecture slice.
      
      llvm-svn: 143678
      dce502ed
  10. Nov 03, 2011
  11. Oct 27, 2011
  12. Aug 05, 2011
  13. Aug 02, 2011
    • Johnny Chen's avatar
      Patch by David Forsythe to build lldb on FreeBSD! · 8f3d8384
      Johnny Chen authored
      I did not take the patch for ClangExpressionParser.cpp since there was a
      recent change by Peter for the same line.  Feel free to disagree. :-)
      
      Reference:
      ----------------------------------------------------------------------
      r136580 | pcc | 2011-07-30 15:42:24 -0700 (Sat, 30 Jul 2011) | 3 lines
      
      Add reloc arg to standard JIT createJIT()
      
      Fixes non-__APPLE__ build.  Patch by Matt Johnson!
      ----------------------------------------------------------------------
      
      Also, I ignore the part of the patch to remove the RegisterContextDarwin*.h/.cpp.
      
      llvm-svn: 136720
      8f3d8384
  14. Jul 19, 2011
    • Johnny Chen's avatar
      Patch by Matt Johnson to silence G++ warnings! · 4480530a
      Johnny Chen authored
      Used hand merge to apply the diffs.  I did not apply the diffs for FormatManager.h and
      the diffs for memberwise initialization for ValueObject.cpp because they changed since.
      I will ask my colleague to apply them later.
      
      llvm-svn: 135508
      4480530a
  15. May 13, 2011
  16. Apr 12, 2011
    • Greg Clayton's avatar
      Moved the execution context that was in the Debugger into · 8b82f087
      Greg Clayton authored
      the CommandInterpreter where it was always being used.
      
      Make sure that Modules can track their object file offsets correctly to
      allow opening of sub object files (like the "__commpage" on darwin).
      
      Modified the Platforms to be able to launch processes. The first part of this
      move is the platform soon will become the entity that launches your program
      and when it does, it uses a new ProcessLaunchInfo class which encapsulates
      all process launching settings. This simplifies the internal APIs needed for
      launching. I want to slowly phase out process launching from the process
      classes, so for now we can still launch just as we used to, but eventually
      the platform is the object that should do the launching.
      
      Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able
      to launch processes with all of the new eLaunchFlag settings. Modified any
      code that was manually launching processes to use the Host::LaunchProcess
      functions.
      
      Fixed an issue where lldb_private::Args had implicitly defined copy 
      constructors that could do the wrong thing. This has now been fixed by adding
      an appropriate copy constructor and assignment operator.
      
      Make sure we don't add empty ModuleSP entries to a module list.
      
      Fixed the commpage module creation on MacOSX, but we still need to train
      the MacOSX dynamic loader to not get rid of it when it doesn't have an entry
      in the all image infos.
      
      Abstracted many more calls from in ProcessGDBRemote down into the 
      GDBRemoteCommunicationClient subclass to make the classes cleaner and more
      efficient.
      
      Fixed the default iOS ARM register context to be correct and also added support
      for targets that don't support the qThreadStopInfo packet by selecting the
      current thread (only if needed) and then sending a stop reply packet.
      
      Debugserver can now start up with a --unix-socket (-u for short) and can 
      then bind to port zero and send the port it bound to to a listening process
      on the other end. This allows the GDB remote platform to spawn new GDB server
      instances (debugserver) to allow platform debugging.
      
      llvm-svn: 129351
      8b82f087
  17. Apr 08, 2011
    • Stephen Wilson's avatar
      Add missing headers. · 8acdbb8a
      Stephen Wilson authored
      Something changed in commit r129112 where a few standard headers vanished from
      the include chain when building on Linux.  Fix up by including limits.h for
      INT_MAX and PATH_MAX where needed, and stdio.h for printf().
      
      llvm-svn: 129130
      8acdbb8a
  18. Mar 30, 2011
    • Greg Clayton's avatar
      Many improvements to the Platform base class and subclasses. The base Platform · 32e0a750
      Greg Clayton authored
      class now implements the Host functionality for a lot of things that make 
      sense by default so that subclasses can check:
      
      int
      PlatformSubclass::Foo ()
      {
          if (IsHost())
              return Platform::Foo (); // Let the platform base class do the host specific stuff
          
          // Platform subclass specific code...
          int result = ...
          return result;
      }
      
      Added new functions to the platform:
      
          virtual const char *Platform::GetUserName (uint32_t uid);
          virtual const char *Platform::GetGroupName (uint32_t gid);
      
      The user and group names are cached locally so that remote platforms can avoid
      sending packets multiple times to resolve this information.
      
      Added the parent process ID to the ProcessInfo class. 
      
      Added a new ProcessInfoMatch class which helps us to match processes up
      and changed the Host layer over to using this new class. The new class allows
      us to search for processs:
      1 - by name (equal to, starts with, ends with, contains, and regex)
      2 - by pid
      3 - And further check for parent pid == value, uid == value, gid == value, 
          euid == value, egid == value, arch == value, parent == value.
          
      This is all hookup up to the "platform process list" command which required
      adding dumping routines to dump process information. If the Host class 
      implements the process lookup routines, you can now lists processes on 
      your local machine:
      
      machine1.foo.com % lldb
      (lldb) platform process list 
      PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                   NAME
      ====== ====== ========== ========== ========== ========== ======================== ============================
      99538  1      username   usergroup  username   usergroup  x86_64-apple-darwin      FileMerge
      94943  1      username   usergroup  username   usergroup  x86_64-apple-darwin      mdworker
      94852  244    username   usergroup  username   usergroup  x86_64-apple-darwin      Safari
      94727  244    username   usergroup  username   usergroup  x86_64-apple-darwin      Xcode
      92742  92710  username   usergroup  username   usergroup  i386-apple-darwin        debugserver
      
      
      This of course also works remotely with the lldb-platform:
      
      machine1.foo.com % lldb-platform --listen 1234
      
      machine2.foo.com % lldb
      (lldb) platform create remote-macosx
        Platform: remote-macosx
       Connected: no
      (lldb) platform connect connect://localhost:1444
        Platform: remote-macosx
          Triple: x86_64-apple-darwin
      OS Version: 10.6.7 (10J869)
          Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
        Hostname: machine1.foo.com
       Connected: yes
      (lldb) platform process list 
      PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                   NAME
      ====== ====== ========== ========== ========== ========== ======================== ============================
      99556  244    username   usergroup  username   usergroup  x86_64-apple-darwin      trustevaluation
      99548  65539  username   usergroup  username   usergroup  x86_64-apple-darwin      lldb
      99538  1      username   usergroup  username   usergroup  x86_64-apple-darwin      FileMerge
      94943  1      username   usergroup  username   usergroup  x86_64-apple-darwin      mdworker
      94852  244    username   usergroup  username   usergroup  x86_64-apple-darwin      Safari
      
      The lldb-platform implements everything with the Host:: layer, so this should
      "just work" for linux. I will probably be adding more stuff to the Host layer
      for launching processes and attaching to processes so that this support should
      eventually just work as well.
      
      Modified the target to be able to be created with an architecture that differs
      from the main executable. This is needed for iOS debugging since we can have
      an "armv6" binary which can run on an "armv7" machine, so we want to be able
      to do:
      
      % lldb
      (lldb) platform create remote-ios
      (lldb) file --arch armv7 a.out
      
      Where "a.out" is an armv6 executable. The platform then can correctly decide
      to open all "armv7" images for all dependent shared libraries.
      
      Modified the disassembly to show the current PC value. Example output:
      
      (lldb) disassemble --frame
      a.out`main:
         0x1eb7:  pushl  %ebp
         0x1eb8:  movl   %esp, %ebp
         0x1eba:  pushl  %ebx
         0x1ebb:  subl   $20, %esp
         0x1ebe:  calll  0x1ec3                   ; main + 12 at test.c:18
         0x1ec3:  popl   %ebx
      -> 0x1ec4:  calll  0x1f12                   ; getpid
         0x1ec9:  movl   %eax, 4(%esp)
         0x1ecd:  leal   199(%ebx), %eax
         0x1ed3:  movl   %eax, (%esp)
         0x1ed6:  calll  0x1f18                   ; printf
         0x1edb:  leal   213(%ebx), %eax
         0x1ee1:  movl   %eax, (%esp)
         0x1ee4:  calll  0x1f1e                   ; puts
         0x1ee9:  calll  0x1f0c                   ; getchar
         0x1eee:  movl   $20, (%esp)
         0x1ef5:  calll  0x1e6a                   ; sleep_loop at test.c:6
         0x1efa:  movl   $12, %eax
         0x1eff:  addl   $20, %esp
         0x1f02:  popl   %ebx
         0x1f03:  leave
         0x1f04:  ret
         
      This can be handy when dealing with the new --line options that was recently
      added:
      
      (lldb) disassemble --line
      a.out`main + 13 at test.c:19
         18  	{
      -> 19  		printf("Process: %i\n\n", getpid());
         20  	    puts("Press any key to continue..."); getchar();
      -> 0x1ec4:  calll  0x1f12                   ; getpid
         0x1ec9:  movl   %eax, 4(%esp)
         0x1ecd:  leal   199(%ebx), %eax
         0x1ed3:  movl   %eax, (%esp)
         0x1ed6:  calll  0x1f18                   ; printf
      
      Modified the ModuleList to have a lookup based solely on a UUID. Since the
      UUID is typically the MD5 checksum of a binary image, there is no need
      to give the path and architecture when searching for a pre-existing
      image in an image list.
      
      Now that we support remote debugging a bit better, our lldb_private::Module
      needs to be able to track what the original path for file was as the platform
      knows it, as well as where the file is locally. The module has the two 
      following functions to retrieve both paths:
      
      const FileSpec &Module::GetFileSpec () const;
      const FileSpec &Module::GetPlatformFileSpec () const;
      
      llvm-svn: 128563
      32e0a750
  19. Mar 24, 2011
    • Greg Clayton's avatar
      Fixed the LLDB build so that we can have private types, private enums and · e0d378b3
      Greg Clayton authored
      public types and public enums. This was done to keep the SWIG stuff from
      parsing all sorts of enums and types that weren't needed, and allows us to
      abstract our API better.
      
      llvm-svn: 128239
      e0d378b3
    • Greg Clayton's avatar
      Did a lot more work on abtracting and organizing the platforms. · 1cb6496e
      Greg Clayton authored
      On Mac OS X we now have 3 platforms:
      PlatformDarwin - must be subclassed to fill in the missing pure virtual funcs
                       but this implements all the common functionality between
                       remote-macosx and remote-ios. It also allows for another
                       platform to be used (remote-gdb-server for now) when doing
                       remote connections. Keeping this pluggable will allow for
                       flexibility.
      PlatformMacOSX - Now implements both local and remote macosx desktop platforms.
      PlatformRemoteiOS - Remote only iOS that knows how to locate SDK files in the
                          cached SDK locations on the host.
      
      A new agnostic platform has been created:
      PlatformRemoteGDBServer - this implements the platform using the GDB remote 
                                protocol and uses the built in lldb_private::Host
                                static functions to implement many queries.
      
      llvm-svn: 128193
      1cb6496e
  20. Mar 21, 2011
  21. Mar 08, 2011
    • Greg Clayton's avatar
      LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide · e996fd30
      Greg Clayton authored
      an interface to a local or remote debugging platform. By default each host OS
      that supports LLDB should be registering a "default" platform that will be
      used unless a new platform is selected. Platforms are responsible for things
      such as:
      - getting process information by name or by processs ID
      - finding platform files. This is useful for remote debugging where there is 
        an SDK with files that might already or need to be cached for debug access.
      - getting a list of platform supported architectures in the exact order they
        should be selected. This helps the native x86 platform on MacOSX select the
        correct x86_64/i386 slice from universal binaries.
      - Connect to remote platforms for remote debugging
      - Resolving an executable including finding an executable inside platform
        specific bundles (macosx uses .app bundles that contain files) and also
        selecting the appropriate slice of universal files for a given platform.
      
      So by default there is always a local platform, but remote platforms can be
      connected to. I will soon be adding a new "platform" command that will support
      the following commands:
      (lldb) platform connect --name machine1 macosx connect://host:port
      Connected to "machine1" platform.
      (lldb) platform disconnect macosx
      
      This allows LLDB to be well setup to do remote debugging and also once 
      connected process listing and finding for things like:
      (lldb) process attach --name x<TAB>
      
      The currently selected platform plug-in can now auto complete any available
      processes that start with "x". The responsibilities for the platform plug-in
      will soon grow and expand.
      
      llvm-svn: 127286
      e996fd30
  22. Feb 24, 2011
  23. Feb 23, 2011
    • Greg Clayton's avatar
      Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified form · 64195a2c
      Greg Clayton authored
      of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up
      doing was:
      - Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics
        the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple 
        to give us the machine type from llvm::Triple::ArchType.
      - There is a new ArchSpec::Core definition which further qualifies the CPU
        core we are dealing with into a single enumeration. If you need support for
        a new Core and want to debug it in LLDB, it must be added to this list. In
        the future we can allow for dynamic core registration, but for now it is
        hard coded.
      - The ArchSpec can now be initialized with a llvm::Triple or with a C string
        that represents the triple (it can just be an arch still like "i386").
      - The ArchSpec can still initialize itself with a architecture type -- mach-o
        with cpu type and subtype, or ELF with e_machine + e_flags -- and this will
        then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core.
        The mach-o cpu type and subtype can be accessed using the getter functions:
        
        uint32_t
        ArchSpec::GetMachOCPUType () const;
      
        uint32_t
        ArchSpec::GetMachOCPUSubType () const;
        
        But these functions are just converting out internal llvm::Triple::ArchSpec 
        + ArchSpec::Core back into mach-o. Same goes for ELF.
      
      All code has been updated to deal with the changes.
      
      This should abstract us until later when the llvm::TargetSpec stuff gets
      finalized and we can then adopt it.
      
      llvm-svn: 126278
      64195a2c
  24. Feb 17, 2011
  25. Feb 16, 2011
    • Greg Clayton's avatar
      The DynamicLoader plug-in instance now lives up in lldb_private::Process where · 93d3c833
      Greg Clayton authored
      it should live and the lldb_private::Process takes care of managing the 
      auto pointer to the dynamic loader instance.
      
      Also, now that the ArchSpec contains the target triple, we are able to 
      correctly set the Target architecture in DidLaunch/DidAttach in the subclasses,
      and then the lldb_private::Process will find the dynamic loader plug-in 
      by letting the dynamic loader plug-ins inspect the arch/triple in the target.
      
      So now the ProcessGDBRemote plug-in is another step closer to be purely 
      process/platform agnostic.
      
      I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly.
      
      llvm-svn: 125650
      93d3c833
  26. Feb 15, 2011
  27. Feb 08, 2011
  28. Feb 07, 2011
  29. Feb 05, 2011
  30. Feb 04, 2011
    • Greg Clayton's avatar
      Added support for attaching to a remote debug server with the new command: · b766a73d
      Greg Clayton authored
      (lldb) process connect <remote-url>
      
      Currently when you specify a file with the file command it helps us to find
      a process plug-in that is suitable for debugging. If you specify a file you
      can rely upon this to find the correct debugger plug-in:
      
      % lldb a.out
      Current executable set to 'a.out' (x86_64).
      (lldb) process connect connect://localhost:2345
      ...
      
      If you don't specify a file, you will need to specify the plug-in name that
      you wish to use:
      
      % lldb
      (lldb) process connect --plugin process.gdb-remote connect://localhost:2345
      
      Other connection URL examples:
      
      (lldb) process connect connect://localhost:2345
      (lldb) process connect tcp://127.0.0.1
      (lldb) process connect file:///dev/ttyS1
      
      We are currently treating the "connect://host:port" as a way to do raw socket
      connections. If there is a URL for this already, please let me know and we
      will adopt it.
      
      So now you can connect to a remote debug server with the ProcessGDBRemote
      plug-in. After connection, it will ask for the pid info using the "qC" packet
      and if it responds with a valid process ID, it will be equivalent to attaching.
      If it response with an error or invalid process ID, the LLDB process will be
      in a new state: eStateConnected. This allows us to then download a program or
      specify the program to run (using the 'A' packet), or specify a process to
      attach to (using the "vAttach" packets), or query info about the processes
      that might be available.
      
      llvm-svn: 124846
      b766a73d
  31. Feb 02, 2011
    • Greg Clayton's avatar
      Modified the PluginManager to be ready for loading plug-ins from a system · 4272cc7d
      Greg Clayton authored
      LLDB plugin directory and a user LLDB plugin directory. We currently still
      need to work out at what layer the plug-ins will be, but at least we are 
      prepared for plug-ins. Plug-ins will attempt to be loaded from the 
      "/Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Plugins" 
      folder, and from the "~/Library/Application Support/LLDB/Plugins" folder on
      MacOSX. Each plugin will be scanned for:
      
      extern "C" bool LLDBPluginInitialize(void);
      extern "C" void LLDBPluginTerminate(void);
      
      If at least LLDBPluginInitialize is found, the plug-in will be loaded. The
      LLDBPluginInitialize function returns a bool that indicates if the plug-in
      should stay loaded or not (plug-ins might check the current OS, current
      hardware, or anything else and determine they don't want to run on the current
      host). The plug-in is uniqued by path and added to a static loaded plug-in
      map. The plug-in scanning happens during "lldb_private::Initialize()" which
      calls to the PluginManager::Initialize() function. Likewise with termination
      lldb_private::Terminate() calls PluginManager::Terminate(). The paths for the
      plug-in directories is fetched through new Host calls:
      
          bool Host::GetLLDBPath (ePathTypeLLDBSystemPlugins, dir_spec);
          bool Host::GetLLDBPath (ePathTypeLLDBUserPlugins, dir_spec);
      
      This way linux and other systems can define their own appropriate locations
      for plug-ins to be loaded.
      
      To allow dynamic shared library loading, the Host layer has also been modified
      to include shared library open, close and get symbol:
      
          static void *
          Host::DynamicLibraryOpen (const FileSpec &file_spec, 
                                    Error &error);
      
          static Error
          Host::DynamicLibraryClose (void *dynamic_library_handle);
      
          static void *
          Host::DynamicLibraryGetSymbol (void *dynamic_library_handle, 
                                        const char *symbol_name, 
                                        Error &error);
      
      lldb_private::FileSpec also has been modified to support directory enumeration
      in an attempt to abstract the directory enumeration into one spot in the code.
      The directory enumertion function is static and takes a callback:
      
      
          typedef 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 FileSpec::EnumerateDirectoryResult (*EnumerateDirectoryCallbackType) (void *baton,
                                                                                        FileSpec::FileType file_type,
                                                                                        const FileSpec &spec);
      
          static FileSpec::EnumerateDirectoryResult
          FileSpec::EnumerateDirectory (const char *dir_path,
                                        bool find_directories,
                                        bool find_files,
                                        bool find_other,
                                        EnumerateDirectoryCallbackType callback,
                                        void *callback_baton);
      
      This allow clients to specify the directory to search, and specifies if only
      files, directories or other (pipe, symlink, fifo, etc) files will cause the
      callback to be called. The callback also gets to return with the action that
      should be performed after this directory entry. eEnumerateDirectoryResultNext
      specifies to continue enumerating through a directory with the next entry.
      eEnumerateDirectoryResultEnter specifies to recurse down into a directory
      entry, or if the file is not a directory or symlink/alias to a directory, then
      just iterate to the next entry. eEnumerateDirectoryResultExit specifies to 
      exit the current directory and skip any entries that might be remaining, yet
      continue enumerating to the next entry in the parent directory. And finally
      eEnumerateDirectoryResultQuit means to abort all directory enumerations at 
      all levels.
      
      Modified the Declaration class to not include column information currently
      since we don't have any compilers that currently support column based 
      declaration information. Columns support can be re-enabled with the
      additions of a #define.
      
      Added the ability to find an EmulateInstruction plug-in given a target triple
      and optional plug-in name in the plug-in manager.
      
      Fixed a few cases where opendir/readdir was being used, but yet not closedir
      was being used. Soon these will be deprecated in favor of the new directory
      enumeration call that was added to the FileSpec class.
      
      llvm-svn: 124716
      4272cc7d
  32. Feb 01, 2011
  33. Jan 23, 2011
    • Greg Clayton's avatar
      Added a new variant of SBTarget::Launch() that deprectates the old one that · bd82a5d2
      Greg Clayton authored
      takes separate file handles for stdin, stdout, and stder and also allows for
      the working directory to be specified.
      
      Added support to "process launch" to a new option: --working-dir=PATH. We
      can now set the working directory. If this is not set, it defaults to that
      of the process that has LLDB loaded. Added the working directory to the
      host LaunchInNewTerminal function to allows the current working directory 
      to be set in processes that are spawned in their own terminal. Also hooked this
      up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its
      API changed, but nothing is making use of it yet. Modfied "debugserver" and
      "darwin-debug" to also handle the current working directory options and modified
      the code in LLDB that spawns these tools to pass the info along.
      
      Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout
      and stderr. 
      
      After clearing the default values for the stdin/out/err file handles for
      process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable
      which is now fixed. Also fixed the setting of boolean values to be able to
      be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no",
      "off", or "0" for false.
      
      Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not
      already opened. Previous to this fix debugserver would only correctly open and dupe
      file handles for the slave side of a pseudo terminal. It now correctly handles
      getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to
      files. Also made sure the file handles were correctly opened with the NOCTTY flag
      for terminals.
      
      llvm-svn: 124060
      bd82a5d2
  34. Jan 13, 2011
Loading