Commit Graph

28 Commits

Author SHA1 Message Date
Igor Kudrin 8ee19f8c63 Switch LLVM to use 64-bit offsets (2/5)
This updates all libraries and tools in LLVM Core to use 64-bit offsets
which directly or indirectly come to DataExtractor.

Differential Revision: https://reviews.llvm.org/D65638


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368014 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 10:49:40 +00:00
Fangrui Song 79428c1e07 [DWARF] Delete a stray break and a stray comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356838 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 16:15:40 +00:00
Alexey Lapshin a15cff122c [DebugInfo] add SectionedAddress to DebugInfo interfaces.
That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703
   "wrong line number info for obj file compiled with -ffunction-sections"
   bug. The problem happened with only .o files. If object file contains
   several .text sections then line number information showed incorrectly.
   The reason for this is that DwarfLineTable could not detect section which
   corresponds to specified address(because address is the local to the
   section). And as the result it could not select proper sequence in the
   line table. The fix is to pass SectionIndex with the address. So that it
   would be possible to differentiate addresses from various sections. With
   this fix llvm-objdump shows correct line numbers for disassembled code.

   Differential review: https://reviews.llvm.org/D58194

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354972 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 13:17:36 +00:00
Chandler Carruth 6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
George Rimar 2a12d85a04 [llvm-dwarfdump] - Stop printing the bogus empty section name on invalid dwarf.
When there is no .debug_addr section for some reason,
llvm-dwarfdump would print the bogus empty section name when dumping ranges
in .debug_info:

DW_AT_ranges [DW_FORM_rnglistx]   (indexed (0x0) rangelist = 0x00000004
    [0x0000000000000000, 0x0000000000000001) ""
    [0x0000000000000000, 0x0000000000000002) "")

That happens because of the code which uses 0 (zero) as a section index as a default value.
The code should use -1ULL instead because technically 0 is a valid zero section index
in ELF and -1ULL is a special constant used that means "no section available".

This is mostly a fix for the overall correctness/safety of the code,
but a test case is provided too.

Differential revision: https://reviews.llvm.org/D55113

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348115 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 10:33:40 +00:00
Wolfgang Pieb daecf945cc [DWARF] Revert r345546: Refactor range list extraction and dumping
This patch caused some internal tests to break which are being investigated.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345687 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 01:12:58 +00:00
Wolfgang Pieb 3efd3a74af [DWARF][NFC] Refactor range list extraction and dumping
The purpose of this patch is twofold: 
- Fold pre-DWARF v5 functionality into v5 to eliminate the need for 2 different 
  versions of range list handling. We get rid of DWARFDebugRangelist{.cpp,.h}.
- Templatize the handling of range list tables so that location list handling
  can take advantage of it as well. Location list and range list tables have the 
  same basic layout.

A non-NFC version of this patch was previously submitted with r342218, but it caused
errors with some TSan tests. This patch has no functional changes. The difference to
the non-NFC patch is that there are no changes to rangelist dumping in this patch.

Differential Revision: https://reviews.llvm.org/D53545



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345546 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-29 22:16:47 +00:00
David Blaikie 3a1bc560ac llvm-dwarfdump: Support RLE_addressx and RLE_startx_length in .debug_rnglists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344835 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-20 06:16:25 +00:00
David Blaikie b5d5e5ebf6 DebugInfo: Use debug_addr for non-dwo addresses in DWARF 5
Putting addresses in the address pool, even with non-fission, can reduce
relocations - reusing the addresses from debug_info and debug_rnglists
(the latter coming soon)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344834 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-20 06:02:15 +00:00
Alexander Kornienko d2dad5476b Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil."
This reverts commit r342218. Due to a number of failures under TSAN. An isolated
test case is being worked on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 15:40:01 +00:00
Wolfgang Pieb dbed722b63 [DWARF] reposting r342048, which was reverted in r342056 due to buildbot
errors.
Adjusted 2 test cases for ARM and darwin and fixed a bug with the original
change in dsymutil.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342218 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-14 09:14:10 +00:00
Wolfgang Pieb 103f07fe70 Reverting r342048, which caused UBSan failures in dsymutil.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342056 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 14:40:04 +00:00
Wolfgang Pieb 76d3c908f5 [DWARF] Refactoring range list dumping to fold DWARF v4 functionality into v5 handling
Eliminating some duplication of rangelist dumping code at the expense of
some version-dependent code in dump and extract routines.

Reviewer: dblaikie, JDevlieghere, vleschuk

