summaryrefslogtreecommitdiff
path: root/lib/DebugInfo
Commit message (Collapse)AuthorAge
...
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-05
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183284 91177308-0d34-0410-b5e6-96231b3b80d8
* Change how we iterate over relocations on ELF.Rafael Espindola2013-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182908 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat comments here.Eric Christopher2013-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182901 91177308-0d34-0410-b5e6-96231b3b80d8
* libDebugInfo depends on libObject nowadays.Benjamin Kramer2013-05-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181510 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist boundary condition out of loop header.Eric Christopher2013-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181248 91177308-0d34-0410-b5e6-96231b3b80d8
* Untabify.Eric Christopher2013-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181247 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't emit .dwo sections unless they exist.Eric Christopher2013-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181224 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify getRelocationAddress x getRelocationOffset a bit.Rafael Espindola2013-04-25
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180259 91177308-0d34-0410-b5e6-96231b3b80d8
* Use zlib to uncompress debug sections in DWARF parser.Alexey Samsonov2013-04-23
| | | | | | | | This makes llvm-dwarfdump and llvm-symbolizer understand debug info sections compressed by ld.gold linker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180088 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove variable store that is never read.Eric Christopher2013-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180013 91177308-0d34-0410-b5e6-96231b3b80d8
* Use StringSwitch instead of long chain of if-else. No functionality change.Alexey Samsonov2013-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179682 91177308-0d34-0410-b5e6-96231b3b80d8
* Create a stub for DWARF parser unittestsAlexey Samsonov2013-04-17
| | | | | | | | Moves one DWARF-specific header to include/llvm/DebugInfo from lib/. Add a short unittest for r179095. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179678 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the C function to create a SLPVectorizerPass to something sane and ↵Benjamin Kramer2013-04-11
| | | | | | expose it in the header file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179272 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the ↵Alexey Samsonov2013-04-09
| | | | | | 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
* DWARF parser: remove duplicated code and fix code style in DIE extractors.Alexey Samsonov2013-04-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179023 91177308-0d34-0410-b5e6-96231b3b80d8
* DW_FORM_sec_offset should be a relocation on platforms that useEric Christopher2013-04-07
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178969 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix missing std::. Not sure how this compiles for anyone else.Matt Arsenault2013-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177620 91177308-0d34-0410-b5e6-96231b3b80d8
* xlC doesn't like Header being both a type and a member variable. Rename theRafael Espindola2013-03-20
| | | | | | | | member variable. Patch by Kai <kai@redstar.de> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177575 91177308-0d34-0410-b5e6-96231b3b80d8
* Code cleanup: pass Offset by pointer to parseInstruction to more explicitlyEli Bendersky2013-02-22
| | | | | | | | | convey that it's a INOUT argument. Also, if parsing of entry instructions fails, don't push the entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175847 91177308-0d34-0410-b5e6-96231b3b80d8
* Previously, parsing capability of the .debug_frame section was addedEli Bendersky2013-02-21
| | | | | | | | | | | | | | | | | to lib/DebugInfo, with dumping in llvm-dwarfdump. This patch adds initial ability to parse and dump CFA instructions contained in entries. To keep it manageable, the patch omits some more advanced capabilities (accounted in TODOs): * Parsing of instructions with BLOCK arguments (expression lists) * Dumping of actual instruction arguments (currently only names are dumped). This is quite tricky since the dumper has to effectively "interpret" the instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175820 91177308-0d34-0410-b5e6-96231b3b80d8
* Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C ↵Benjamin Kramer2013-02-15
| | | | | | linkage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175264 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the pubnames section to llvm-dwarfdump.Krzysztof Parzyszek2013-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174976 91177308-0d34-0410-b5e6-96231b3b80d8
* The patch to fix some issues in r174543 fixed the lines failing the test, ↵David Tweed2013-02-08
| | | | | | | | | | but missed a couple of lines which weren't being explicitly looked at and were printing incorrect results. These values clearly must lie within 32 bits, so the casts are definitely safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174717 91177308-0d34-0410-b5e6-96231b3b80d8
* FDE::dumpHeader(): Forgot to fix one more formatting, ... take two!NAKAMURA Takumi2013-02-07
| | | | | | Excuse me, I could not test it locally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174614 91177308-0d34-0410-b5e6-96231b3b80d8
* FDE::dumpHeader(): Forgot to fix one more formatting. It affected bigendian ↵NAKAMURA Takumi2013-02-07
| | | | | | hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174602 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARFDebugFrame.cpp: Fix formatting on i686 hosts.NAKAMURA Takumi2013-02-07
| | | | | | FIXME: Are they really truncated to i32 from i64 unconditionally? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174574 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments to new frame entriesEli Bendersky2013-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174515 91177308-0d34-0410-b5e6-96231b3b80d8
* Failing builds because a private class member is not being used afterEli Bendersky2013-02-06
| | | | | | | initialization is one of the reasons I consider -werror to be shoddy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174485 91177308-0d34-0410-b5e6-96231b3b80d8
* Add virtual desctructor to FrameEntry to avoid error on delete-non-virtual-dtorEli Bendersky2013-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174483 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some formatting & add comments, following Eric's reviewEli Bendersky2013-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174473 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing file to CMake listEli Bendersky2013-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174465 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for DWARF CFI parsing and dumping in LLVMEli Bendersky2013-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174463 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARFDebugLine.cpp: Fix true path. Did you forget "return true" here?NAKAMURA Takumi2013-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173552 91177308-0d34-0410-b5e6-96231b3b80d8
* Add DIContext::getLineInfoForAddressRange() function and test. This ↵Andrew Kaylor2013-01-26
| | | | | | function allows a caller to obtain a table of line information for a function using the function's address and size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173537 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a warning in the new DWARFheader. Add a new line at the end of the file.Nadav Rotem2013-01-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173518 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for applying in-memory relocations to the .debug_line section ↵Andrew Kaylor2013-01-25
| | | | | | and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section. Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173517 91177308-0d34-0410-b5e6-96231b3b80d8
* Add command-line flags for DWARF dumping.Eli Bendersky2013-01-25
| | | | | | | | | Flags for dumping specific DWARF sections added in lib/DebugInfo and llvm-dwarfdump. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173480 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this byEric Christopher2013-01-17
| | | | | | | | | changing both the string of the dwo_name to be correct and the type of the statement list. Testcases all around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172699 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the DW_AT_GNU_addr_base for the skeleton cu. Add support forEric Christopher2013-01-17
| | | | | | | emitting the dwarf32 version of DW_FORM_sec_offset and correct disassembler support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172698 91177308-0d34-0410-b5e6-96231b3b80d8
* Split address information for DWARF5 split dwarf proposal. This involvesEric Christopher2013-01-15
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172578 91177308-0d34-0410-b5e6-96231b3b80d8
* [Object, DebugInfo] Make DWARFContext BE-aware.NAKAMURA Takumi2013-01-09
| | | | | | test/DebugInfo/member-pointers.ll would not fail in targetting BE any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171943 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace and 80-col.Eric Christopher2013-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171804 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for separating strings for the split debug info DWARF5Eric Christopher2013-01-07
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171779 91177308-0d34-0410-b5e6-96231b3b80d8
* Update comment.Eric Christopher2013-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171689 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a space to the end of the line so we don't get "itsbounds" in output.Eric Christopher2013-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171487 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the dumping infrastructure to deal with additionalEric Christopher2013-01-02
| | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171428 91177308-0d34-0410-b5e6-96231b3b80d8
* Right now all of the relocations are 32-bit dwarf, and the relocationEric Christopher2012-12-27
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171126 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't skip __DWARF,Rafael Espindola2012-12-21
| | | | | | | Now that we don't merge section and segment names, we don't need to skip the segment name to get to the section name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170839 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-19
| | | | | | single attribute in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-04
| | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8