summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* [dwarfdump] Do not apply relocations in mach-o files if there is no ↵Frederic Riss2015-08-231-0/+8
| | | | | | | | | | | | | | LoadedObjectInfo. Not only do we not need to do anything to read correct values from the object files, but the current logic actually wrongly applies twice the section base address when there is no LoadedObjectInfo passed to the DWARFContext creation (as the added test shows). Simply do not apply any relocations on the mach-o debug info if there is no load offset to apply. llvm-svn: 245807
* Fix some comment typos.Benjamin Kramer2015-08-081-2/+2
| | | | llvm-svn: 244402
* Convert getSymbolSection to return an ErrorOr.Rafael Espindola2015-08-071-1/+1
| | | | | | | This function can actually fail since the symbol contains an index to the section and that can be invalid. llvm-svn: 244375
* [dwarfdump] Ignore scattered relocations for mach-o.Frederic Riss2015-07-311-3/+9
| | | | | | | | | | | | | | When encountering a scattered relocation, the code would assert trying to access an unexisting section. I couldn't find a way to expose the result of the processing of a scattered reloc, and I'm really unsure what the right thing to do is. This patch just skips them during the processing in DwarfContext and adds a mach-o file to the tests that exposed the asserting behavior. (This is a new failure that is being exposed by Rafael's recent work on the libObject interfaces. I think the wrong behavior has always happened, but now it's asserting) llvm-svn: 243778
* [RuntimeDyld] Make LoadedObjectInfo::getLoadedSectionAddress take a SectionRefLang Hames2015-07-281-4/+7
| | | | | | rather than a string section name. llvm-svn: 243456
* Return ErrorOr from getSymbolAddress.Rafael Espindola2015-07-031-1/+7
| | | | | | | It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. llvm-svn: 241366
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-4/+1
| | | | llvm-svn: 241042
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-2/+1
| | | | llvm-svn: 241033
* Don't return error_code from function that never fails.Rafael Espindola2015-06-291-2/+1
| | | | llvm-svn: 241021
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-233-5/+5
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Make getRelocationSection MachO only.Rafael Espindola2015-06-191-2/+7
| | | | | | | | | | | | | | There are 3 types of relocations on MachO * Scattered * Section based * Symbol based On ELF and COFF relocations are symbol based. We were in the strange situation that we abstracted over two of them. This makes section based relocations MachO only. llvm-svn: 240149
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-193-5/+5
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* [DWARF] Fix a bug in line info handlingKeno Fischer2015-05-311-62/+43
| | | | | | | | | | | | | | | | | | | | This fixes a bug in the line info handling in the dwarf code, based on a problem I when implementing RelocVisitor support for MachO. Since addr+size will give the first address past the end of the function, we need to back up one line table entry. Fix this by looking up the end_addr-1, which is the last address in the range. Note that this also removes a duplicate output from the llvm-rtdyld line table dump. The relevant line is the end_sequence one in the line table and has an offset of the first address part the end of the range and hence should not be included. Also factor out the common functionality into a separate function. This comes up on MachO much more than on ELF, since MachO doesn't store the symbol size separately, hence making said situation always occur. Differential Revision: http://reviews.llvm.org/D9925 llvm-svn: 238699
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+2
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* DebugInfo: .debug_line DWARF64 supportEd Maste2015-05-281-9/+18
| | | | | | | | | | | This adds support for the 64-bit DWARF format, but is still limited to less than 4GB of debug data by the DataExtractor class. Some versions of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't actually necessary. Differential Revision: http://reviews.llvm.org/D1988 llvm-svn: 238434
* Refactor: Simplify boolean conditional return statements in ↵Benjamin Kramer2015-05-252-8/+3
| | | | | | | | | | | llvm/lib/DebugInfo/DWARF Use clang-tidy to simplify boolean conditional return statements. Patch by Richard Thomson <legalize@xmission.com>! Differential Revision: http://reviews.llvm.org/D9972 llvm-svn: 238132
* Make it easier to use DwarfContext with MCJITKeno Fischer2015-05-211-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required at a higher layer. Reviewers: lhames, echristo Reviewed By: echristo Subscribers: vtjnash, friss, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D6961 llvm-svn: 237961
* [DWARF parser] Make DWARF parser more robust against missing compile/type units.Alexey Samsonov2015-05-194-16/+24
| | | | | | | | | | | | | | | | | | DWARF standard claims that each compilation/type unit header in .debug_info/.debug_types section must be followed by corresponding compile/type unit DIE, possibly with its children. Two situations are possible: * compile/type unit DIE is missing because DWARF producer failed to emit it. * DWARF parser failed to parse unit DIE correctly, for instance if it contains some unsupported attributes (see r237721, for instance). In either of these cases, the library, and the tools that use it (llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate checks to protect against this. llvm-svn: 237733
* [DWARF parser] Add basic support for DWZ DWARF multifile extensions.Alexey Samsonov2015-05-192-43/+51
| | | | | | | | | | | | | | | | | | | | | This change implements basic support for DWARF alternate sections proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt, which are used as references to .debug_info and .debug_str sections respectively, stored in a separate file, and possibly shared between different executables / shared objects. llvm-dwarfdump and llvm-symbolizer don't yet know how to access this alternate debug file (usually pointed by .gnu_debugaltlink section), but they can at lease properly parse and dump regular files, which refer to it. This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on files produced by running "dwz" tool. Such files are already installed on some modern Linux distributions. llvm-svn: 237721
* [DWARF] Add CIE header fields address_size and segment_size when generating ↵Keith Walker2015-05-121-7/+18
| | | | | | | | | | | | | dwarf-4 The DWARF-4 specification added 2 new fields in the CIE header called address_size and segment_size. Create these 2 new fields when generating dwarf-4 CIE entries, print out the new fields when dumping the CIE and update tests Differential Revision: http://reviews.llvm.org/D9558 llvm-svn: 237145
* Move DIContext.h to common DebugInfo location.Zachary Turner2015-04-233-20/+2
| | | | | | | | | | This will enable us to create a PDBContext so as to expose some amount of debug info functionality through a common interace. Differential Revision: http://reviews.llvm.org/D9205 Reviewed by: Alexey Samsonov llvm-svn: 235612
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-4/+2
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* DWARFFormValue: Add getAsSignedConstant method.Frederic Riss2015-03-041-0/+19
| | | | | | | The implementation accepts explicitely signed forms (DW_FORM_sdata), but also unsigned forms as long as they fit in an int64_t. llvm-svn: 231299
* Replace std::copy with a back inserter with vector append where feasibleBenjamin Kramer2015-02-281-2/+1
| | | | | | | | | All of the cases were just appending from random access iterators to a vector. Using insert/append can grow the vector to the perfect size directly and moves the growing out of the loop. No intended functionalty change. llvm-svn: 230845
* [dwarfdump] Fix frame info register number dump.Frederic Riss2015-02-251-1/+1
| | | | llvm-svn: 230559
* Try to appease buildbots.Frederic Riss2015-02-251-1/+1
| | | | | | It seems ArrayRefs to multi-dimensional arrays confuse some compilers. llvm-svn: 230554
* [dwarfdump] Make debug_frame dump actually useful.Frederic Riss2015-02-251-3/+136
| | | | | | | | | | | | | | | | | | | | | | | | This adds support for pretty-printing instruction operands. The new output looks like: 00000000 00000010 ffffffff CIE Version: 1 Augmentation: Code alignment factor: 1 Data alignment factor: -4 Return address column: 8 DW_CFA_def_cfa: reg4 +4 DW_CFA_offset: reg8 -4 DW_CFA_nop: DW_CFA_nop: 00000014 00000010 00000000 FDE cie=00000000 pc=00000000...00000022 DW_CFA_advance_loc: 3 DW_CFA_def_cfa_offset: +12 DW_CFA_nop: llvm-svn: 230551
* [dwarfdump] Don't print meaningless pointer.Frederic Riss2015-02-251-3/+0
| | | | | | | CIE pointers were never filled in before, and printing the pointer is totally pointless anyway. llvm-svn: 230550
* DWARFDebugFrame: Move some code around. NFC.Frederic Riss2015-02-251-13/+10
| | | | | | | Move the FrameEntry::dumpInstructions down in the file at some place where it can see the declarations of FDE and CIE. llvm-svn: 230549
* DWARFDebugFrame: Add some trivial accessors. NFC.Frederic Riss2015-02-251-0/+5
| | | | | | To be used for dumping. llvm-svn: 230548
* DWARFDebugFrame: Actually collect CIEs associated with FDEs.Frederic Riss2015-02-251-6/+11
| | | | | | | | This is the first commit in a small series aiming at making debug_frame dump more useful (right now it prints a list of opeartions without their operands). llvm-svn: 230547
* Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.Zachary Turner2015-02-111-0/+3
| | | | | | | | | | This allows IDEs to recognize the entire set of header files for each of the core LLVM projects. Differential Revision: http://reviews.llvm.org/D7526 Reviewed By: Chris Bieneman llvm-svn: 228798
* Move DebugInfo to DebugInfo/DWARF.Zachary Turner2015-01-3022-0/+4164
In preparation for adding PDB support to LLVM, this moves the DWARF parsing code to its own subdirectory under DebugInfo, and renames LLVMDebugInfo to LLVMDebugInfoDWARF. This is purely a mechanical / build system change. Differential Revision: http://reviews.llvm.org/D7269 Reviewed by: Eric Christopher llvm-svn: 227586
OpenPOWER on IntegriCloud