Skip to content
  1. Mar 08, 2014
  2. Nov 22, 2013
    • Colin Riley's avatar
      Fix for PECOFF GetArchitecture · 6c970420
      Colin Riley authored
      0 as CPU subtype never matches anything (at least, it doesn't match x86_64 windows binaries, of which there are correct arch definitions for). It should be created with LLDB_INVALID_CPUTYPE. 
      
      llvm-svn: 195435
      6c970420
  3. Aug 27, 2013
  4. Aug 25, 2013
  5. Jul 10, 2013
    • Greg Clayton's avatar
      Cleanup on the unified section list changes. Main changes are: · 3046e668
      Greg Clayton authored
      - ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags
      - Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections.
      
      Other cleanups:
      - Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly
      - Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently
      - Modified the Symtab class to store a file address lookup table for more efficient lookups
      - Removed Section::Finalize() and SectionList::Finalize() as they did nothing
      - Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs
      - Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement)
      
      llvm-svn: 185990
      3046e668
  6. Jul 01, 2013
  7. Jun 18, 2013
    • Greg Clayton's avatar
      A collection of 3 patches to the COFF file ObjectFile parser from Virgile Bello: · 0076e715
      Greg Clayton authored
      3 patches, aiming to improve PE/COFF support:
      - First patch fix symbol reading (invalid header size from sizeof() == 20 != 18, and various bugfixes such as invalid skipping of auxiliary symbols, 4 bytes shift from beginning, etc...).
      - Second patch add image_base to section vmaddr offset so that VM addr is in image_base space.
      - Third patch add support for DWARF section in PECOFF (taken from ELF counterpart), since they are generated by gcc/clang under windows.
      
      llvm-svn: 184153
      0076e715
  8. May 10, 2013
    • Greg Clayton's avatar
      <rdar://problem/13854277> · 57abc5d6
      Greg Clayton authored
      <rdar://problem/13594769>
      
      Main changes in this patch include:
      - cleanup plug-in interface and use ConstStrings for plug-in names
      - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp
      - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging
      
      The plug-in interface changes:
      
      Modified the lldb_private::PluginInterface class that all plug-ins inherit from:
      
      Changed:
      
      virtual const char * GetPluginName() = 0;
      
      To: 
      
      virtual ConstString GetPluginName() = 0;
      
      Removed:
      
      virtual const char * GetShortPluginName() = 0;
      
      - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. 
      - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc.
      
      llvm-svn: 181631
      57abc5d6
  9. Apr 25, 2013
    • Greg Clayton's avatar
      Added the ability to extract a ModuleSpecList (a new class) from an... · f4d6de6a
      Greg Clayton authored
      Added the ability to extract a ModuleSpecList (a new class) from an ObjectFile. This is designed to be used when you have an object file that contains one or more architectures (MacOSX universal (fat) files) and/or one or more objects (BSD archive (.a files)).
      
      There is a new static ObjectFile function you can call:
      
      size_t
      ObjectFile::GetModuleSpecifications (const FileSpec &file,
                                           lldb::offset_t file_offset,
                                           ModuleSpecList &specs)
      
      This will fill in "specs" which the details of all the module specs (file + arch + UUID (if there is one) + object name (for BSD archive objects eventually) + file offset to the object in question).
      
      This helps us when a user specifies a file that contains a single architecture, and also helps us when we are given a debug symbol file (like a dSYM file on MacOSX) that contains one or more architectures and we need to be able to match it up to an existing Module that has no debug info.
      
      llvm-svn: 180224
      f4d6de6a
  10. Apr 19, 2013
  11. Apr 18, 2013
    • Greg Clayton's avatar
      Since we use C++11, we should switch over to using std::unique_ptr when C++11... · e01e07b6
      Greg Clayton authored
      Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.
      
      Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.
      
      llvm-svn: 179779
      e01e07b6
  12. Feb 06, 2013
    • Greg Clayton's avatar
      <rdar://problem/13159777> · 5ce9c565
      Greg Clayton authored
      lldb was mmap'ing archive files once per .o file it loads, now it correctly shares the archive between modules.
      
      LLDB was also always mapping entire contents of universal mach-o files, now it maps just the slice that is required.
      
      Added a new logging channel for "lldb" called "mmap" to help track future regressions.
      
      Modified the ObjectFile and ObjectContainer plugin interfaces to take a data offset along with the file offset and size so we can implement the correct caching and efficient reading of parts of files without mmap'ing the entire file like we used to.
      
      The current implementation still keeps entire .a files mmaped (once) and entire slices from universal files mmaped to ensure that if a client builds their binaries during a debug session we don't lose our data and get corrupt object file info and debug info.
      
      llvm-svn: 174524
      5ce9c565
  13. Jan 25, 2013
    • Greg Clayton's avatar
      <rdar://problem/13069948> · c7bece56
      Greg Clayton authored
      Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.
      
      So I defined a new "lldb::offset_t" which should be used for all file offsets.
      
      After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.
      
      Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.
      
      llvm-svn: 173463
      c7bece56
  14. Nov 29, 2012
  15. Oct 25, 2012
  16. Jul 19, 2012
  17. Jun 08, 2012
    • Sean Callanan's avatar
      Committed a change to the SectionList that introduces · 5677536b
      Sean Callanan authored
      a cache of address ranges for child sections,
      accelerating lookups.  This cache is built during
      object file loading, and is then set in stone once
      the object files are done loading.  (In Debug builds,
      we ensure that the cache is never invalidated after
      that.)
      
      llvm-svn: 158188
      5677536b
  18. Mar 14, 2012
    • Greg Clayton's avatar
      <rdar://problem/11034170> · a1743499
      Greg Clayton authored
      Simplify the locking strategy for Module and its owned objects to always use the Module's mutex to avoid A/B deadlocks. We had a case where a symbol vendor was locking itself and then calling a function that would try to get it's Module's mutex and at the same time another thread had the Module mutex that was trying to get the SymbolVendor mutex. Now any classes that inherit from ModuleChild should use the module lock using code like:
      
      void
      ModuleChildSubclass::Function
      {
      	ModuleSP module_sp(GetModule());
      	if (module_sp)
      	{
          	lldb_private::Mutex::Locker locker(module_sp->GetMutex());
      		... do work here...
      	}
      }
      
      This will help avoid deadlocks by using as few locks as possible for a module and all its child objects and also enforce detecting if a module has gone away (the ModuleSP will be returned empty if the weak_ptr does refer to a valid object anymore).
      
      llvm-svn: 152679
      a1743499
  19. Mar 07, 2012
    • Greg Clayton's avatar
      <rdar://problem/10997402> · e7612134
      Greg Clayton authored
      This fix really needed to happen as a previous fix I had submitted for
      calculating symbol sizes made many symbols appear to have zero size since
      the function that was calculating the symbol size was calling another function
      that would cause the calculation to happen again. This resulted in some symbols
      having zero size when they shouldn't. This could then cause infinite stack
      traces and many other side affects.
      
      llvm-svn: 152244
      e7612134
  20. Feb 24, 2012
    • Greg Clayton's avatar
      <rdar://problem/10103468> · e72dfb32
      Greg Clayton authored
      I started work on being able to add symbol files after a debug session
      had started with a new "target symfile add" command and quickly ran into
      problems with stale Address objects in breakpoint locations that had 
      lldb_private::Section pointers into modules that had been removed or 
      replaced. This also let to grabbing stale modules from those sections. 
      So I needed to thread harded the Address, Section and related objects.
      
      To do this I modified the ModuleChild class to now require a ModuleSP
      on initialization so that a weak reference can created. I also changed
      all places that were handing out "Section *" to have them hand out SectionSP.
      All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild
      so all of the find plug-in, static creation function and constructors now
      require ModuleSP references instead of Module *. 
      
      Address objects now have weak references to their sections which can
      safely go stale when a module gets destructed. 
      
      This checkin doesn't complete the "target symfile add" command, but it
      does get us a lot clioser to being able to do such things without a high
      risk of crashing or memory corruption.
      
      llvm-svn: 151336
      e72dfb32
  21. Feb 05, 2012
    • Greg Clayton's avatar
      <rdar://problem/10560053> · c9660546
      Greg Clayton authored
      Fixed "target modules list" (aliased to "image list") to output more information
      by default. Modified the "target modules list" to have a few new options:
      
      "--header" or "-h" => show the image header address
      "--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library)
      
      Removed the "--symfile-basename" or "-S" option, and repurposed it to 
      "--symfile-unique" "-S" which will show the symbol file if it differs from
      the executable file.
      
      ObjectFile's can now be loaded from memory for cases where we don't have the
      files cached locally in an SDK or net mounted root. ObjectFileMachO can now
      read mach files from memory.
      
      Moved the section data reading code into the ObjectFile so that the object
      file can get the section data from Process memory if the file is only in
      memory.
      
      lldb_private::Module can now load its object file in a target with a rigid 
      slide (very common operation for most dynamic linkers) by using:
      
      bool 
      Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)
      
      lldb::SBModule() now has a new constructor in the public interface:
      
      SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr);
      
      This will find an appropriate ObjectFile plug-in to load an image from memory
      where the object file header is at "header_addr".
      
      llvm-svn: 149804
      c9660546
  22. Sep 20, 2011
  23. Sep 10, 2011
  24. Sep 09, 2011
Loading