Skip to content
  1. Apr 05, 2013
    • Sean Callanan's avatar
      Factored out memory access into the target process · 5a1af4e6
      Sean Callanan authored
      from IRExecutionUnit into a superclass called
      IRMemoryMap.  IRMemoryMap handles all reading and
      writing, ensuring that areas are kept track of and
      memory is properly cached (and deleted).
      
      Also fixed several cases where we would simply leak
      binary data in the target process over time.  Now
      the expression objects explicitly own their
      IRExecutionUnit and delete it when they go away.  This
      is why I had to modify ClangUserExpression,
      ClangUtilityFunction, and ClangFunction.
      
      As a side effect of this, I am removing the JIT
      mutex for an IRMemoryMap.  If it turns out that we
      need this mutex, I'll add it in then, but right now
      it's just adding complexity.
      
      This is part of a more general project to make
      expressions fully reusable.  The next step is to
      make materialization and dematerialization use
      the IRMemoryMap API rather than writing and
      reading directly from the process's memory. 
      This will allow the IR interpreter to use the
      same data, but in the host's memory, without having
      to use a different set of pointers.
      
      llvm-svn: 178832
      5a1af4e6
  2. Apr 02, 2013
  3. Mar 30, 2013
  4. 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
  5. Mar 19, 2013
    • Sean Callanan's avatar
      Refactored the expression parser so that the IR · 8dfb68e0
      Sean Callanan authored
      and the JITted code are managed by a standalone
      class that handles memory management itself.
      
      I have removed RecordingMemoryManager and
      ProcessDataAllocator, which filled similar roles
      and had confusing ownership, with a common class
      called IRExecutionUnit.  The IRExecutionUnit
      manages all allocations ever made for an expression
      and frees them when it goes away.  It also contains
      the code generator and can vend the Module for an
      expression to other clases.
      
      The end goal here is to make the output of the
      expression parser re-usable; that is, to avoid
      re-parsing when re-parsing isn't necessary.
      
      I've also cleaned up some code and used weak pointers
      in more places.  Please let me know if you see any
      leaks; I checked myself as well but I might have
      missed a case.
      
      llvm-svn: 177364
      8dfb68e0
  6. Mar 09, 2013
  7. Mar 02, 2013
  8. Feb 22, 2013
    • Andrew Kaylor's avatar
      Change to JITDefault code model for ELF targets · cd5c7247
      Andrew Kaylor authored
      On x86-64 platforms, the small code model assumes that code will be loaded below the 2GB boundary.  With the static relocation model, the fact that the expression code is initially loaded (in the LLDB debugger address space) above that boundary causes problems.  Switching to the JITDefault code model causes the large code model to be used for 64-bit targets and small code model of 32-bit targets.
      
      llvm-svn: 175828
      cd5c7247
  9. Feb 21, 2013
  10. Feb 20, 2013
  11. Feb 14, 2013
  12. 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
  13. Jan 22, 2013
  14. Jan 02, 2013
  15. Dec 05, 2012
  16. Nov 29, 2012
  17. Nov 16, 2012
  18. Oct 30, 2012
  19. Oct 24, 2012
  20. Oct 18, 2012
  21. Oct 12, 2012
  22. Sep 25, 2012
    • Sean Callanan's avatar
      Removed some debugging cruft. · c2bd8c21
      Sean Callanan authored
      llvm-svn: 164572
      c2bd8c21
    • Sean Callanan's avatar
      Brought LLDB top-of-tree into sync with LLVM/Clang · 3d654b30
      Sean Callanan authored
      top-of-tree.  Removed all local patches and llvm.zip.
      
      The intent is that fron now on top-of-tree will
      always build against LLVM/Clang top-of-tree, and
      that problems building will be resolved as they
      occur.  Stable release branches of LLDB can be
      constructed as needed and linked to specific release
      branches of LLVM/Clang.
      
      llvm-svn: 164563
      3d654b30
  23. Sep 06, 2012
  24. Aug 09, 2012
  25. Aug 01, 2012
    • Sean Callanan's avatar
      Instructions generated by a disassembler can now · 7e6d4e5a
      Sean Callanan authored
      keep a shared pointer to their disassembler.  This
      is important for the LLVM-C disassembler because
      it needs to lock its parent in order to disassemble
      itself.
      
      This means that every interface that returned a
      Disassembler* needs to return a DisassemblerSP, so
      that the instructions and any external owners share
      the same reference count on the object.  I changed
      all clients to use this shared pointer, which also
      plugged a few leaks.
      
      <rdar://problem/12002822>
      
      llvm-svn: 161123
      7e6d4e5a
  26. Jun 09, 2012
    • Sean Callanan's avatar
      Minor fixes for ARM/iOS targets: · e3333d69
      Sean Callanan authored
      - On iOS, we select the "apcs-gnu" ABI to match
        what libraries expect.
      
      - Literals are now allocated at their preferred
        alignment, eliminating many alignment crashes.
      
      llvm-svn: 158236
      e3333d69
  27. May 16, 2012
    • Sean Callanan's avatar
      Enabled C++11 in the expression parser. auto and · 8d825786
      Sean Callanan authored
      various other syntactic sugar work.  Lambdas do
      not due to some problems relocating code containing
      lambdas.  Rvalue references work when returned from
      expressions, but need more testing.
      
      llvm-svn: 156948
      8d825786
  28. May 10, 2012
    • Greg Clayton's avatar
      <rdar://problem/11330621> · ba812f42
      Greg Clayton authored
      Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size.
      
      Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code.
      
      Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function).
      
      Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions.
      
      llvm-svn: 156532
      ba812f42
  29. Apr 17, 2012
  30. Mar 08, 2012
    • Sean Callanan's avatar
      Updated the revision of LLVM/Clang used by LLDB. · 226b70c1
      Sean Callanan authored
      This takes two important changes:
      
      - Calling blocks is now supported.  You need to
        cast their return values, but that works fine.
      
      - We now can correctly run JIT-compiled
        expressions that use floating-point numbers.
      
      Also, we have taken a fix that allows us to
      ignore access control in Objective-C as in C++.
      
      llvm-svn: 152286
      226b70c1
  31. Mar 01, 2012
  32. 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
  33. Feb 18, 2012
    • Greg Clayton's avatar
      The second part in thread hardening the internals of LLDB where we make · d9e416c0
      Greg Clayton authored
      the lldb_private::StackFrame objects hold onto a weak pointer to the thread
      object. The lldb_private::StackFrame objects the the most volatile objects
      we have as when we are doing single stepping, frames can often get lost or
      thrown away, only to be re-created as another object that still refers to the
      same frame. We have another bug tracking that. But we need to be able to 
      have frames no longer be able to get the thread when they are not part of
      a thread anymore, and this is the first step (this fix makes that possible
      but doesn't implement it yet).
      
      Also changed lldb_private::ExecutionContextScope to return shared pointers to
      all objects in the execution context to further thread harden the internals.
      
      llvm-svn: 150871
      d9e416c0
  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
  35. Jan 24, 2012
  36. Jan 06, 2012
  37. Dec 21, 2011
    • Sean Callanan's avatar
      The "desired result type" code in the expression · 20bb3aa5
      Sean Callanan authored
      parser has hitherto been an implementation waiting
      for a use.  I have now tied the '-o' option for
      the expression command -- which indicates that the
      result is an Objective-C object and needs to be
      printed -- to the ExpressionParser, which
      communicates the desired type to Clang.
      
      Now, if the result of an expression is determined
      by an Objective-C method call for which there is
      no type information, that result is implicitly
      cast to id if and only if the -o option is passed
      to the expression command.  (Otherwise if there
      is no explicit cast Clang will issue an error.
      This behavior is identical to what happened before
      r146756.)
      
      Also added a testcase for -o enabled and disabled.
      
      llvm-svn: 147099
      20bb3aa5
  38. Dec 01, 2011
    • Sean Callanan's avatar
      Picked up a new revision of Clang to pull in Objective-C · a5230ce3
      Sean Callanan authored
      enhancements.  With these enhancements, the return values
      of Objective-C methods with unknown return types can be
      implicitly cast to id for the purpose of making method
      calls.
      
      So what would have required this:
      
      (int)[(id)[ClassWithNoDebugInfo methodReturningObject] methodReturningInt]
      
      can now be written as:
      
      (int)[[ClassWithNoDebugInfo methodReturningObject] methodReturningInt]
      
      llvm-svn: 145567
      a5230ce3
Loading