1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

149 Commits

Author SHA1 Message Date
Alexey Samsonov
ada9b94050 [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.

llvm-svn: 191781
2013-10-01 16:52:46 +00:00
Alexey Samsonov
1bb7484e09 [DebugInfo] Further simplify DWARFDebugAranges. No functionality change.
llvm-svn: 191779
2013-10-01 16:25:14 +00:00
Alexey Samsonov
18c4e7e84f [DebugInfo] Remove unused functions from DWARFDebugAranges and fix code style.
llvm-svn: 191778
2013-10-01 15:48:10 +00:00
Benjamin Kramer
9a4c18a22b Deallocate type units when destroying a DWARFContext.
llvm-svn: 191637
2013-09-29 11:24:02 +00:00
Eric Christopher
8a7dc17632 Rework conditional for printing out pub sections.
llvm-svn: 191571
2013-09-27 22:10:10 +00:00
Eric Christopher
02158bcbd4 Dump the normal dwarf pubtypes section as well.
llvm-svn: 191408
2013-09-25 23:02:41 +00:00
Eric Christopher
0ef07dbcf5 Unify pubsection/gnu pubsection printing.
llvm-svn: 191407
2013-09-25 23:02:36 +00:00
Eric Christopher
1f11b36bd9 Slight formatting change for pubnames/pubtypes output.
llvm-svn: 191401
2013-09-25 21:17:37 +00:00
David Blaikie
b096f4205c llvm-dwarfdump: add missing opening quotation mark lost in r191330
llvm-svn: 191333
2013-09-24 20:23:36 +00:00
David Blaikie
8a5b23ab1a llvm-dwarfdump: re-add field formatting for the entry kind lost in r191329
CR feedback from Eric Christopher

llvm-svn: 191330
2013-09-24 19:56:27 +00:00
David Blaikie
200977ce99 llvm-dwarfdump support for gnu_pubtypes
llvm-svn: 191329
2013-09-24 19:50:00 +00:00
NAKAMURA Takumi
b5e44fa680 DWARFTypeUnit::dump(): Use PRIx64 to format uint64_t.
llvm-svn: 191266
2013-09-24 03:23:07 +00:00
Eric Christopher
1c2f577ec5 Format the index entry kind string to align.
llvm-svn: 191255
2013-09-24 00:17:49 +00:00
David Blaikie
e6ea892307 Comments for r191234 as suggested by Eric Christopher.
llvm-svn: 191244
2013-09-23 23:39:55 +00:00
David Blaikie
c3cd97ef68 Unbreak the build (from r191233)since we're calling printf.
llvm-svn: 191238
2013-09-23 23:15:57 +00:00
David Blaikie
70660e39e4 llvm-dwarfdump/libDebugInfo support for type units
llvm-svn: 191234
2013-09-23 22:44:47 +00:00
David Blaikie
641c46dab7 Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the coming DWARFTypeUnit.
llvm-svn: 191233
2013-09-23 22:44:40 +00:00
David Blaikie
5e6273bea3 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.

llvm-svn: 191209
2013-09-23 17:42:01 +00:00
David Blaikie
60884c0660 Remove dead code
llvm-svn: 191179
2013-09-22 18:25:32 +00:00
David Blaikie
a65dc13dbb StringRef-ize some things
llvm-svn: 191178
2013-09-22 17:01:50 +00:00
Richard Smith
6dfe60433d Revert r191062; the build break was also fixed in a different (incompatible) way in r191060.
llvm-svn: 191065
2013-09-20 01:24:10 +00:00
Richard Smith
255a969b21 Unbreak Clang build after r191050: don't pass a StringRef to snprintf.
llvm-svn: 191062
2013-09-20 00:38:18 +00:00
David Blaikie
954130581b 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).

llvm-svn: 191055
2013-09-19 23:43:46 +00:00
David Blaikie
f60a2aeec3 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
llvm-svn: 191050
2013-09-19 23:01:29 +00:00
Alexey Samsonov
349607af6f 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

llvm-svn: 189329
2013-08-27 09:20:22 +00:00
Alexey Samsonov
c9f658cd2a 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

llvm-svn: 189089
2013-08-23 06:56:01 +00:00
David Blaikie
c5c33c4a15 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.

llvm-svn: 188650
2013-08-19 03:36:23 +00:00
Alexey Samsonov
72db336586 Store compile unit corresponding to each chain of inlined debug info entries. No functionality change.
llvm-svn: 187792
2013-08-06 10:49:15 +00:00
Alexey Samsonov
c51801370f Add LLVM-style RTTI to DIContext/DWARFContext classes
llvm-svn: 187790
2013-08-06 10:32:39 +00:00
Eric Christopher
c5f9312717 Allow 4 as a valid debug info version.
llvm-svn: 187763
2013-08-06 01:38:27 +00:00
Alexey Samsonov
9e65cbea5d DebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code style and comments.
No functionality change.

