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

38 Commits

Author SHA1 Message Date
Alexey Samsonov
29ac66d0fe DWARF parser: propery handle DW_FORM_ref_sig8 and fix Windows build.
Based on D2050 by Timur Iskhodzhanov.

llvm-svn: 193619
2013-10-29 16:32:19 +00:00
Timur Iskhodzhanov
a98623a27d 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.

llvm-svn: 193604
2013-10-29 12:13:22 +00:00
Richard Smith
c358358cab Clean up.
llvm-svn: 193576
2013-10-29 01:44:23 +00:00
NAKAMURA Takumi
b5769ec6db DWARFFormValue.cpp: Appease gcc to give explicit constructors.
error: conversion from `const uint8_t*' to non-scalar type `llvm::ArrayRef<unsigned char>' requested

llvm-svn: 193575
2013-10-29 01:43:05 +00:00
Alexey Samsonov
08970d884d DWARF parser: Use ArrayRef to represent form sizes and simplify DWARFDIE::extractFast() interface. No functionality change.
llvm-svn: 193560
2013-10-28 23:41:49 +00:00
Alexey Samsonov
c8dd7e63e8 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

llvm-svn: 193553
2013-10-28 23:01:48 +00:00
Alexey Samsonov
4e8af73f01 [DebugInfo] Remove unneeded struct member and hide struct definition. No functionality change.
llvm-svn: 192954
2013-10-18 07:13:32 +00:00
Alexey Samsonov
5ed6e5276b [DebugInfo] Remove dead code.
llvm-svn: 192952
2013-10-18 07:03:16 +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
60884c0660 Remove dead code
llvm-svn: 191179
2013-09-22 18:25:32 +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
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
Eric Christopher
7112ce79dc Reformat comments here.
llvm-svn: 182901
2013-05-30 00:43:30 +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
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
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
Eric Christopher
bd3c66b31a Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this by
changing both the string of the dwo_name to be correct and the type of
the statement list.

Testcases all around.

llvm-svn: 172699
2013-01-17 03:00:04 +00:00
Eric Christopher
7c06c5fb2b Add the DW_AT_GNU_addr_base for the skeleton cu. Add support for
emitting the dwarf32 version of DW_FORM_sec_offset and correct
disassembler support.

llvm-svn: 172698
2013-01-17 02:59:59 +00:00
Eric Christopher
a159b6c731 Split address information for DWARF5 split dwarf proposal. This involves
using the DW_FORM_GNU_addr_index and a separate .debug_addr section which
stays in the executable and is fully linked.

Sneak in two other small changes:

a) Print out the debug_str_offsets.dwo section.
b) Change form we're expecting the entries in the debug_str_offsets.dwo
   section to take from ULEB128 to U32.

Add tests for all of this in the fission-cu.ll test.

llvm-svn: 172578
2013-01-15 23:56:56 +00:00
Eric Christopher
4b9394acd5 Whitespace and 80-col.
llvm-svn: 171804
2013-01-07 22:40:48 +00:00
Eric Christopher
ba738518f0 Add support for separating strings for the split debug info DWARF5
proposal. This leaves the strings in the skeleton die as strp,
but in all dwo files they're accessed now via DW_FORM_GNU_str_index.

Add support for dumping these sections and modify the fission-cu.ll
testcase to have the correct strings and form. Fix a small bug
in the fixed form sizes routine that involved out of array accesses
for the table and add a FIXME in the extractFast routine to fix
this up.

llvm-svn: 171779
2013-01-07 19:32:41 +00:00
Eric Christopher
03fdb543d9 Extend the dumping infrastructure to deal with additional
sections for debug info. These are some of the dwo sections from the
DWARF5 split debug info proposal. Update the fission-cu.ll testcase
to show what we should be able to dump more of now.

Work in progress: Ultimately the relocations will be gone for the
dwo section and the strings will be a different form (as well as
the rest of the sections will be included).

llvm-svn: 171428
2013-01-02 23:52:13 +00:00
Eric Christopher
c6fa1e95a2 Right now all of the relocations are 32-bit dwarf, and the relocation
information doesn't return an addend for Rel relocations. Go ahead
and use this information to fix relocation handling inside dwarfdump
for 32-bit ELF REL.

llvm-svn: 171126
2012-12-27 01:07:07 +00:00
Eric Christopher
5843894e1e Add some basic support for the fission addr forms to DebugInfo.
llvm-svn: 168223
2012-11-16 23:44:11 +00:00
Eric Christopher
9df7c1b185 Rewrite DIContext interface to take an object. Update all callers.
llvm-svn: 167757
2012-11-12 21:40:38 +00:00
Alexey Samsonov
8fee8dc998 Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor.
llvm-svn: 167728
2012-11-12 14:25:36 +00:00
Eric Christopher
b34bece6a8 Add a relocation visitor to lib object. This works via caching relocated
values in a map that can be passed to consumers. Add a testcase that
ensures this works for llvm-dwarfdump.

llvm-svn: 167558
2012-11-07 23:22:07 +00:00
Roman Divacky
85348270cd Stop casting away const qualifier needlessly.
llvm-svn: 163258
2012-09-05 22:26:57 +00:00
Eric Christopher
742a44014e Add support for some missing DW_FORM_*.
TODO: Fix code duplication and coding style.
llvm-svn: 162525
2012-08-24 01:14:23 +00:00
Benjamin Kramer
270e886395 Fix a C++11 UDL conflict.
Still not fixed in the standard ;)

llvm-svn: 154044
2012-04-04 20:33:56 +00:00
Benjamin Kramer
da83e60daf Audited all the format strings in libDebugInfo and fixed those that didn't match the types.
llvm-svn: 143814
2011-11-05 16:01:13 +00:00
Benjamin Kramer
3c2ba1a51a Add more PRI.64 macros for MSVC and use them throughout the codebase.
llvm-svn: 143799
2011-11-05 08:57:40 +00:00
Benjamin Kramer
900209189c DWARF: wire up .debug_str dumping.
llvm-svn: 139799
2011-09-15 16:57:13 +00:00
Benjamin Kramer
551244d899 DWARF: Fix indentation.
llvm-svn: 139774
2011-09-15 03:11:09 +00:00
Benjamin Kramer
c592744658 Style & indentation tweaks.
llvm-svn: 139646
2011-09-13 21:47:32 +00:00
Benjamin Kramer
c4e7a56915 Sketch out a DWARF parser.
This introduces a new library to LLVM: libDebugInfo. It will provide debug information
parsing to LLVM. Much of the design and some of the code is taken from the LLDB project.

It also contains an llvm-dwarfdump tool that can dump the abbrevs and DIEs from an
object file. It can be used to write tests for DWARF input and output easily.

llvm-svn: 139627
2011-09-13 19:42:23 +00:00