Skip to content
  1. Nov 08, 2012
    • Enrico Granata's avatar
      <rdar://problem/12586350> · 1759848b
      Enrico Granata authored
      This commit does three things:
      (a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions
      whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress
      (b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action
      of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting
      the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds
      (c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment:
       - the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself)
       - if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine
      
      llvm-svn: 167569
      1759848b
  2. Oct 22, 2012
    • Greg Clayton's avatar
      <rdar://problem/12473003> · 7bc31332
      Greg Clayton authored
      Allow type searches to specify a type keyword when searching for type. Currently supported type keywords are: struct, class, union, enum, and typedef.
      
      So now you can search for types with a string like "struct foo".
      
      llvm-svn: 166420
      7bc31332
  3. Oct 16, 2012
  4. Oct 09, 2012
  5. Oct 02, 2012
    • Greg Clayton's avatar
      <rdar://problem/11791234> · 548e9a3e
      Greg Clayton authored
      Shared libraries on MacOSX were not properly being removed from the shared
      module list when re-running a debug session due to an error in:
      
      Module::MatchesModuleSpec()
      
      llvm-svn: 164991
      548e9a3e
  6. Sep 18, 2012
  7. Sep 04, 2012
  8. Aug 29, 2012
    • Greg Clayton's avatar
      <rdar://problem/11757916> · 1f746071
      Greg Clayton authored
      Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
      - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". 
      - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
      - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
      - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
      
      Cleaned up header includes a bit as well.
      
      llvm-svn: 162860
      1f746071
  9. Jul 13, 2012
    • Greg Clayton's avatar
      <rdar://problem/11740973> · 1d60909e
      Greg Clayton authored
      Fixed issues that could happen when the UUID doesn't change in a binary and old stale debug info could end up being used.
      
      llvm-svn: 160145
      1d60909e
  10. Jul 07, 2012
  11. Jul 06, 2012
  12. Apr 24, 2012
    • Greg Clayton's avatar
      Added the ability to log a message with a backtrace when verbose logging is... · d61c0fc0
      Greg Clayton authored
      Added the ability to log a message with a backtrace when verbose logging is enabled to the Module class. Used this new function in the DWARF parser.
      
      llvm-svn: 155404
      d61c0fc0
    • Greg Clayton's avatar
      <rdar://problem/11282938> · 2dafd8ed
      Greg Clayton authored
      Fixed an issue where we get NULL compile units back from the symbol vendor. We need symbol vendors to be able to quickly give an estimate of the compile units that they have without having to fully vette them first, so anyone getting compile units from a module should be able to deal with a NULL compile unit being returned for a given index.
      
      llvm-svn: 155398
      2dafd8ed
  13. Apr 20, 2012
  14. Apr 09, 2012
    • Greg Clayton's avatar
      <rdar://problem/11202426> · 0cd70866
      Greg Clayton authored
      Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause.
      
      llvm-svn: 154339
      0cd70866
  15. Mar 27, 2012
    • Greg Clayton's avatar
      lldb_private::Section objects have a boolean flag that can be set that · 741f3f9a
      Greg Clayton authored
      indicates that the section is thread specific. Any functions the load a module
      given a slide, will currently ignore any sections that are thread specific.
      
      lldb_private::Section now has:
      
      bool
      Section::IsThreadSpecific () const
      {
          return m_thread_specific;
      }
      
      void
      Section::SetIsThreadSpecific (bool b)
      {
          m_thread_specific = b;
      }
      
      The ELF plug-in has been modified to set this for the ".tdata" and the ".tbss"
      sections.
      
      Eventually we need to have each lldb_private::Thread subclass be able to 
      resolve a thread specific section, but for now they will just not resolve. The
      code for that should be trivual to add, but the address resolving functions
      will need to be changed to take a "ExecutionContext" object instead of just
      a target so that thread specific sections can be resolved.
      
      llvm-svn: 153537
      741f3f9a
    • Greg Clayton's avatar
      <rdar://problem/11113279> · 84db9105
      Greg Clayton authored
      Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 
      
      This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.
      
      This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.
      
      llvm-svn: 153482
      84db9105
  16. Mar 19, 2012
    • Greg Clayton's avatar
      <rdar://problem/11072382> · f9be6933
      Greg Clayton authored
      Fixed a case where the source path remappings on the module were too expensive to
      use when we try to verify (stat the file system) that the remapped path points to
      a valid file. Now we will use the lldb_private::Module path remappings (if any) when
      parsing the debug info without verifying that the paths exist so we don't slow down
      line table parsing speeds.
      
      llvm-svn: 153059
      f9be6933
  17. Mar 15, 2012
    • Greg Clayton's avatar
      <rdar://problem/8196933> · d804d285
      Greg Clayton authored
      Use the metadata in the dSYM bundle Info.plist to remap source paths when they keys are available.
      
      llvm-svn: 152836
      d804d285
  18. Feb 26, 2012
    • Greg Clayton's avatar
      Made a ModuleSpec class in Module.h which can specify a module using one or · b9a01b39
      Greg Clayton authored
      more of the local path, platform path, associated symbol file, UUID, arch,
      object name and object offset. This allows many of the calls that were
      GetSharedModule to reduce the number of arguments that were used in a call
      to these functions. It also allows a module to be created with a ModuleSpec
      which allows many things to be specified prior to any accessors being called
      on the Module class itself. 
      
      I was running into problems when adding support for "target symbol add"
      where you can specify a stand alone debug info file after debugging has started
      where I needed to specify the associated symbol file path and if I waited until
      after construction, the wrong  symbol file had already been located. By using
      the ModuleSpec it allows us to construct a module with as little or as much
      information as needed and not have to change the parameter list.
      
      llvm-svn: 151476
      b9a01b39
  19. Feb 24, 2012
    • Greg Clayton's avatar
      Fixed a crasher that was happening after making ObjectFile objects have a · c7f09cca
      Greg Clayton authored
      weak reference back to the Module. We were crashing when trying to make a
      memory object file since it was trying to get the object in the Module 
      constructor before the "Module *" had been put into a shared pointer, and the
      module was trying to initialize a weak pointer back to it.
      
      llvm-svn: 151397
      c7f09cca
    • 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
  20. Feb 10, 2012
  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. Jan 29, 2012
    • Greg Clayton's avatar
      Switching back to using std::tr1::shared_ptr. We originally switched away · e1cd1be6
      Greg Clayton authored
      due to RTTI worries since llvm and clang don't use RTTI, but I was able to 
      switch back with no issues as far as I can tell. Once the RTTI issue wasn't
      an issue, we were looking for a way to properly track weak pointers to objects
      to solve some of the threading issues we have been running into which naturally
      led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared 
      pointer from just a pointer, which is also easily solved using the 
      std::tr1::enable_shared_from_this class. 
      
      The main reason for this move back is so we can start properly having weak
      references to objects. Currently a lldb_private::Thread class has a refrence
      to its parent lldb_private::Process. This doesn't work well when we now hand
      out a SBThread object that contains a shared pointer to a lldb_private::Thread
      as this SBThread can be held onto by external clients and if they end up
      using one of these objects we can easily crash.
      
      So the next task is to start adopting std::tr1::weak_ptr where ever it makes
      sense which we can do with lldb_private::Debugger, lldb_private::Target,
      lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and
      many more objects now that they are no longer using intrusive ref counted
      pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive
      pointers).
      
      llvm-svn: 149207
      e1cd1be6
  23. Jan 27, 2012
  24. Jan 12, 2012
  25. Jan 11, 2012
  26. 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
  27. Dec 14, 2011
  28. Nov 28, 2011
    • Greg Clayton's avatar
      CommandObjectProcess was recently changed to automatically use the platform · c982b3d6
      Greg Clayton authored
      to launch a process for debugging. Since this isn't supported on all platforms,
      we need to do what we used to do if this isn't supported. I added:
      
          bool
          Platform::CanDebugProcess ();
          
      This will get checked before trying to launch a process for debugging and then
      fall back to launching the process through the current host debugger. This
      should solve the issue for linux and keep the platform code clean.
      
      Centralized logging code for logging errors, warnings and logs when reporting
      things for modules or symbol files. Both lldb_private::Module and 
      lldb_private::SymbolFile now have the following member functions:
      
          void                    
          LogMessage (Log *log, const char *format, ...);
      
          void
          ReportWarning (const char *format, ...);
      
          void
          ReportError (const char *format, ...);
      
      These will all output the module name and object (if any) such as:
      
          "error: lldb.so ...."
          "warning: my_archive.a(foo.o) ...."
          
      This will keep the output consistent and stop a lot of logging calls from 
      having to try and output all of the information that uniquely identifies
      a module or symbol file. Many places in the code were grabbing the path to the
      object file manually and if the module represented a .o file in an archive, we
      would see log messages like:
      
          error: foo.a - some error happened
      
      llvm-svn: 145219
      c982b3d6
  29. Nov 01, 2011
  30. Oct 13, 2011
  31. Oct 12, 2011
  32. Sep 21, 2011
  33. Sep 20, 2011
  34. Sep 18, 2011
    • Greg Clayton's avatar
      Don't put modules for .o files into the global shared module list. We · 762f7135
      Greg Clayton authored
      used to do this because we needed to find the shared pointer for a .o
      file when the .o file's module was needed in a SymbolContext since the
      module in a symbol context was a shared pointer. Now that we are using
      intrusive pointers we don't have this limitation anymore since any
      instrusive shared pointer can be made from a pointer to an object
      all on its own.
      
      Also switched over to having the Module and SymbolVendor use shared 
      pointers to their object files as had a leak on MacOSX when the 
      SymbolVendor's object file wasn't the same as the Module's (debug info
      in a stand along file (dSYM file)). Now everything will correctly clean
      itself up when the module goes away after an executable gets rebuilt.
      
      Now we correctly get rid of .o files that are used with the DWARF with 
      debug map executables on subsequent runs since the only shared pointer
      to the object files in from the DWARF symbol file debug map parser, and
      when the module gets replaced, it destroys to old one along with all .o 
      files. 
      
      Also added a small optimization when using BSD archives where we will
      remove old BSD containers from the shared list when they are outdated.
      
      llvm-svn: 140002
      762f7135
Loading