Differential revision: https://reviews.llvm.org/D51081


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342048 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 12:01:19 +00:00
Victor Leschuk f030fcc4ba [DWARF] Refactor DWARF classes to use unified error reporting. NFC.
DWARF-related classes in lib/DebugInfo/DWARF contained 
duplicating code for creating StringError instances, like:

template <typename... Ts>
static Error createError(char const *Fmt, const Ts &... Vals) {
  std::string Buffer;
  raw_string_ostream Stream(Buffer);
  Stream << format(Fmt, Vals...);
  return make_error<StringError>(Stream.str(), inconvertibleErrorCode());
}

Similar function was placed in Support lib in https://reviews.llvm.org/D49824

This revision makes DWARF classes use this function
instead of their local implementation of it.

Reviewers: aprantl, dblaikie, probinson, wolfgangp, JDevlieghere, jhenderson

Reviewed By: JDevlieghere, jhenderson

Differential Revision: https://reviews.llvm.org/D49964



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 09:59:08 +00:00
Wolfgang Pieb 2d6fb152e5 Embed a template specialization in a namespace to work around a gcc bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337770 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 23:14:23 +00:00
Wolfgang Pieb 3e597f45e6 [DWARF v5] Refactor range lists dumping by using a more generic way of handling tables of lists.
The intent is to use it for location list tables as well. Change is almost NFC with the exception
of the spelling of some strings used during dumping (all lowercase now).

Reviewer: JDevlieghere

Differential Revision: https://reviews.llvm.org/D49500



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337763 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 22:37:17 +00:00
Wolfgang Pieb 5a4174c540 [DWARF] Improved error reporting for range lists.
Errors found processing the DW_AT_ranges attribute are propagated by lower level 
routines and reported by their callers.

Reviewer: JDevlieghere

Differential Revision: https://reviews.llvm.org/D48344



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335188 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-20 22:56:37 +00:00
Wolfgang Pieb c1a566a493 Fixing buildbot error introduced with r332759.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332772 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 21:44:28 +00:00
Wolfgang Pieb eab311b661 [DWARF v5] Improved support for .debug_rnglists (consumer). Enables any consumer to
extract DWARF v5 encoded rangelists.

Reviewer: JDevlieghere

Differential Revision: https://reviews.llvm.org/D45549


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332759 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 20:12:54 +00:00
Wolfgang Pieb 57bcc004a1 [DWARF v5][NFC]: Refactor DebugRnglists to prepare for the support of the DW_AT_ranges
attribute in conjunction with .debug_rnglists.

Reviewers: JDevlieghere
 
Differential Revision: https://reviews.llvm.org/D45307


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329345 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-05 21:01:49 +00:00
Wolfgang Pieb 3c8a7c30cc [DWARF][DWARF v5]: Adding support for dumping DW_RLE_offset_pair and DW_RLE_base_address
Reviewers: dblakie, aprantl

Differential Revision: https://reviews.llvm.org/D44811


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328662 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27 20:27:36 +00:00
Benjamin Kramer 767ba55eb3 [DebugInfo] Move RangeListEntries instead of copying.
This is needed for correctness as RangeListEntry is not copy-assignable,
which std::vector might rely on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327067 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 21:31:10 +00:00
Zachary Turner 832535f453 Fix compilation failure with MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327063 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 21:07:30 +00:00
Wolfgang Pieb 1a5231fa62 [DWARF v5] Support for verbose dumping of .debug_rnglist entries
Adding verbose dumping to the recent implementation of dumping of v5 range list entries. 
We're capturing the entries as is as they come in during extraction, including their file offset,
so we can dump them in more detail.
The offset table entries which are table-relative are shown as is (as in non-verbose mode)
and with the actual file offset they map to.

Reviewers: dblaikie, aprantl, jdevlieghere, jhenderson

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D43366


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327059 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 20:52:35 +00:00
James Henderson f4f7821f84 Fix more print format specifiers in debug_rnglists dumping
See also r324096.

I have made the assumption that DWARF64 is not an issue for the time
being with these fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324223 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-05 10:47:13 +00:00
Simon Pilgrim a3fd47f78a Fix MSVC signed/unsigned comparison warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324171 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-03 12:38:56 +00:00
James Henderson a4e44968ac Fix type sizes that were causing incorrect string formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324096 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-02 15:09:31 +00:00
James Henderson 2af2e6c776 Add missing new files from r324077
Differential Revision: https://reviews.llvm.org/D42481


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324078 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-02 12:45:57 +00:00