Skip to content
  1. 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
  2. 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
    • Johnny Chen's avatar
      5d77667f
    • Johnny Chen's avatar
      Do not print debug messages if self.TraceON() is False. · 6949f389
      Johnny Chen authored
      llvm-svn: 144945
      6949f389
    • Johnny Chen's avatar
      Add a simple progress bar when neither '-v' nor '-t' is specified. · 316651ab
      Johnny Chen authored
      llvm-svn: 144940
      316651ab
  3. Nov 17, 2011
    • Greg Clayton's avatar
      Use a pseudoterminal for local processes if no STDIO redirection or other · ee95ed50
      Greg Clayton authored
      file actions have been specified.
      
      llvm-svn: 144922
      ee95ed50
    • Johnny Chen's avatar
      Add an option '-S' to skip the build and cleanup while running the test. · 0fddfb2c
      Johnny Chen authored
      Use this option with care as you would need to build the inferior(s) by hand
      and build the executable(s) with the correct name(s).  This option can be used
      with '-# n' to stress test certain test cases for n number of times.
      
      An example:
      
      [11:55:11] johnny:/Volumes/data/lldb/svn/trunk/test/python_api/value $ ls
      Makefile		TestValueAPI.pyc	linked_list
      TestValueAPI.py		change_values		main.c
      [11:55:14] johnny:/Volumes/data/lldb/svn/trunk/test/python_api/value $ make EXE=test_with_dsym
      clang -gdwarf-2 -O0  -arch x86_64   -c -o main.o main.c
      clang -gdwarf-2 -O0  -arch x86_64   main.o -o "test_with_dsym"
      /usr/bin/dsymutil  -o "test_with_dsym.dSYM" "test_with_dsym"
      [11:55:20] johnny:/Volumes/data/lldb/svn/trunk/test/python_api/value $ cd ../..
      [11:55:24] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v -# 10 -S -f ValueAPITestCase.test_with_dsym
      LLDB build dir: /Volumes/data/lldb/svn/trunk/build/Debug
      LLDB-89
      Path: /Volumes/data/lldb/svn/trunk
      URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
      Repository Root: https://johnny@llvm.org/svn/llvm-project
      Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
      Revision: 144914
      Node Kind: directory
      Schedule: normal
      Last Changed Author: gclayton
      Last Changed Rev: 144911
      Last Changed Date: 2011-11-17 09:22:31 -0800 (Thu, 17 Nov 2011)
      
      
      
      Session logs for test failures/errors/unexpected successes will go into directory '2011-11-17-11_55_29'
      Command invoked: python ./dotest.py -v -# 10 -S -f ValueAPITestCase.test_with_dsym
      ----------------------------------------------------------------------
      Collected 1 test
      
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 1.163s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.200s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.198s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.199s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.239s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 1.215s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.105s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.098s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 0.195s
      
      OK
      1: test_with_dsym (TestValueAPI.ValueAPITestCase)
         Exercise some SBValue APIs. ... ok
      
      ----------------------------------------------------------------------
      Ran 1 test in 1.197s
      
      OK
      [11:55:34] johnny:/Volumes/data/lldb/svn/trunk/test $ 
      
      llvm-svn: 144919
      0fddfb2c
    • Greg Clayton's avatar
      Now that I fixed the uninitialized callback problem, I can enable GCD pid · 1c4cd07a
      Greg Clayton authored
      monitoring on darwin in the host layer.
      
      llvm-svn: 144918
      1c4cd07a
    • Johnny Chen's avatar
      Rename test class appropriately. · 14c62c8d
      Johnny Chen authored
      llvm-svn: 144915
      14c62c8d
    • Greg Clayton's avatar
      Bumped Xcode project versions for lldb-89 and debugserver-153. · f9d851b2
      Greg Clayton authored
      llvm-svn: 144911
      f9d851b2
    • Greg Clayton's avatar
      Fixed the issue that was causing our monitor process threads to crash, it · e24c4acf
      Greg Clayton authored
      turned out to be unitialized data in the ProcessLaunchInfo default constructor. 
      Turning on MallocScribble in the environment helped track this down. 
      
      When we launch and attach using the host layer, we now inform the process that
      it shouldn't detach when by calling an accessor.
      
      llvm-svn: 144882
      e24c4acf
    • Greg Clayton's avatar
      Fixed an issue with the pthread_setspecific() where we weren't NULL-ing out · 2637f825
      Greg Clayton authored
      the thread specific data and were destroying the thread specfic data more
      than once.
      
      Also added the ability to ask a lldb::StateType if it is stopped with an
      additional paramter of "must_exist" which means that the state must be a
      stopped state for a process that still exists. This means that eStateExited
      and eStateUnloaded will no longer return true if "must_exist" is set to true.
      
      llvm-svn: 144875
      2637f825
    • Jim Ingham's avatar
      (no commit message) · 78d61488
      Jim Ingham authored
      llvm-svn: 144874
      78d61488
  4. Nov 16, 2011
    • Johnny Chen's avatar
      Docstring clarification. · 8eb14a95
      Johnny Chen authored
      llvm-svn: 144848
      8eb14a95
    • Johnny Chen's avatar
      Also dump the pid of the process launching through the lldbtest.system(*popenargs, **kwargs) API. · 0bd8c311
      Johnny Chen authored
      This helps track down possible zombie processes.
      
      llvm-svn: 144846
      0bd8c311
    • 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
    • Johnny Chen's avatar
      Remove invalid docstring (due to cut-and-paste error). · 5faba0cc
      Johnny Chen authored
      llvm-svn: 144807
      5faba0cc
    • 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
    • Johnny Chen's avatar
      While we are at it, verify that 'my_int_ptr' points to 'g_my_int', using the... · 4c1b0967
      Johnny Chen authored
      While we are at it, verify that 'my_int_ptr' points to 'g_my_int', using the SBTarget.ResolveLoadAddress() to get its SBAddress,
      and SBAddress.GetSymbol() to get the corresponding symbol.
      
      llvm-svn: 144728
      4c1b0967
  5. Nov 15, 2011
    • Johnny Chen's avatar
      Fix objc runtime warnings from the inferior program. · f031bb19
      Johnny Chen authored
      llvm-svn: 144717
      f031bb19
    • Sean Callanan's avatar
      Made Target own a ClangASTSource that will be used · 4bf80d55
      Sean Callanan authored
      to complete types in the scratch AST context.
      
      llvm-svn: 144712
      4bf80d55
    • Sean Callanan's avatar
      Eliminated a compile warning by removing dyn_cast · 100d74e2
      Sean Callanan authored
      where isa is good enough.
      
      llvm-svn: 144704
      100d74e2
    • Sean Callanan's avatar
      Removed the ClangASTImporter pointer from · b4db660c
      Sean Callanan authored
      ClangExpressionDeclMap, which actually uses the
      one it inherits from ClangASTSource.
      
      llvm-svn: 144702
      b4db660c
    • Johnny Chen's avatar
    • Johnny Chen's avatar
      File renaming. · b0571965
      Johnny Chen authored
      llvm-svn: 144693
      b0571965
    • Sean Callanan's avatar
      Fixed a bug where the variable-resolution code · fe5d139b
      Sean Callanan authored
      would occasionally try to resolve the placeholder
      variable used for static data allocation.
      
      llvm-svn: 144677
      fe5d139b
    • Greg Clayton's avatar
      Bumped Xcode project version for lldb-88 and debugserver-152. · 2d8d63a9
      Greg Clayton authored
      llvm-svn: 144616
      2d8d63a9
    • Greg Clayton's avatar
      Added a new class to Process.h: ProcessAttachInfo. This class contains enough · 144f3a9c
      Greg Clayton authored
      info for us to attach by pid, or by name and will also allow us to eventually
      do a lot more powerful attaches. If you look at the options for the "platform
      process list" command, there are many options which we should be able to
      specify. This will allow us to do things like "attach to a process named 'tcsh'
      that has a parent process ID of 123", or "attach to a process named 'x' which
      has an effective user ID of 345". 
      
      I finished up the --shell implementation so that it can be used without the
      --tty option in "process launch". The "--shell" option now can take an 
      optional argument which is the path to the shell to use (or a partial name
      like "sh" which we will find using the current PATH environment variable).
      
      Modified the Process::Attach to use the new ProcessAttachInfo as the sole
      argument and centralized a lot of code that was in the "process attach"
      Execute function so that everyone can take advantage of the powerful new
      attach functionality.
      
      llvm-svn: 144615
      144f3a9c
    • Sean Callanan's avatar
      Pulled in a new version of LLVM/Clang to solve a variety · d5c17edb
      Sean Callanan authored
      of problems with Objective-C object completion.  To go
      along with the LLVM/Clang-side fixes, we have a variety
      of Objective-C improvements.
      
      Fixes include:
      
      - It is now possible to run expressions when stopped in
        an Objective-C class method and have "self" act just
        like "self" would act in the class method itself (i.e.,
        [self classMethod] works without casting the return
        type if debug info is present).  To accomplish this,
        the expression masquerades as a class method added by
        a category.
      
      - Objective-C objects can now provide methods and
        properties and methods to Clang on demand (i.e., the
        ASTImporter sets hasExternalVisibleDecls on Objective-C
        interface objects).
      
      - Objective-C built-in types, which had long been a bone
        of contention (should we be using "id"?  "id*"?), are
        now fetched correctly using accessor functions on
        ClangASTContext.  We inhibit searches for them in the
        debug information.
      
      There are also a variety of logging fixes, and I made two
      changes to the test suite:
      
      - Enabled a test case for Objective-C properties in the
        current translation unit.
      
      - Added a test case for calling Objective-C class methods
        when stopped in a class method.
      
      llvm-svn: 144607
      d5c17edb
Loading