Skip to content
  1. May 14, 2011
  2. Apr 21, 2011
  3. Apr 19, 2011
  4. Apr 16, 2011
  5. Apr 15, 2011
    • Johnny Chen's avatar
      Get rid the of set membership test (log(m)) and, instead, use an index variable 'i' · b57edcab
      Johnny Chen authored
      which advances when src collides with a purged slot.
      Hi Stephen, you're welcome to overwrite/or improve upon this version.  Thanks.
      
      llvm-svn: 129611
      b57edcab
    • Johnny Chen's avatar
      Update both the src and dst pointers at the end of the loop. · fec280e7
      Johnny Chen authored
      Stephen Wilson is working on a better performing patch in the meantime.
      
      llvm-svn: 129605
      fec280e7
    • Johnny Chen's avatar
      Optimize address range coalescing. · d2ddabac
      Johnny Chen authored
      DWARFDebugAranges::Sort() calls std::stable_sort() over a set of address ranges
      and then proceeds to collapse neighboring ranges together.
      
      One problem with the current implementation is that it does an incomplete job.
      When a pair of ranges are merged the next pair considered does not include the
      just-merged range.  IOW, three consecutive ranges are never collapsed into one.
      
      Another problem is that for each range merged we are calling
      std::vector::erase() which "shifts" all remaining elements of the vector by one
      position on every merge.  The end result (in the worst case) is a quadratic
      algorithm -- not good when the input vector is large.
      
      The following patch merges all consecutive ranges and removes the quadratic
      behavior.  The implementation uses an auxiliary vector of indices in order to
      remember all ranges that can be dropped, then performs the coalescing of ranges
      in a single pass.
      
      Patch from Stephen Wilson with some minor modification by me.
      
      llvm-svn: 129595
      d2ddabac
  6. Apr 14, 2011
    • Greg Clayton's avatar
      Added auto completion for architecture names and for platforms. · ab65b34f
      Greg Clayton authored
      Modified the OptionGroupOptions to be able to specify only some of the options
      that should be appended by using the usage_mask in the group defintions and
      also provided a way to remap them to a new usage mask after the copy. This 
      allows options to be re-used and also targetted for specific option groups.
      
      Modfied the CommandArgumentType to have a new eArgTypePlatform enumeration.
      Taught the option parser to be able to automatically use the appropriate
      auto completion for a given options if nothing is explicitly specified
      in the option definition. So you don't have to specify it in the option
      definition tables.
      
      Renamed the default host platform name to "host", and the default platform
      hostname to be "localhost".
      
      Modified the "file" and "platform select" commands to make sure all options
      and args are good prior to creating a new platform. Also defer the computation
      of the architecture in the file command until all options are parsed and the
      platform has either not been specified or reset to a new value to avoid
      computing the arch more than once.
      
      Switch the PluginManager code over to using llvm::StringRef for string
      comparisons and got rid of all the AccessorXXX functions in lieu of the newer
      mutex + collection singleton accessors.
      
      llvm-svn: 129483
      ab65b34f
  7. 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
  8. Apr 05, 2011
    • Caroline Tice's avatar
      · ad379efc
      Caroline Tice authored
      Add the rest of the mechanisms to make ARM instruction emulation usable/possible.
      
      llvm-svn: 128907
      ad379efc
  9. Mar 31, 2011
  10. Mar 24, 2011
  11. Mar 20, 2011
    • Greg Clayton's avatar
      Split all of the core of LLDB.framework/lldb.so into a · 7a5388bf
      Greg Clayton authored
      static archive that can be linked against. LLDB.framework/lldb.so
      exports a very controlled API. Splitting the API into a static
      library allows other tools (debugserver for now) to use the power
      of the LLDB debugger core, yet not export it as its API is not
      portable or maintainable. The Host layer and many of the other
      internal only APIs can now be statically linked against.
      
      Now LLDB.framework/lldb.so links against "liblldb-core.a" instead
      of compiling the .o files only for the shared library. This fix
      is only for compiling with Xcode as the Makefile based build already
      does this.
      
      The Xcode projecdt compiler has been changed to LLVM. Anyone using
      Xcode 3 will need to manually change the compiler back to GCC 4.2,
      or update to Xcode 4.
      
      llvm-svn: 127963
      7a5388bf
  12. Mar 15, 2011
  13. 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
    • Jim Ingham's avatar
      Reverting the part of the debug-in-ofile patch from earlier today that removes... · 5ca40258
      Jim Ingham authored
      Reverting the part of the debug-in-ofile patch from earlier today that removes them from the shared module list.  That was causing a bunch of asserts.  Greg is working on a better fix.
      
      llvm-svn: 127201
      5ca40258
  14. Mar 07, 2011
  15. Feb 17, 2011
  16. Feb 15, 2011
    • Greg Clayton's avatar
      All UnwindPlan objects are now passed around as shared pointers. · e576ab29
      Greg Clayton authored
      ArchDefaultUnwindPlan plug-in interfaces are now cached per architecture 
      instead of being leaked for every frame.
      
      Split the ArchDefaultUnwindPlan_x86 into ArchDefaultUnwindPlan_x86_64 and
      ArchDefaultUnwindPlan_i386 interfaces.
      
      There were sporadic crashes that were due to something leaking or being 
      destroyed when doing stack crawls. This patch should clear up these issues.
      
      llvm-svn: 125541
      e576ab29
  17. Feb 10, 2011
  18. Feb 09, 2011
    • Greg Clayton's avatar
      Added the DWARF unique type map such that we only create a type once in the · 1c9e5acd
      Greg Clayton authored
      module's AST context. Prior to this fix, with gcc binaries, we end up with
      a full class definition for any used classes in each compile unit due to the
      one definition rule. This would result in us making N copies of class T, where
      N is the number of compile units that use class T, in the module AST. When
      an expression would then try and use any types that were duplicated, it would
      quickly confuse clang and make expression evaluation fail due to all of the
      duplicate types that got copied over. This is now fixed by making a map of
      types in the DWARF that maps type names to a collection of types + declaration
      (file + line number) + DIE. Then later when we find a type we look in this
      module map and find any already cached types that we can just use.
      
      8935777
      
      llvm-svn: 125207
      1c9e5acd
  19. Feb 08, 2011
  20. Feb 05, 2011
  21. Feb 04, 2011
  22. 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
  23. Jan 27, 2011
    • Greg Clayton's avatar
      Changed the SymbolFile::FindFunction() function calls to only return · 931180e6
      Greg Clayton authored
      lldb_private::Function objects. Previously the SymbolFileSymtab subclass
      would return lldb_private::Symbol objects when it was asked to find functions.
      
      The Module::FindFunctions (...) now take a boolean "bool include_symbols" so
      that the module can track down functions and symbols, yet functions are found
      by the SymbolFile plug-ins (through the SymbolVendor class), and symbols are
      gotten through the ObjectFile plug-ins.
      
      Fixed and issue where the DWARF parser might run into incomplete class member
      function defintions which would make clang mad when we tried to make certain
      member functions with invalid number of parameters (such as an operator=
      operator that had no parameters). Now we just avoid and don't complete these
      incomplete functions.
      
      llvm-svn: 124359
      931180e6
  24. Jan 26, 2011
  25. Jan 25, 2011
    • Greg Clayton's avatar
      Fixed an issue that was stopping LLDB from finding complete definitions for · 4cd17802
      Greg Clayton authored
      types. What was happening was the DWARF parser was almost ignoring definitions
      (DIEs with the DW_AT_declaration set to 1). It wasn't ignoring declarations
      that had _some_ children. When this happened, we would treat the declaration
      as a complete type. Often we would have a declaration of a type with just
      some enum definitions inside and nothing else. Now we correctly ignore these
      definitions, and also I added some changes to allow us to figure out what
      decl context these special declarations actually point to.
      
      llvm-svn: 124179
      4cd17802
  26. Jan 23, 2011
  27. Jan 20, 2011
  28. Jan 17, 2011
    • Greg Clayton's avatar
      A few of the issue I have been trying to track down and fix have been due to · 6beaaa68
      Greg Clayton authored
      the way LLDB lazily gets complete definitions for types within the debug info.
      When we run across a class/struct/union definition in the DWARF, we will only
      parse the full definition if we need to. This works fine for top level types
      that are assigned directly to variables and arguments, but when we have a 
      variable with a class, lets say "A" for this example, that has a member:
      "B *m_b". Initially we don't need to hunt down a definition for this class
      unless we are ever asked to do something with it ("expr m_b->getDecl()" for
      example). With my previous approach to lazy type completion, we would be able
      to take a "A *a" and get a complete type for it, but we wouldn't be able to
      then do an "a->m_b->getDecl()" unless we always expanded all types within a
      class prior to handing out the type. Expanding everything is very costly and
      it would be great if there were a better way.
      
      A few months ago I worked with the llvm/clang folks to have the 
      ExternalASTSource class be able to complete classes if there weren't completed
      yet:
      
      class ExternalASTSource {
      ....
      
          virtual void
          CompleteType (clang::TagDecl *Tag);
          
          virtual void 
          CompleteType (clang::ObjCInterfaceDecl *Class);
      };
      
      This was great, because we can now have the class that is producing the AST
      (SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources
      and the object that creates the forward declaration types can now also
      complete them anywhere within the clang type system.
      
      This patch makes a few major changes:
      - lldb_private::Module classes now own the AST context. Previously the TypeList
        objects did.
      - The DWARF parsers now sign up as an external AST sources so they can complete
        types.
      - All of the pure clang type system wrapper code we have in LLDB (ClangASTContext,
        ClangASTType, and more) can now be iterating through children of any type,
        and if a class/union/struct type (clang::RecordType or ObjC interface) 
        is found that is incomplete, we can ask the AST to get the definition. 
      - The SymbolFileDWARFDebugMap class now will create and use a single AST that
        all child SymbolFileDWARF classes will share (much like what happens when
        we have a complete linked DWARF for an executable).
        
      We will need to modify some of the ClangUserExpression code to take more 
      advantage of this completion ability in the near future. Meanwhile we should
      be better off now that we can be accessing any children of variables through
      pointers and always be able to resolve the clang type if needed.
      
      llvm-svn: 123613
      6beaaa68
  29. Jan 14, 2011
    • Greg Clayton's avatar
      Fixed an error in the type map for "char **" that was a bad memory smasher. · ca512b39
      Greg Clayton authored
      Anytime we had a valid python list that was trying to go from Python down into
      our C++ API, it was allocating too little memory and it ended up smashing
      whatever was next to the allocated memory.
      
      Added typemap conversions for "void *, size_t" so we can get 
      SBProcess::ReadMemory() working. Also added a typemap for "const void *, size_t"
      so we can get SBProcess::WriteMemory() to work.
      
      Fixed an issue in the DWARF parser where we weren't correctly calculating the
      DeclContext for all types and classes. We now should be a lot more accurate.
      Fixes include: enums should now be setting their parent decl context correctly.
      We saw a lot of examples where enums in classes were not being properly
      namespace scoped. Also, classes within classes now get properly scoped.
      
      Fixed the objective C runtime pointer checkers to let "nil" pointers through
      since these are accepted by compiled code. We also now don't call "abort()"
      when a pointer doesn't validate correctly since this was wreaking havoc on
      the process due to the way abort() works. We now just dereference memory
      which should give us an exception from which we can easily and reliably 
      recover.
      
      llvm-svn: 123428
      ca512b39
  30. Jan 08, 2011
  31. Dec 15, 2010
  32. Dec 07, 2010
  33. Dec 06, 2010
  34. Dec 03, 2010
Loading