Skip to content
  1. Nov 29, 2011
  2. Nov 28, 2011
    • Greg Clayton's avatar
      <rdar://problem/10413589> · 129d12c0
      Greg Clayton authored
      Fixed a potential crasher where we weren't checking we got a valid DIE in
      a compile unit.
      
      llvm-svn: 145226
      129d12c0
    • Greg Clayton's avatar
      Now the linux platform lets it be known that it can't launch processes for · cc23eb6f
      Greg Clayton authored
      debugging.
      
      llvm-svn: 145221
      cc23eb6f
    • 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
    • Greg Clayton's avatar
      Fixed an issue in the DWARFLocationList::Dump() function where default · 1abfe04d
      Greg Clayton authored
      arguments were quietly masked as the code changed (modified version of a path
      from Dawn).
      
      llvm-svn: 145216
      1abfe04d
  3. Nov 22, 2011
  4. Nov 21, 2011
    • Greg Clayton's avatar
      Save the arguments for a process launch in the target.run-args so they can · 162b597c
      Greg Clayton authored
      easily be used in the next run.
      
      llvm-svn: 145051
      162b597c
    • Greg Clayton's avatar
      Many GDB users always want to display disassembly when they stop by using · e372b98d
      Greg Clayton authored
      something like "display/4i $pc" (or something like this). With LLDB we already
      were showing 3 lines of source before and 3 lines of source after the current
      source line when showing a stop context. We now improve this by allowing the
      user to control the number of lines with the new "stop-line-count-before" and
      "stop-line-count-after" settings. Also, there is a new setting for how many
      disassembly lines to show: "stop-disassembly-count". This will control how many
      source lines are shown when there is no source or when we have no source line
      info. 
      
      settings set stop-line-count-before 3
      settings set stop-line-count-after 3
      settings set stop-disassembly-count 4
      settings set stop-disassembly-display no-source
      
      The default values are set as shown above and allow 3 lines of source before 
      and after (what we used to do) the current stop location, and will display 4 
      lines of disassembly if the source is not available or if we have no debug
      info. If both "stop-source-context-before" and "stop-source-context-after" are
      set to zero, this will disable showing any source when stopped. The 
      "stop-disassembly-display" setting is an enumeration that allows you to control
      when to display disassembly. It has 3 possible values:
      
      "never" - never show disassembly no matter what
      "no-source" - only show disassembly when there is no source line info or the source files are missing
      "always" - always show disassembly.
      
      llvm-svn: 145050
      e372b98d
    • Peter Collingbourne's avatar
      Update ProcessMonitor::MonitorCallback signature. · 2c67b9a6
      Peter Collingbourne authored
      llvm-svn: 145021
      2c67b9a6
    • Peter Collingbourne's avatar
      Update PlatformLinux::Attach signature. · fb2b629d
      Peter Collingbourne authored
      llvm-svn: 145020
      fb2b629d
  5. Nov 19, 2011
    • Sean Callanan's avatar
      Pulled in a new revision of LLVM/Clang and added · 7f27d604
      Sean Callanan authored
      several patches.  These patches fix a problem
      where templated types were not being completed the
      first time they were used, and fix a variety of
      minor issues I discovered while fixing that problem.
      
      One of the previous local patches was resolved in
      the most recent Clang, so I removed it.  The others
      will be removed in due course.
      
      llvm-svn: 144984
      7f27d604
    • Greg Clayton's avatar
      Further performance improvements in the DWARF parser: · 3b608422
      Greg Clayton authored
      1 - the DIE collections no longer have the NULL tags which saves up to 25%
          of the memory on typical C++ code
      2 - faster parsing by not having to run the SetDIERelations() function anymore
          it is done when parsing the DWARF very efficiently.
      
      llvm-svn: 144983
      3b608422
    • Sean Callanan's avatar
      Ensure that the empty RecordDecl generated for · b5c79621
      Sean Callanan authored
      templates is properly complete (though still
      empty).
      
      llvm-svn: 144982
      b5c79621
    • Jim Ingham's avatar
      Handle stepping through a trampoline where the jump target is calculated a... · 9683ff12
      Jim Ingham authored
      Handle stepping through a trampoline where the jump target is calculated a runtime - and so doesn't match
      the name of the PLT entry.  This solution assumes a naming convention agreed upon by us and the system folks,
      and isn't general.  The general solution requires actually finding & calling the resolver function if it
      hasn't been called yet.  That's more tricky.
      
      llvm-svn: 144981
      9683ff12
  6. Nov 18, 2011
    • Greg Clayton's avatar
      Added optional calls to lldb_private::Process for getting memory region info · 46fb558d
      Greg Clayton authored
      from a process and hooked it up to the new packet that was recently added
      to our GDB remote executable named debugserver. Now Process has the following
      new calls:
      
      virtual Error
      Process::GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info);
      
      virtual uint32_t
      GetLoadAddressPermissions (lldb::addr_t load_addr);
      
      Only the first one needs to be implemented by subclasses that can add this
      support.
      
      Cleaned up the way the new packet was implemented in debugserver to be more
      useful as an API inside debugserver. Also found an error where finding a region
      for an address actually will pick up the next region that follows the address
      in the query so we also need ot make sure that the address we requested the
      region for falls into the region that gets returned.
      
      llvm-svn: 144976
      46fb558d
    • Greg Clayton's avatar
      Looking at our memory usage with Instruments when debugging a large application · 7ba18027
      Greg Clayton authored
      we say that the vectors of DWARFDebugInfoEntry objects were the highest on the
      the list. 
      
      With these changes we cut our memory usage by 40%!!! I did this by reducing
      the size of the DWARFDebugInfoEntry from a previous:
      
      uint32_t offset
      uint32_t parent_idx
      uint32_t sibling_idx
      Abbrev * abbrev_ptr
      
      which was 20 bytes, but rounded up to 24 bytes due to alignment. Now we have:
      
      uint32_t offset
      uint32_t parent_idx
      uint32_t sibling_idx
      uint32_t abbr_idx:15,       // 32767 possible abbreviation codes
               has_children:1,    // 0 = no children, 1 = has children
               tag:16;            // DW_TAG_XXX value
      
      This gets us down to 16 bytes per DIE. I tested some VERY large DWARF files
      (900MB) and found there were only ~700 unique abbreviations, so 32767 should
      be enough for any sane compiler. If it isn't there are built in assertions
      that will fire off and tell us.
      
      llvm-svn: 144975
      7ba18027
    • Sean Callanan's avatar
      This commit completes the rearchitecting of ClangASTSource · 00f43622
      Sean Callanan authored
      to allow variables in the persistent variable store to know
      how to complete themselves from debug information.  That
      fixes a variety of bugs during dematerialization of 
      expression results and also makes persistent variable and
      result variables ($foo, $4, ...) more useful.
      
      I have also added logging improvements that make it much
      easier to figure out how types are moving from place to 
      place, and made some checking a little more aggressive.
      
      The commit includes patches to Clang which are currently being
      integrated into Clang proper; once these fixes are in Clang
      top-of-tree, these patches will be removed.  The patches don't
      fix API; rather, they fix some internal bugs in Clang's 
      ASTImporter that were exposed when LLDB was moving types from
      place to place multiple times.
      
      llvm-svn: 144969
      00f43622
  7. Nov 17, 2011
  8. Nov 16, 2011
    • Sean Callanan's avatar
      Added support to the ASTImporter for passing · b0b87a56
      Sean Callanan authored
      completion information between different AST
      contexts.  It works like this:
      
      - If a Decl is imported from a context that
        has completion metadata, then that Decl
        is associated with the same completion
        information (possibly none) as the Decl
        it was imported from.
      
      - If a Decl is imported from a context that
        does not have completion metadata, then it
        is marked as completable by consulting the
        Decl and context it was imported from.
      
      llvm-svn: 144838
      b0b87a56
    • Sean Callanan's avatar
      Changed the ClangASTImporter to store metadata · f487bd87
      Sean Callanan authored
      for each AST context it knows about in a single
      object.  This makes it faster to look up the
      appropriate ASTImpoter for a given ASTContext
      pair and also makes it much easier to delete all
      metadata for a given AST context.
      
      In the future, this fix will allow the
      ClangASTImporter to propagate completion
      information between the metadata for different
      AST contexts as its minions move AST objects
      around.
      
      llvm-svn: 144835
      f487bd87
    • Sean Callanan's avatar
      Added a CopyType method to the ASTImporter that · 80f7867b
      Sean Callanan authored
      handles opaque QualTypes.
      
      llvm-svn: 144813
      80f7867b
    • Sean Callanan's avatar
      I made the ClangASTImporter owned by the target · 686b2319
      Sean Callanan authored
      rather than individually on behalf of each
      ASTContext.  This allows the ASTImporter to know
      about all containers of types, which will let it
      be smarter about forwarding information about
      type origins.  That means that the following
      sequence of steps will be possible (after a few
      more changes):
      
      - Import a type from a Module's ASTContext into
        an expression parser ASTContext, tracking its
        origin information -- this works now.
      
      - Because the result of the expression uses that
        type, import it from the expression parser
        ASTContext into the Target's scratch AST
        context, forwarding the origin information --
        this needs to be added.
      
      - For a later expression that uses the result,
        import the type from the Target's scratch AST
        context, still forwarding origin information
        -- this also needs to be added.
      
      - Use the intact origin information to complete
        the type as needed -- this works now if the
        origin information is present.
      
      To this end, I made the following changes:
      
      - ASTImporter top-level copy functions now
        require both a source and a destination AST
        context parameter.
      
      - The ASTImporter now knows how to purge
        records related to an ASTContext that is
        going away.
      
      - The Target now owns and creates the ASTImporter
        whenever the main executable changes or (in the
        absence of a main executable) on demand.
      
      llvm-svn: 144802
      686b2319
    • 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
    • Sean Callanan's avatar
      Fixed a problem where the target didn't use a · 6d6acc89
      Sean Callanan authored
      NULL-terminated C string to store the contents
      of the expression prefix file.  This meant that
      expressions, when printing the contents of the
      prefix into the expression's text, would
      invariably put in bad data after the end of the
      expression.
      
      Now, instead, we store the prefix contents in a
      std::string, which handles null-termination
      correctly.
      
      llvm-svn: 144760
      6d6acc89
    • Sean Callanan's avatar
      Fixed a crash when we merrily went on to try to log · ed8d58fc
      Sean Callanan authored
      information about a nonexistent function declaration.
      
      llvm-svn: 144744
      ed8d58fc
    • Sean Callanan's avatar
      Two fixes for Objetive-C methods that return struct · a6cbf06d
      Sean Callanan authored
      types.  First, I added handling for the memset intrinsic
      in the IR, which is used to zero out the returned struct.
      Second, I fixed the object-checking instrumentation
      to objc_msgSend_stret, and generally tightened up how
      the object-checking functions get inserted.
      
      llvm-svn: 144741
      a6cbf06d
  9. Nov 15, 2011
Loading