Skip to content
  1. May 31, 2013
  2. May 24, 2013
  3. May 02, 2013
  4. Apr 27, 2013
    • Sean Callanan's avatar
      Performance optimizations to ClangUserExpression, · df56540a
      Sean Callanan authored
      mostly related to management of the stack frame
      for the interpreter.
      
        - First, if the expression can be interpreted,
          allocate the stack frame in the target process
          (to make sure pointers are valid) but only
          read/write to the copy in the host's memory.
      
        - Second, keep the memory allocations for the
          stack frame and the materialized struct as
          member variables of ClangUserExpression.  This
          avoids memory allocations and deallocations
          each time the expression runs.
      
      <rdar://problem/13043685>
      
      llvm-svn: 180664
      df56540a
  5. Apr 25, 2013
  6. Apr 20, 2013
  7. Apr 19, 2013
    • Sean Callanan's avatar
      Removed 2800+ lines of code that no longer do anything · 44342735
      Sean Callanan authored
      now that the IR interpreter and the JIT share the same
      materialization codepaths.
      
      llvm-svn: 179842
      44342735
    • Sean Callanan's avatar
      This commit changes the way LLDB executes user · 1582ee68
      Sean Callanan authored
      expressions.  
      
      Previously, ClangUserExpression assumed that if
      there was a constant result for an expression 
      then it could be determined during parsing.  In
      particular, the IRInterpreter ran while parser
      state (in particular, ClangExpressionDeclMap) 
      was present.  This approach is flawed, because
      the IRInterpreter actually is capable of using
      external variables, and hence the result might
      be different each run.  Until now, we papered
      over this flaw by re-parsing the expression each
      time we ran it.
      
      I have rewritten the IRInterpreter to be 
      completely independent of the ClangExpressionDeclMap.
      Instead of special-casing external variable lookup,
      which ties the IRInterpreter closely to LLDB,
      we now interpret the exact same IR that the JIT
      would see.  This IR assumes that materialization
      has occurred; hence the recent implementation of the
      Materializer, which does not require parser state
      (in the form of ClangExpressionDeclMap) to be 
      present.
      
      Materialization, interpretation, and dematerialization
      are now all independent of parsing.  This means that
      in theory we can parse expressions once and run them
      many times.  I have three outstanding tasks before
      shutting this down:
      
          - First, I will ensure that all of this works with
            core files.  Core files have a Process but do not
            allow allocating memory, which currently confuses
            materialization.
      
          - Second, I will make expression breakpoint 
            conditions remember their ClangUserExpression and
            re-use it.
      
          - Third, I will tear out all the redundant code
            (for example, materialization logic in
            ClangExpressionDeclMap) that is no longer used.
      
      While implementing this fix, I also found a bug in
      IRForTarget's handling of floating-point constants.  
      This should be fixed.
      
      llvm-svn: 179801
      1582ee68
  8. 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
  9. Apr 17, 2013
    • Sean Callanan's avatar
      Added a new API to the IRInterpreter (the old API · 14cb2aaa
      Sean Callanan authored
      will be gone soon!) that lets it interpret a function
      using just an llvm::Module, an llvm::Function, and a
      MemoryMap.
      
      Also added an API to IRExecutionUnit to get at its
      llvm::Function, so that the IRInterpreter can work
      with it.
      
      llvm-svn: 179704
      14cb2aaa
    • Sean Callanan's avatar
      Made the IRInterpreter's methods static, since · 182bd6c0
      Sean Callanan authored
      it doesn't actually hold any important state.
      
      llvm-svn: 179702
      182bd6c0
    • Sean Callanan's avatar
      Made the IRInterpreter be able to operate without · 175187b3
      Sean Callanan authored
      a ClangExpressionDeclMap.  Any functions that
      require value resolution etc. fail if the
      ClangExpressionDeclMap isn't present - which is
      exactly what is desired.
      
      llvm-svn: 179695
      175187b3
    • Sean Callanan's avatar
      Updated the IRInterpreter to work with an · 08052afa
      Sean Callanan authored
      IRMemoryMap rather than through its own memory
      abstraction.  This considerably simplifies the
      code, and makes it possible to run the
      IRInterpreter multiple times on an already-parsed
      expression in the absence of a ClangExpressionDeclMap.
      
      Changes include:
      
        - ClangExpressionDeclMap's interface methods
          for the IRInterpreter now take IRMemoryMap
          arguments.  They are not long for this world,
          however, since the IRInterpreter will soon be
          working with materialized variables.
      
        - As mentioned above, removed the Memory class
          from the IR interpreter altogether.  It had a
          few functions that remain useful, such as
          keeping track of Values that have been placed
          in memory, so I moved those into methods on
          InterpreterStackFrame.
      
        - Changed IRInterpreter to work with lldb::addr_t
          rather than Memory::Region as its primary
          currency.
      
        - Fixed a bug in the IRMemoryMap where it did not
          report correct address byte size and byte order
          if no process was present, because it was using
          Target::GetDefaultArchitecture() rather than
          Target::GetArchitecture().
      
        - Made IRMemoryMap methods clear the Errors they
          receive before running.  Having to do this by
          hand is just annoying.
      
      The testsuite seems happy with these changes, but
      please let me know if you see problems (especially
      in use cases without a process).
      
      llvm-svn: 179675
      08052afa
    • Sean Callanan's avatar
      Modified the IRInterpreter to take an IRMemoryMap. · 179b5485
      Sean Callanan authored
      It doesn't use it yet; the next step is to make it
      use the IRMemoryMap instead of its own conjured-up
      Memory class.
      
      llvm-svn: 179650
      179b5485
  10. Mar 28, 2013
    • Greg Clayton's avatar
      <rdar://problem/13521159> · 5160ce5c
      Greg Clayton authored
      LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.
      
      All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.
      
      llvm-svn: 178191
      5160ce5c
  11. Mar 19, 2013
  12. Feb 16, 2013
  13. Feb 07, 2013
  14. 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
  15. Jan 09, 2013
  16. Jan 02, 2013
  17. Dec 21, 2012
  18. Dec 11, 2012
    • Sean Callanan's avatar
      Fixed the IRInterpreter's handling of "this" and · 496970f6
      Sean Callanan authored
      "self" when those pointers are in registers.
      Previously in this case the IRInterpreter would
      handle them just as if the user had typed in
      "$rdi", which isn't safe because $rdi is passed
      in through the argument struct.
      
      Now we correctly break out all three cases (i.e.,
      normal variables in registers, $reg, and this/self),
      and handle them in a way that's a little bit easier
      to read and change.
      
      This results in more accurate printing of "this" and
      "self" pointers all around.  I have strengthened the
      optimized-code test case for Objective-C to ensure
      that we catch regressions in this area reliably in
      the future.
      
      <rdar://problem/12693963>
      
      llvm-svn: 169924
      496970f6
  19. Dec 07, 2012
    • Daniel Malea's avatar
      Fix a few more clang (3.2) warnings on Linux: · a85e6b6c
      Daniel Malea authored
      - remove unused members
      - add NO_PEDANTIC to selected Makefiles
      - fix return values (removed NULL as needed)
      - disable warning about four-char-constants
      - remove unneeded const from operator*() declaration
      - add missing lambda function return types
      - fix printf() with no format string
      - change sizeof to use a type name instead of variable name
      - fix Linux ProcessMonitor.cpp to be 32/64 bit friendly
      - disable warnings emitted by swig-generated C++ code
      
      Patch by Matt Kopec!
      
      llvm-svn: 169645
      a85e6b6c
  20. Dec 01, 2012
  21. Nov 29, 2012
  22. Oct 30, 2012
    • Greg Clayton's avatar
      Path from Ashok Thirumurthi: · 0665a0f0
      Greg Clayton authored
      The attached patch adds eValueTypeVector to lldb_private::Value.  The nested struct Vector is patterned after RegisterValue::m_data.buffer.  This change to Value allows ClangExpressionDeclMap::LookupDecl to return vector register data for consumption by InterpreterStackFrame::ResolveValue.  Note that ResolveValue was tweaked slightly to allocate enough memory for vector registers.
       
      An immediate result of this patch is that "expr $xmm0" generates the same results on Linux as on the Mac, which is good enough for TestRegisters.py.  In addition, the log of m_memory.PrintData(data_region.m_base, data_region.m_extent) shows that the register content has been resolved successfully.  On the other hand, the output is glaringly empty:
          runCmd: expr $xmm0
          output: (unsigned char __attribute__((ext_vector_type(16)))) $0 = {}
          Expecting sub string: vector_type
          Matched
      
      llvm-svn: 167033
      0665a0f0
  23. Oct 12, 2012
  24. Oct 11, 2012
  25. Oct 08, 2012
  26. Aug 11, 2012
  27. Aug 09, 2012
  28. Jul 17, 2012
  29. Apr 23, 2012
  30. Mar 14, 2012
    • Greg Clayton's avatar
      <rdar://problem/10434005> · d64afba5
      Greg Clayton authored
      Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind
      macros that allows us to easily compile for either C++.
      
      llvm-svn: 152698
      d64afba5
  31. Feb 29, 2012
  32. Feb 15, 2012
  33. Feb 08, 2012
    • Sean Callanan's avatar
      The IRInterpreter's constant evaluator wasn't · 94a9a39e
      Sean Callanan authored
      sufficiently general - it could only handle
      literals and operations that didn't change the
      data.  Now the constant evaluator passes APInt
      values around, and can handle GetElementPtr
      constants.
      
      llvm-svn: 150034
      94a9a39e
  34. Feb 04, 2012
    • Sean Callanan's avatar
      I have brought LLDB up-to-date with top of tree · 5b26f27f
      Sean Callanan authored
      LLVM/Clang.  This brings in several fixes, including:
      
      - Improvements in the Just-In-Time compiler's
        allocation of memory: the JIT now allocates
        memory in chunks of sections, improving its
        ability to generate relocations.  I have
        revamped the RecordingMemoryManager to reflect
        these changes, as well as to get the memory
        allocation and data copying out fo the
        ClangExpressionParser code.  Jim Grosbach wrote
        the updates to the JIT on the LLVM side.
      
      - A new ExternalASTSource interface to allow LLDB to
        report accurate structure layout information to
        Clang.  Previously we could only report the sizes
        of fields, not their offsets.  This meant that if
        data structures included field alignment
        directives, we could not communicate the necessary
        alignment to Clang and accesses to the data would
        fail.  Now we can (and I have update the relevant
        test case).  Thanks to Doug Gregor for implementing
        the Clang side of this fix.
      
      - The way Objective-C interfaces are completed by
        Clang has been made consistent with RecordDecls;
        with help from Doug Gregor and Greg Clayton I have
        ensured that this still works.
      
      - I have eliminated all local LLVM and Clang patches,
        committing the ones that are still relevant to LLVM
        and Clang as needed.
      
      I have tested the changes extensively locally, but
      please let me know if they cause any trouble for you.
      
      llvm-svn: 149775
      5b26f27f
Loading