summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* llvm-dwarfdump: Add support for dumping the .debug_loc sectionDavid Blaikie2013-06-191-0/+19
| | | | | | | | | 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
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-051-3/+2
| | | | | | | | 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
* Change how we iterate over relocations on ELF.Rafael Espindola2013-05-301-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Hoist boundary condition out of loop header.Eric Christopher2013-05-061-1/+2
| | | | llvm-svn: 181248
* Untabify.Eric Christopher2013-05-061-5/+5
| | | | llvm-svn: 181247
* Don't emit .dwo sections unless they exist.Eric Christopher2013-05-061-24/+30
| | | | llvm-svn: 181224
* Clarify getRelocationAddress x getRelocationOffset a bit.Rafael Espindola2013-04-251-1/+1
| | | | | | | | | | 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
* Use zlib to uncompress debug sections in DWARF parser.Alexey Samsonov2013-04-231-0/+38
| | | | | | | This makes llvm-dwarfdump and llvm-symbolizer understand debug info sections compressed by ld.gold linker. llvm-svn: 180088
* Use StringSwitch instead of long chain of if-else. No functionality change.Alexey Samsonov2013-04-171-37/+28
| | | | llvm-svn: 179682
* Add support for the pubnames section to llvm-dwarfdump.Krzysztof Parzyszek2013-02-121-0/+20
| | | | llvm-svn: 174976
* Initial support for DWARF CFI parsing and dumping in LLVMEli Bendersky2013-02-051-1/+29
| | | | llvm-svn: 174463
* Add DIContext::getLineInfoForAddressRange() function and test. This ↵Andrew Kaylor2013-01-261-0/+58
| | | | | | function allows a caller to obtain a table of line information for a function using the function's address and size. llvm-svn: 173537
* Add support for applying in-memory relocations to the .debug_line section ↵Andrew Kaylor2013-01-251-4/+14
| | | | | | 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. llvm-svn: 173517
* Add command-line flags for DWARF dumping.Eli Bendersky2013-01-251-62/+82
| | | | | | | Flags for dumping specific DWARF sections added in lib/DebugInfo and llvm-dwarfdump. llvm-svn: 173480
* Split address information for DWARF5 split dwarf proposal. This involvesEric Christopher2013-01-151-1/+13
| | | | | | | | | | | | | | | 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
* [Object, DebugInfo] Make DWARFContext BE-aware.NAKAMURA Takumi2013-01-091-1/+1
| | | | | | test/DebugInfo/member-pointers.ll would not fail in targetting BE any more. llvm-svn: 171943
* Add support for separating strings for the split debug info DWARF5Eric Christopher2013-01-071-1/+5
| | | | | | | | | | | | | 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
* Extend the dumping infrastructure to deal with additionalEric Christopher2013-01-021-7/+70
| | | | | | | | | | | | 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
* Don't skip __DWARF,Rafael Espindola2012-12-211-2/+0
| | | | | | | 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. llvm-svn: 170839
* The section is .debug_line.Eric Christopher2012-11-271-1/+1
| | | | llvm-svn: 168666
* [DebugInfo] Generate address ranges for compile units even if .debug_aranges ↵Alexey Samsonov2012-11-161-2/+4
| | | | | | is present: it is often the case that .debug_aranges section contains ranges only for a small subset of compile units. Test cases will be added in separate commits. llvm-svn: 168144
* Rewrite DIContext interface to take an object. Update all callers.Eric Christopher2012-11-121-0/+80
| | | | llvm-svn: 167757
* Use a typedef to reduce some typing and reformat code accordingly.Eric Christopher2012-10-161-12/+17
| | | | llvm-svn: 166077
* Variable name cleanup.Eric Christopher2012-10-161-4/+4
| | | | llvm-svn: 166076
* Add support for fetching inlining context (stack of source code locations)Alexey Samsonov2012-09-041-14/+73
| | | | | | | | | | | by instruction address from DWARF. Add --inlining flag to llvm-dwarfdump to demonstrate and test this functionality, so that "llvm-dwarfdump --inlining --address=0x..." now works much like "addr2line -i 0x...", provided that the binary has debug info (Clang's -gline-tables-only *is* enough). llvm-svn: 163128
* Refactor fetching file/line info from DWARFContext to simplify theAlexey Samsonov2012-08-301-57/+75
| | | | | | | | code and allow better code reuse. Make the code a bit more conforming to LLVM code style. No functionality change. llvm-svn: 162895
* Add basic support for .debug_ranges section to LLVM's DebugInfo library.Alexey Samsonov2012-08-271-1/+15
| | | | | | | | | | | This section (introduced in DWARF-3) is used to define instruction address ranges for functions that are not contiguous and can't be described by low_pc/high_pc attributes (this is the usual case for inlined subroutines). The patch is the first step to support fetching complete inlining info from DWARF. Reviewed by Benjamin Kramer. llvm-svn: 162657
* Fix the representation of debug line table in DebugInfo LLVM library,Alexey Samsonov2012-08-071-3/+1
| | | | | | | | | | | | | and "instruction address -> file/line" lookup. Instead of plain collection of rows, debug line table for compilation unit is now treated as the number of row ranges, describing sequences (series of contiguous machine instructions). The sequences are not always listed in the order of increasing address, so previously used std::lower_bound() sometimes produced wrong results. Now the instruction address lookup consists of two stages: finding the correct sequence, and searching for address in range of rows for this sequence. llvm-svn: 161414
* DebugInfo library: add support for fetching absolute paths to source filesAlexey Samsonov2012-07-191-3/+27
| | | | | | | | (instead of basenames) from DWARF. Use this behavior in llvm-dwarfdump tool. Reviewed by Benjamin Kramer. llvm-svn: 160496
* Improve behavior of DebugInfoEntryMinimal::getSubprogramName() introduced in ↵Alexey Samsonov2012-07-171-2/+4
| | | | | | | | | | | r159512. To fetch a subprogram name we should not only inspect the DIE for this subprogram, but optionally inspect its specification, or its abstract origin (even if there is no inlining), or even specification of an abstract origin. Reviewed by Benjamin Kramer. llvm-svn: 160365
* This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF ↵Alexey Samsonov2012-07-021-19/+31
| | | | | | | | | | parser: 1) DIContext is now able to return function name for a given instruction address (besides file/line info). 2) llvm-dwarfdump accepts flag --functions that prints the function name (if address is specified by --address flag). 3) test case that checks the basic functionality of llvm-dwarfdump added llvm-svn: 159512
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* DWARF: Reset the state after parsing a line table prologue and remove an ↵Benjamin Kramer2011-09-151-4/+2
| | | | | | unnecessary lookup. llvm-svn: 139859
* DWARF: Don't crash when looking up an invalid address.Benjamin Kramer2011-09-151-0/+6
| | | | llvm-svn: 139846
* DWARF: Put all the pieces we have together and provide a single accessor to ↵Benjamin Kramer2011-09-151-0/+49
| | | | | | DIContext that provides line information when given an address. llvm-svn: 139836
* DWARF: Remove accessors that parse the whole line table section in one go, ↵Benjamin Kramer2011-09-151-9/+19
| | | | | | | | this can't possibly work. The address size is specified by the compile unit associated with a line table, there is no global address size. llvm-svn: 139835
* DWARF: Print line tables per compile unit, so they get the right address size.Benjamin Kramer2011-09-151-3/+14
| | | | llvm-svn: 139808
* DWARF: wire up .debug_str dumping.Benjamin Kramer2011-09-151-1/+12
| | | | llvm-svn: 139799
* DWARF: Add basic support for line tables.Benjamin Kramer2011-09-151-0/+15
| | | | | | The llvm-dwarfdump output isn't very verbose yet. llvm-svn: 139771
* DWARF: Generate the address lookup table from the DIE tree if .debug_aranges ↵Benjamin Kramer2011-09-141-0/+2
| | | | | | | | is not available. Ported from LLDB. llvm-svn: 139732
* DWARF: Port support for parsing .debug_aranges section from LLDB and wire it ↵Benjamin Kramer2011-09-141-0/+22
| | | | | | | | | up to llvm-dwarfdump. This is only one half of it, the part that caches address ranges from the DIEs when .debug_aranges is not available will be ported soon. llvm-svn: 139680
* Sketch out a DWARF parser.Benjamin Kramer2011-09-131-0/+43
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
OpenPOWER on IntegriCloud