Commit Graph

166 Commits

Author SHA1 Message Date
David Blaikie
2e110c3fa6 DebugInfo: Make pubnames header printing similar to unit header printing
In a failed attempt to allow the gnu-public-names.ll test case to not
hardcode the size of the unit that the pubnames section referred to I've
at least managed to have unit headers and pubnames headers print out in
a similar style.

This failed to achieve the desired goal because the header in a unit
specifies the length of the unit without the length element of the
header whereas the length in the pubnames includes this element, so the
numbers are off by 4 bytes. I don't know of any arithmetic powers in
FileCheck so the test case can't simply say "CU_LENGTH + 4".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193872 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01 17:53:30 +00:00
Alexey Samsonov
9e189f12e6 DWARFDebugArangeSet: remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 18:54:20 +00:00
Alexey Samsonov
7d82b42849 DWARFUnit: kill dead code and make a couple of functions private. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193780 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 18:05:02 +00:00
Alexey Samsonov
bc5e25ddef DWARFAbbreviationDeclaration: remove dead code, refactor parsing code and make it more robust. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193770 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 17:20:14 +00:00
Alexey Samsonov
636a5cb8de DWARF parser: propery handle DW_FORM_ref_sig8 and fix Windows build.
Based on D2050 by Timur Iskhodzhanov.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193619 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 16:32:19 +00:00
Timur Iskhodzhanov
45d2e6492c Quick-fix DebugInfo build on Windows
MSVC can't comprehend
  template<typename T, size_t N>
  ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
    return ArrayRef<T>(Arr);
  }
if Arr is
  static const uint8_t sizes[];
declared in a templated and defined a few lines later.

I'll send a proper fix (i.e. get rid of unnecessary templates) for review soon.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193604 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 12:13:22 +00:00
Richard Smith
8fea6c8315 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193576 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 01:44:23 +00:00
NAKAMURA Takumi
f5f0b20516 DWARFFormValue.cpp: Appease gcc to give explicit constructors.
error: conversion from `const uint8_t*' to non-scalar type `llvm::ArrayRef<unsigned char>' requested

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193575 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 01:43:05 +00:00
Alexey Samsonov
39f62fa3dd Merge DWARFDIE::extractFast and DWARFDIE::extract into one function.
Complicated CU-DIE-specific logic in the latter was never used,
and it makes sense to have safety checks for broken dwarf in the former.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193563 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 23:58:58 +00:00
Alexey Samsonov
6faff4886a DWARF parser: Use ArrayRef to represent form sizes and simplify DWARFDIE::extractFast() interface. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193560 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 23:41:49 +00:00
Alexey Samsonov
d2d54e2b7c DWARF parser: since DWARF4, DW_AT_high_pc may be a constant representing function size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 23:15:15 +00:00
Alexey Samsonov
c5253237f8 DebugInfo: Introduce the notion of "form classes"
Summary:
Use DWARF4 table of form classes to fetch attributes from DIE
in a more consistent way. This shouldn't change the functionality and
serves as a refactoring for upcoming change: DW_AT_high_pc has different
semantics depending on its form class.

Reviewers: dblaikie, echristo

Reviewed By: echristo

CC: echristo, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193553 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 23:01:48 +00:00
Ed Maste
e1bc6ddc0b Correct log message typo: ended ad -> ended at
(From LLDB r192897)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192968 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 13:01:33 +00:00
Alexey Samsonov
8d433bd458 [DebugInfo] Remove unneeded struct member and hide struct definition. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192954 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 07:13:32 +00:00
Alexey Samsonov
71f6d6ee1a [DebugInfo] Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192952 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 07:03:16 +00:00
Alexey Samsonov
2e56d575b7 [DebugInfo] Delete dead code, simplify and fix code style for some existing code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192894 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 13:28:16 +00:00
Alexey Samsonov
3db24f52c5 [DebugInfo] Further simplify DWARFDebugAranges public interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-02 07:12:47 +00:00
Alexey Samsonov
041f7c8d65 [DebugInfo] Simplify and speedup .debug_aranges parsing
Parsing .debug_aranges section now takes O(nlogn) operations instead
of O(n^2), where "n" is the number of address ranges. With this change,
the time required to symbolize an address from a random large
Clang-generated binary drops from 165 seconds to 1.5 seconds.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 16:52:46 +00:00
Alexey Samsonov
17f7d099e4 [DebugInfo] Further simplify DWARFDebugAranges. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 16:25:14 +00:00
Alexey Samsonov
d1fc0f8d4e [DebugInfo] Remove unused functions from DWARFDebugAranges and fix code style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191778 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 15:48:10 +00:00
Benjamin Kramer
1fe49e68ba Deallocate type units when destroying a DWARFContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191637 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-29 11:24:02 +00:00
Eric Christopher
5972df2696 Rework conditional for printing out pub sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-27 22:10:10 +00:00
Eric Christopher
7357f03e88 Dump the normal dwarf pubtypes section as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191408 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:02:41 +00:00
Eric Christopher
c839df0e4c Unify pubsection/gnu pubsection printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191407 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:02:36 +00:00
Eric Christopher
f8809477be Slight formatting change for pubnames/pubtypes output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191401 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 21:17:37 +00:00
David Blaikie
0c5e6c6730 llvm-dwarfdump: add missing opening quotation mark lost in r191330
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 20:23:36 +00:00
David Blaikie
d374c7b3bf llvm-dwarfdump: re-add field formatting for the entry kind lost in r191329
CR feedback from Eric Christopher

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191330 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 19:56:27 +00:00
David Blaikie
9ddf28d501 llvm-dwarfdump support for gnu_pubtypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 19:50:00 +00:00
NAKAMURA Takumi
e1e8fe1f2f DWARFTypeUnit::dump(): Use PRIx64 to format uint64_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191266 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 03:23:07 +00:00
Eric Christopher
56b62c0ea2 Format the index entry kind string to align.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:17:49 +00:00
David Blaikie
7533165612 Comments for r191234 as suggested by Eric Christopher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191244 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 23:39:55 +00:00
David Blaikie
262f548b09 Unbreak the build (from r191233)since we're calling printf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191238 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 23:15:57 +00:00
David Blaikie
438f5391b2 llvm-dwarfdump/libDebugInfo support for type units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 22:44:47 +00:00
David Blaikie
cd7c4980d4 Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the coming DWARFTypeUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191233 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 22:44:40 +00:00
David Blaikie
9528b0e466 DebugInfo: Wrap section data and relocs together for dwarf dumping support
This is a small step that may enable some simplifications in producer
(DWARFContext) and consumer (DWARFCompileUnit and other places) by
making a more complete abstraction around the data and relocations for a
section. Small initial steps could include simple changes such as
passing the pair to DWARFCompileUnit's ctor rather than passing the data
and relocs separately. I don't intend to pursue any such changes
immediately, however.