llvm-svn: 186315
2013-07-15 08:43:35 +00:00
David Blaikie
efeec21da2 Spell correct (s/begining/beginning/)
llvm-svn: 184362
2013-06-19 21:42:05 +00:00
David Blaikie
7637c0313e 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.

llvm-svn: 184361
2013-06-19 21:37:13 +00:00
Rafael Espindola
6f41305fd8 Handle relocations that don't point to symbols.
In ELF (as in MachO), not all relocations point to symbols. Represent this
properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj
ELF's dumper to handle relocatios without symbols.

llvm-svn: 183284
2013-06-05 01:33:53 +00:00
Rafael Espindola
5b34d5a3c7 Change how we iterate over relocations on ELF.
For COFF and MachO, sections semantically have relocations that apply to them.
That is not the case on ELF.

In relocatable objects (.o), a section with relocations in ELF has offsets to
another section where the relocations should be applied.

In dynamic objects and executables, relocations don't have an offset, they have
a virtual address. The section sh_info may or may not point to another section,
but that is not actually used for resolving the relocations.

This patch exposes that in the ObjectFile API. It has the following advantages:

* Most (all?) clients can handle this more efficiently. They will normally walk
all relocations, so doing an effort to iterate in a particular order doesn't
save time.

* llvm-readobj now prints relocations in the same way the native readelf does.

* probably most important, relocations that don't point to any section are now
visible. This is the case of relocations in the rela.dyn section. See the
updated relocation-executable.test for example.

llvm-svn: 182908
2013-05-30 03:05:14 +00:00
Eric Christopher
7112ce79dc Reformat comments here.
llvm-svn: 182901
2013-05-30 00:43:30 +00:00
Benjamin Kramer
06f11acde8 libDebugInfo depends on libObject nowadays.
llvm-svn: 181510
2013-05-09 13:48:26 +00:00
Eric Christopher
3cc2bddd41 Hoist boundary condition out of loop header.
llvm-svn: 181248
2013-05-06 21:19:44 +00:00
Eric Christopher
eb2243ca76 Untabify.
llvm-svn: 181247
2013-05-06 21:19:41 +00:00
Eric Christopher
4cbb105dfc Don't emit .dwo sections unless they exist.
llvm-svn: 181224
2013-05-06 17:50:42 +00:00
Rafael Espindola
9541db893e Clarify getRelocationAddress x getRelocationOffset a bit.
getRelocationAddress is for dynamic libraries and executables,
getRelocationOffset for relocatable objects.

Mark the getRelocationAddress of COFF and MachO as not implemented yet. Add a
test of ELF's. llvm-readobj -r now prints the same values as readelf -r.

llvm-svn: 180259
2013-04-25 12:28:45 +00:00
Alexey Samsonov
cb820bd0a4 Use zlib to uncompress debug sections in DWARF parser.
This makes llvm-dwarfdump and llvm-symbolizer understand
debug info sections compressed by ld.gold linker.

llvm-svn: 180088
2013-04-23 10:17:34 +00:00
Eric Christopher
65e2f0c4cb Remove variable store that is never read.
llvm-svn: 180013
2013-04-22 13:46:33 +00:00
Alexey Samsonov
7abfd15675 Use StringSwitch instead of long chain of if-else. No functionality change.
llvm-svn: 179682
2013-04-17 14:27:04 +00:00
Alexey Samsonov
542f535116 Create a stub for DWARF parser unittests
Moves one DWARF-specific header to include/llvm/DebugInfo from lib/.
Add a short unittest for r179095.

llvm-svn: 179678
2013-04-17 08:29:02 +00:00
Benjamin Kramer
cf2731d0e0 Rename the C function to create a SLPVectorizerPass to something sane and expose it in the header file.
llvm-svn: 179272
2013-04-11 11:36:36 +00:00
Alexey Samsonov
2d1fae1f75 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.
llvm-svn: 179095
2013-04-09 14:09:42 +00:00
Alexey Samsonov
5a62adc696 DWARF parser: remove duplicated code and fix code style in DIE extractors.
llvm-svn: 179023
2013-04-08 14:37:16 +00:00
Eric Christopher
546e1942f2 DW_FORM_sec_offset should be a relocation on platforms that use
a relocation across sections. Do this for DW_AT_stmt list in the
skeleton CU and check the relocations in the debug_info section.

Add a FIXME for multiple CUs.

llvm-svn: 178969
2013-04-07 03:43:09 +00:00
Matt Arsenault
a80a8422d5 Fix missing std::. Not sure how this compiles for anyone else.
llvm-svn: 177620
2013-03-21 00:57:21 +00:00