Skip to content
  1. Jan 10, 2017
  2. Dec 09, 2016
    • Adrian Prantl's avatar
      Fix LLVM's use of DW_OP_bit_piece in DWARF expressions. · baf92110
      Adrian Prantl authored
      LLVM's use of DW_OP_bit_piece is incorrect and a based on a
      misunderstanding of the wording in the DWARF specification. The offset
      argument of DW_OP_bit_piece refers to the offset into the location
      that is on the top of the DWARF expression stack, and not an offset
      into the source variable. This has since also been clarified in the
      DWARF specification.
      
      This patch fixes all uses of DW_OP_bit_piece to emit the correct
      offset and simplifies the DwarfExpression class to semi-automaticaly
      emit empty DW_OP_pieces to adjust the offset of the source variable,
      thus simplifying the code using DwarfExpression.
      
      While this is an incompatible bugfix, in practice I don't expect this
      to be much of a problem since LLVM's old interpretation and the
      correct interpretation of DW_OP_bit_piece differ only when there are
      gaps in the fragmented locations of the described variables or if
      individual fragments are smaller than a byte. LLDB at least won't
      interpret locations with gaps in them because is has no way to present
      undefined bits in a variable, and there is a high probability that an
      old-form expression will be malformed when interpreted correctly,
      because the DW_OP_bit_piece offset will be outside of the location at
      the top of the stack.
      
      As a nice side-effect, this patch enables us to use a more efficient
      encoding for subregisters: In order to express a sub-register at a
      non-zero offset we now use a DW_OP_bit_piece instead of shifting the
      value into place manually.
      
      This patch also adds missing test coverage for code paths that weren't
      exercised before.
      
      <rdar://problem/29335809>
      Differential Revision: https://reviews.llvm.org/D27550
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289266 91177308-0d34-0410-b5e6-96231b3b80d8
      baf92110
  3. Dec 05, 2016
    • Adrian Prantl's avatar
      [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation · 460dd60c
      Adrian Prantl authored
      so we can stop using DW_OP_bit_piece with the wrong semantics.
      
      The entire back story can be found here:
      http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161114/405934.html
      
      The gist is that in LLVM we've been misinterpreting DW_OP_bit_piece's
      offset field to mean the offset into the source variable rather than
      the offset into the location at the top the DWARF expression stack. In
      order to be able to fix this in a subsequent patch, this patch
      introduces a dedicated DW_OP_LLVM_fragment operation with the
      semantics that we used to apply to DW_OP_bit_piece, which is what we
      actually need while inside of LLVM. This patch is complete with a
      bitcode upgrade for expressions using the old format. It does not yet
      fix the DWARF backend to use DW_OP_bit_piece correctly.
      
      Implementation note: We discussed several options for implementing
      this, including reserving a dedicated field in DIExpression for the
      fragment size and offset, but using an...
      460dd60c
  4. Dec 02, 2016
  5. Dec 01, 2016
    • Greg Clayton's avatar
      This change removes the dependency on DwarfDebug that was used for... · fc1fc8ba
      Greg Clayton authored
      This change removes the dependency on DwarfDebug that was used for DW_FORM_ref_addr by making a new DIEUnit class in DIE.cpp.
      
      The DIEUnit class represents a compile or type unit and it owns the unit DIE as an instance variable. This allows anyone with a DIE, to get the unit DIE, and then get back to its DIEUnit without adding any new ivars to the DIE class. Why was this needed? The DIE class has an Offset that is always the CU relative DIE offset, not the "offset in debug info section" as was commented in the header file (the comment has been corrected). This is great for performance because most DIE references are compile unit relative and this means most code that accessed the DIE's offset didn't need to make it into a compile unit relative offset because it already was. When we needed to emit a DW_FORM_ref_addr though, we needed to find the absolute offset of the DIE by finding the DIE's compile/type unit. This class did have the absolute debug info/type offset and could be added to the CU relative offset to compute the absolute offset. With this change we can easily get back to a DIE's DIEUnit which will have this needed offset. Prior to this is required having a DwarfDebug and required calling:
      
      DwarfCompileUnit *DwarfDebug::lookupUnit(const DIE *CU) const;
      Now we can use the DIEUnit class to do so without needing DwarfDebug. All clients now use DIEUnit objects (the DwarfDebug stack and the DwarfLinker). A follow on patch for the DWARF generator will also take advantage of this.
      
      Differential Revision: https://reviews.llvm.org/D27170
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288399 91177308-0d34-0410-b5e6-96231b3b80d8
      fc1fc8ba
  6. Nov 28, 2016
  7. Nov 23, 2016
  8. Nov 03, 2016
  9. Oct 31, 2016
  10. Oct 26, 2016
  11. Oct 20, 2016
  12. Oct 18, 2016
  13. Aug 25, 2016
  14. Aug 17, 2016
  15. Jul 12, 2016
  16. Jul 09, 2016
  17. Jun 08, 2016
    • Reid Kleckner's avatar
      [DebugInfo] Add calling convention support for DWARF and CodeView · 3d3aca2d
      Reid Kleckner authored
      Summary:
      Now DISubroutineType has a 'cc' field which should be a DW_CC_ enum.  If
      it is present and non-zero, the backend will emit it as a
      DW_AT_calling_convention attribute. On the CodeView side, we translate
      it to the appropriate enum for the LF_PROCEDURE record.
      
      I added a new LLVM vendor specific enum to the list of DWARF calling
      conventions. DWARF does not appear to attempt to standardize these, so I
      assume it's OK to do this until we coordinate with GCC on how to emit
      vectorcall convention functions.
      
      Reviewers: dexonsmith, majnemer, aaboud, amccarth
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D21114
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272197 91177308-0d34-0410-b5e6-96231b3b80d8
      3d3aca2d
  18. May 24, 2016
    • David Blaikie's avatar
      DWARF: Omit DW_AT_APPLE attributes (except ObjC ones) when not targeting LLDB · d455d52b
      David Blaikie authored
      These attributes aren't used by other debuggers (& may be confused with
      other DWARF extensions) so they just waste space (about 1.5% on .dwo
      file size on a random large program I tested).
      
      We could remove the ObjC property ones too, but I figured they were
      probably more necessary when trying to understand ObjC (I could be wrong
      though) & so any debugger interested in working with ObjC would use
      them, perhaps? (also, there are some legacy tests in Clang that test for
      them - making it one of those annoying cross-project commits and/or
      cleanup to refactor those tests)
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270613 91177308-0d34-0410-b5e6-96231b3b80d8
      d455d52b
  19. May 20, 2016
  20. May 17, 2016
  21. May 16, 2016
  22. Apr 30, 2016
  23. Apr 29, 2016
  24. Apr 28, 2016
  25. Apr 23, 2016
    • Duncan P. N. Exon Smith's avatar
      DebugInfo: Remove MDString-based type references · de748403
      Duncan P. N. Exon Smith authored
      Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around
      DIType*.  It is no longer legal to refer to a DICompositeType by its
      'identifier:', and DIBuilder no longer retains all types with an
      'identifier:' automatically.
      
      Aside from the bitcode upgrade, this is mainly removing logic to resolve
      an MDString-based reference to an actualy DIType.  The commits leading
      up to this have made the implicit type map in DICompileUnit's
      'retainedTypes:' field superfluous.
      
      This does not remove DITypeRef, DIScopeRef, DINodeRef, and
      DITypeRefArray, or stop using them in DI-related metadata.  Although as
      of this commit they aren't serving a useful purpose, there are patchces
      under review to reuse them for CodeView support.
      
      The tests in LLVM were updated with deref-typerefs.sh, which is attached
      to the thread "[RFC] Lazy-loading of debug info metadata":
      
        http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267296 91177308-0d34-0410-b5e6-96231b3b80d8
      de748403
  26. Apr 18, 2016
  27. Mar 24, 2016
  28. Mar 17, 2016
  29. Mar 14, 2016
  30. Feb 23, 2016
  31. Feb 11, 2016
    • Peter Collingbourne's avatar
      DwarfDebug: emit type units immediately. · cb444063
      Peter Collingbourne authored
      Rather than storing type units in a vector and emitting them at the end
      of code generation, emit them immediately and destroy them, reclaiming the
      memory we were using for their DIEs.
      
      In one benchmark carried out against Chromium's 50 largest (by bitcode
      file size) translation units, total peak memory consumption with type units
      decreased by median 17%, or by 7% when compared against disabling type units.
      
      Tested using check-{llvm,clang}, the GDB 7.5 test suite (with
      '-fdebug-types-section') and by eyeballing llvm-dwarfdump output on those
      Chromium translation units with split DWARF both disabled and enabled, and
      verifying that the only changes were to addresses and abbreviation ordering.
      
      Differential Revision: http://reviews.llvm.org/D17118
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260578 91177308-0d34-0410-b5e6-96231b3b80d8
      cb444063