The motivation for doing this now is that type unit dumping will need to
deal with these data+reloc pairs moreso than the existing dumping
support has needed to associate the data as type unit sections are named
the same (debug_types) and comdat group folded. So to implement dumping
and reloc handling we'll need a mapping of section->data+relocs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191209 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 17:42:01 +00:00
David Blaikie
e7174f1832 Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191179 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-22 18:25:32 +00:00
David Blaikie
eaad5cdc2a StringRef-ize some things
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191178 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-22 17:01:50 +00:00
Richard Smith
c87f9488b8 Revert r191062; the build break was also fixed in a different (incompatible) way in r191060.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191065 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 01:24:10 +00:00
Richard Smith
dbf7642110 Unbreak Clang build after r191050: don't pass a StringRef to snprintf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191062 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 00:38:18 +00:00
David Blaikie
5cfcb3677a DebugInfo: constrain gnu pubnames test further
Ensures that the pubnames entries actually refer to the intended
entities. This test could be more flexible if there was a way to do
multiline FileCheck matches with captures (in that way the test wouldn't
need to have hardcoded offset values and would thus be resilient to
changes in the layout of the DIEs in this CU).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191055 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:43:46 +00:00
David Blaikie
994c37fcb0 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191050 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:01:29 +00:00
Alexey Samsonov
63fd2af389 Add support for DebugFission to DWARF parser
Summary:
1) Make llvm-symbolizer properly symbolize
files with split debug info (by using stanalone .dwo files).
2) Make DWARFCompileUnit parse and store corresponding .dwo file,
if necessary.
3) Make bits of DWARF parsing more CompileUnit-oriented.

Reviewers: echristo

Reviewed By: echristo

CC: bkramer, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1164

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 09:20:22 +00:00
Alexey Samsonov
eb0c179b56 Make DWARFCompileUnit non-copyable
Summary:
This is a part of D1164. DWARFCompileUnit is not that lightweight
to copy it around, and we want it to own corresponding .dwo compile unit
eventually.

Reviewers: echristo

Reviewed By: echristo

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1298

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 06:56:01 +00:00
David Blaikie
a9b6979755 llvm-dwarfdump: Do not include address offsets for attributes, only for tags
This reduces the noise in diffs making it more likely that, at least for
LLVM revision-over-revision, diffs will actually yield usable results.

This is consistent with objdump's DWARF dumping behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188650 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-19 03:36:23 +00:00
Alexey Samsonov
e664290ad6 Store compile unit corresponding to each chain of inlined debug info entries. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187792 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 10:49:15 +00:00
Alexey Samsonov
749d35c593 Add LLVM-style RTTI to DIContext/DWARFContext classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187790 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 10:32:39 +00:00
Eric Christopher
99c22aaeed Allow 4 as a valid debug info version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 01:38:27 +00:00
Alexey Samsonov
40d8c69c59 DebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code style and comments.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186315 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 08:43:35 +00:00
David Blaikie
0812304ad8 Spell correct (s/begining/beginning/)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-19 21:42:05 +00:00
David Blaikie
3df7d2f70b llvm-dwarfdump: Add support for dumping the .debug_loc section
This is a basic implementation - we still don't have any support (that I
know of) for dumping DWARF expressions in a meaningful way, so the
location information itself is just printed as a sequence of bytes as we
do elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-19 21:37:13 +00:00