Skip to content
  1. Jan 10, 2017
  2. Dec 22, 2016
  3. Dec 20, 2016
  4. Nov 15, 2016
    • Greg Clayton's avatar
      Improve DWARF parsing speed by improving DWARFAbbreviationDeclaration · b07cdeae
      Greg Clayton authored
      This patch gets a DWARF parsing speed improvement by having DWARFAbbreviationDeclaration instances know if they have a fixed byte size. If an abbreviation has a fixed byte size that can be calculated given a DWARFUnit, then parsing a DIE becomes two steps: parse ULEB128 abbrev code, and then add constant size to the offset.
      
      This patch also adds a fixed byte size to each DWARFAbbreviationDeclaration::AttributeSpec so that attributes can quickly skip their values if needed without the need to lookup the fixed for size.
      
      Notable improvements:
      
      - DWARFAbbreviationDeclaration::findAttributeIndex() now returns an Optional<uint32_t> instead of a uint32_t and we no longer have to look for the magic -1U return value
      - Optional<uint32_t> DWARFAbbreviationDeclaration::findAttributeIndex(dwarf::Attribute attr) const;
      - DWARFAbbreviationDeclaration now has a getAttributeValue() function that extracts an attribute value given a DIE offset that takes advantage of the DWARFAbbreviationDeclaration::AttributeSpec::ByteSize
      - bool DWARFAbbreviationDeclaration::getAttributeValue(const uint32_t DIEOffset, const dwarf::Attribute Attr, const DWARFUnit &U, DWARFFormValue &FormValue) const;
      - A DWARFAbbreviationDeclaration instance can return a fixed byte size for itself so DWARF parsing is faster:
      - Optional<size_t> DWARFAbbreviationDeclaration::getFixedAttributesByteSize(const DWARFUnit &U) const;
      - Any functions that used to take a "const DWARFUnit *U" that would crash if U was NULL now take a "const DWARFUnit &U" and are only called with a valid DWARFUnit
      
      Differential Revision: https://reviews.llvm.org/D26567
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286924 91177308-0d34-0410-b5e6-96231b3b80d8
      b07cdeae
  5. Nov 11, 2016
    • Greg Clayton's avatar
      Clean up DWARFFormValue by reducing duplicated code and removing... · f5acbc29
      Greg Clayton authored
      Clean up DWARFFormValue by reducing duplicated code and removing DWARFFormValue::getFixedFormSizes()
      
      In preparation for a follow on patch that improves DWARF parsing speed, clean up DWARFFormValue so that we have can get the fixed byte size of a form value given a DWARFUnit or given the version, address byte size and dwarf32/64.
      
      This patch cleans up code so that everyone is using one of the new DWARFFormValue functions:
      
      static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, const DWARFUnit *U = nullptr);
      static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, uint16_t Version, uint8_t AddrSize, bool Dwarf32);
      
      This patch changes DWARFFormValue::skipValue() to rely on the output of DWARFFormValue::getFixedByteSize(...) instead of duplicating the code in each function. This will reduce the number of changes we need to make to DWARF to fewer places in DWARFFormValue when we add support for new form.
      
      This patch also starts to support DWARF64 so that we can get correct byte sizes for forms that vary according the DWARF 32/64.
      
      To reduce the code duplication a new FormSizeHelper pure virtual class was created that can be created as a FormSizeHelperDWARFUnit when you have a DWARFUnit, or FormSizeHelperManual where you manually specify the DWARF version, address byte size and DWARF32/DWARF64. There is now a single implementation of a function that gets the fixed byte size (instead of two where one took a DWARFUnit and one took the DWARF version, address byte size and DWARFFormat enum) and one function to skip the form values.
      
      https://reviews.llvm.org/D26526
      
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286597 91177308-0d34-0410-b5e6-96231b3b80d8
      f5acbc29
  6. Oct 31, 2016
    • Greg Clayton's avatar
      Modify DWARFFormValue to remember the DWARFUnit that it was decoded with. · 1a30f4b7
      Greg Clayton authored
      Modifying DWARFFormValue to remember the DWARFUnit that it was encoded with can simplify the usage of instances of this class. Previously users would have to try and pass in the same DWARFUnit that was used to decode the form value and there was a possibility that a different DWARFUnit might be supplied to the functions that extract values (strings, CU relative references, addresses) and cause problems. This fixes this potential issue by storing the DWARFUnit inside the DWARFFormValue so that this mistake can't be made. Instances of DWARFFormValue are not stored permanently and are used as temporary values, so the increase in size of an instance of DWARFFormValue isn't a big deal. This makes decoding form values more bullet proof and is a change that will be used by future modifications.
      
      https://reviews.llvm.org/D26052
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285594 91177308-0d34-0410-b5e6-96231b3b80d8
      1a30f4b7
  7. Oct 27, 2016
  8. Apr 18, 2016
    • Mehdi Amini's avatar
      [NFC] Header cleanup · f6071e14
      Mehdi Amini authored
      Removed some unused headers, replaced some headers with forward class declarations.
      
      Found using simple scripts like this one:
      clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap'
      
      Patch by Eugene Kosov <claprix@yandex.ru>
      
      Differential Revision: http://reviews.llvm.org/D19219
      
      From: Mehdi Amini <mehdi.amini@apple.com>
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266595 91177308-0d34-0410-b5e6-96231b3b80d8
      f6071e14
  9. Dec 04, 2015
  10. Jun 23, 2015
  11. Jun 19, 2015
  12. May 19, 2015
    • Alexey Samsonov's avatar
      [DWARF parser] Add basic support for DWZ DWARF multifile extensions. · 4ca606f2
      Alexey Samsonov authored
      This change implements basic support for DWARF alternate sections
      proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open
      
      LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and
      DW_FORM_GNU_strp_alt, which are used as references to .debug_info and
      .debug_str sections respectively, stored in a separate file, and
      possibly shared between different executables / shared objects.
      
      llvm-dwarfdump and llvm-symbolizer don't yet know how to access this
      alternate debug file (usually pointed by .gnu_debugaltlink section),
      but they can at lease properly parse and dump regular files, which
      refer to it.
      
      This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on
      files produced by running "dwz" tool. Such files are already installed
      on some modern Linux distributions.
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237721 91177308-0d34-0410-b5e6-96231b3b80d8
      4ca606f2
  13. Mar 07, 2015
  14. Mar 04, 2015
  15. Jan 30, 2015
  16. Nov 12, 2014
    • Frederic Riss's avatar
      Allow DWARFFormValue::extractValue to be called with a null CU. · 0275be3a
      Frederic Riss authored
      Currently FormValues are only used for attributes of DIEs and thus
      uers always have a CU lying around when calling into the FormValue
      API.
      Accelerator tables encode their information using the same Forms
      as the attributes, thus it is natural to use DWARFFormValue to
      extract/dump them. There is no CU in that case though. Allow the
      API to be called with a null CU arguemnt by making the RelocMap
      lookup conditional on the CU pointer validity. And document this
      new behvior in the header. (Test coverage for this use of the API
      comes in the DwarfAccelTable support patch)
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221835 91177308-0d34-0410-b5e6-96231b3b80d8
      0275be3a
  17. Sep 04, 2014
  18. Apr 15, 2014
  19. Oct 28, 2013
  20. Oct 18, 2013
  21. Sep 23, 2013
  22. Sep 22, 2013
  23. Aug 27, 2013
  24. Apr 17, 2013
  25. Apr 09, 2013
    • Alexey Samsonov's avatar
      DWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the... · 32a3e783
      Alexey Samsonov authored
      DWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the same as DW_FORM_addr in DWARF2, and is 4/8 bytes on 32/64-bit DWARF starting from DWARF3. Adding a test for this is a huge pain - generating and uploading pre-built binary with DWARF3 debug info is way too ugly, and writing fine-grained unittests for DebugInfo is impossible, as it doesn't expose any headers in include/llvm. That said, I'm going to choose the second approach and submit the patch exposing DebugInfo headers for review soon enough.
      
      git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179095 91177308-0d34-0410-b5e6-96231b3b80d8
      32a3e783
  26. Jan 15, 2013
  27. Jan 07, 2013
  28. Sep 05, 2012
  29. Sep 15, 2011
  30. Sep 13, 2011