Skip to content
  1. Oct 05, 2013
  2. Oct 04, 2013
    • Eric Christopher's avatar
      Temporarily revert r176882 as it needs to be implemented in a different · c19d6f09
      Eric Christopher authored
      way for all platforms.
      
      llvm-svn: 191975
      c19d6f09
    • Eric Christopher's avatar
      Temporarily revert r191792 as it is causing some LTO debug failures · e595bae4
      Eric Christopher authored
      on platforms with relocations in debug info and also temporarily
      revert r191800 due to conflicts with the revert of r191792.
      
      llvm-svn: 191967
      e595bae4
    • David Blaikie's avatar
      DebugInfo: Fix ordering of members after r191928 · 309ffe40
      David Blaikie authored
      In the case (shown in the attached test) where a member function
      definition was emitted into debug info the following could occur:
      
      1) build the debug info for the member function definition
      2) in (1), build the debug info for the member function declaration
      3) construct and add the member function declaration DIE
      4) add it to its context
      5) build its context (the type it is a member of)
      6) construct the members and add them to the type
      7) except don't add member functions because "getOrCreateSubprogram"
      adds the function to its parent anyway
      8) except we're only partway through building this subprogram
      declaration so it hasn't been added yet - but we returned the partially
      constructed DIE (since it's already in the MDNode->DIE mapping to avoid
      infinitely recursing trying to create the member function DIE)
      9) once the type is constructed, add the member function to it
      10) now the members are out of order (the member function being defined
      is listed as the last member, even though it was declared as the first)
      
      To avoid this, construct the context of the subprogram DIE before we
      query to see if it exists. That way we never end up creating it before
      creating its context and ending up in this situation.
      
      Alternatively, the type construction that visits/builds all the members
      could call something like getOrCreateSubprogram, but that doesn't ever
      do the "add to context" step. Then the type building code would always
      be responsible for adding members (and the subprogram "addToContextDIE"
      would no-op because the context building would have added the subprogram
      declaration to the type/context DIE already).
      
      (the test cases updated were overly-sensitive to offsets or abbreviation
      numbers. We don't have a nice way to make these tests more robust as yet
      - multiline FileCheck matches would be required)
      
      llvm-svn: 191939
      309ffe40
    • Richard Mitton's avatar
      Fixed a bug with section names containing special characters. · c2508247
      Richard Mitton authored
      Changed the dwarf aranges code to not use getLabelEndName, as it turns out it's not reliable to call that given user-defined section names. Section names can have characters in that aren't representable as symbol names.
      
      The dwarf-aranges test case has been updated to include a special character, to check this.
      
      This fixes pr17416.
      
      llvm-svn: 191932
      c2508247
  3. Oct 03, 2013
    • David Blaikie's avatar
      DebugInfo: Avoid redundantly adding child DIEs to parents. · 811bfe63
      David Blaikie authored
      DIE::addChild had a shortcircuit that silently no-op'd when a child was
      readded to the same parent. This hid some quirky/redundant code in
      DwarfDebug/CompileUnit. By removing that functionality and replacing it
      with an assert I was able to find and cleanup those cases, mostly
      centering around adding members to types in various circumstances.
      
      1) The original oddity I noticed while working on type units (which
      actually was helping me in the short term, by accident) was the
      addToContextOwner call in constructTypeDIE. This call was completely
      bogus (why was it only done for non-virtual types? what relevance does
      that have at all) and redundant with the more uniform addToContextOwner
      made in getOrCreateTypeDIE.
      
      2) If a member function definition was visited (createSubprogramDIE), it
      would attempt to build the member function declaration. The declaration
      DIE would then be added to its context, but in building the context (the
      type for which this function is a member) the members of the type would
      be added to the type automatically, so by the time the context was
      constructed, the member function was already associated with it.
      
      3) The same as (2) but without the member function being constructed
      first. Whenever a type was constructed, the members would be created and
      member functions would be created by getOrCreateSubprogramDIE - this
      would lead to the subprogram being added to the (incomplete) type
      already, then the general member-construction code would add it again.
      
      llvm-svn: 191928
      811bfe63
    • Matt Arsenault's avatar
      Rename DataLayout variables TD -> DL · 40dddd71
      Matt Arsenault authored
      llvm-svn: 191927
      40dddd71
    • Eric Christopher's avatar
      Make sure we emit a section for pubnames even if that section is · c948b9df
      Eric Christopher authored
      going to be empty. This is particularly important for the gnu
      pubnames case since we're emitting a relocation to the section.
      
      llvm-svn: 191915
      c948b9df
    • Eric Christopher's avatar
      Fix cut and paste typo. · f976c77e
      Eric Christopher authored
      llvm-svn: 191914
      f976c77e
    • Alexey Samsonov's avatar
      Remove wild .debug_aranges entries generated from unimportant labels · 4436bf03
      Alexey Samsonov authored
      r191052 added emitting .debug_aranges to Clang, but this
      functionality is broken: it uses all MC labels added in DWARF Asm
      printer, including the labels for build relocations between
      different DWARF sections, like .Lsection_line or .Ldebug_loc0.
      
      As a result, if any DIE .debug_info would contain "DW_AT_location=0x123"
      attribute, .debug_aranges would also contain a range starting from 0x123,
      breaking tools that rely on this section.
      
      This patch fixes this by using only MC labels that corresponds to the
      addresses in the user program.
      
      llvm-svn: 191884
      4436bf03
  4. Oct 02, 2013
    • Manman Ren's avatar
      Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_type · 9a0a6703
      Manman Ren authored
      is updated to use DITypeRef.
      
      Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static
      helper functions in DwarfCompileUnit. We already have a static helper function
      "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to
      resolve the derived-from field. All three functions need to go across link
      for derived-from fields, so we need to get hold of a type identifier map.
      
      A pointer to DwarfDebug is also added to DbgVariable in order to resolve the
      derived-from field.
      
      Debug info verifier is updated to check a derived-from field is a TypeRef.
      Verifier will not go across link for derived-from fields, in debug info finder,
      we go across the link to add derived-from fields to types.
      
      Function getDICompositeType is only used by dragonegg and since dragonegg does
      not generate identifier for types, we use an empty map to resolve the
      derived-from field.
      
      When printing a derived-from field, we use DITypeRef::getName to either return
      the type identifier or getName of the DIType.
      
      A paired commit at clang is required due to changes to DIBuilder.
      
      llvm-svn: 191800
      9a0a6703
  5. Oct 01, 2013
    • Manman Ren's avatar
      Debug Info: remove duplication of DIEs when a DIE is part of the type system · 8990d7ee
      Manman Ren authored
      and it is shared across CUs.
      
      We add a few maps in DwarfDebug to map MDNodes for the type system to the
      corresponding DIEs: MDTypeNodeToDieMap, MDSPNodeToDieMap, and
      MDStaticMemberNodeToDieMap. These DIEs can be shared across CUs, that is why we
      keep the maps in DwarfDebug instead of CompileUnit.
      
      Sometimes, when we try to add an attribute to a DIE, the DIE is not yet added
      to its owner yet, so we don't know whether we should use ref_addr or ref4.
      We create a worklist that will be processed during finalization to add
      attributes with the correct form (ref_addr or ref4).
      
      We add addDIEEntry to DwarfDebug to be a wrapper around DIE->addValue. It checks
      whether we know the correct form, if not, we update the worklist
      (DIEEntryWorklist).
      
      A testing case is added to show that we only create a single DIE for a type
      MDNode and we use ref_addr to refer to the type DIE.
      
      llvm-svn: 191792
      8990d7ee
    • Eric Christopher's avatar
      Add the DW_AT_GNU_ranges_base attribute if we've emitted any ranges · 9a08f9e5
      Eric Christopher authored
      into the debug_ranges section.
      
      llvm-svn: 191721
      9a08f9e5
    • Eric Christopher's avatar
      Update comments. · 1d06eb5d
      Eric Christopher authored
      llvm-svn: 191720
      1d06eb5d
    • Eric Christopher's avatar
      The DW_AT_GNU_pubnames/pubtypes attributes are actually form · 39eebfad
      Eric Christopher authored
      SEC_OFFSET from the beginning of the section so go ahead and emit
      a label at the beginning of each one.
      
      llvm-svn: 191710
      39eebfad
  6. Sep 28, 2013
  7. Sep 26, 2013
  8. Sep 24, 2013
  9. Sep 23, 2013
    • Eric Christopher's avatar
      Handle gnu pubtypes sections: · 261d2343
      Eric Christopher authored
      a) Make sure we are emitting the correct section in our section labels
      when we begin the module.
      b) Make sure we are emitting the correct pubtypes section in the
      presence of gnu pubtypes.
      c) For C++ struct, union, class, and enumeration types are default
      external.
      
      llvm-svn: 191225
      261d2343
    • Richard Mitton's avatar
      Fixed debug_aranges handling for common symbols. · 089ed89e
      Richard Mitton authored
      The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols.
      
      .comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section.
      
      Test case update to account for this.
      
      llvm-svn: 191210
      089ed89e
  10. Sep 21, 2013
  11. Sep 20, 2013
Loading