summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-dwp] Retrieve the DWOID from the CU for the cu_index entryDavid Blaikie2015-12-041-2/+8
| | | | llvm-svn: 254731
* dwarfdump: Correctly indentify the indicies for DWP recordsDavid Blaikie2015-12-031-1/+1
| | | | | | The indicies are one-based, not zero-based, per the spec. llvm-svn: 254626
* [llvm-dwp] Don't rely on implicit move assignment operator (MSVC won't ↵David Blaikie2015-12-021-2/+7
| | | | | | synthesize one) llvm-svn: 254492
* [llvm-dwp] Emit a rather fictional debug_cu_indexDavid Blaikie2015-12-022-13/+15
| | | | | | | | | | | | | | This is very rudimentary support for debug_cu_index, but it is enough to allow llvm-dwarfdump to find the offsets for contributions and correctly dump debug_info. It will need to actually find the real signature of the unit and build the real hash table with the right number of buckets, as per the DWP specification. It will also need to be expanded to cover the tu_index as well. llvm-svn: 254489
* Replace dyn_cast with isa in places that weren't using the returned value ↵Craig Topper2015-11-181-1/+1
| | | | | | for more than a boolean check. NFC. llvm-svn: 253441
* Fix null dereference committed in r253277David Blaikie2015-11-171-2/+3
| | | | llvm-svn: 253393
* dwarfdump: support indexed string dumping in dwp based on the STR_OFFSETS ↵David Blaikie2015-11-171-1/+5
| | | | | | component of the index llvm-svn: 253392
* dwarfdump: Reference the appropriate line table segment when dumping dwp filesDavid Blaikie2015-11-172-6/+10
| | | | | | Also improves .dwo type unit dumping which didn't handle this either. llvm-svn: 253377
* Fix indentationDavid Blaikie2015-11-171-1/+1
| | | | llvm-svn: 253278
* dwarfdump: Use the index to find the right abbrev offset in DWP filesDavid Blaikie2015-11-173-19/+93
| | | | llvm-svn: 253277
* dwarfdump: Add support for dumping the table contents of DWP indexesDavid Blaikie2015-11-131-5/+59
| | | | | | | | | | | | | This is a recommit of 252842 which was reverted in 252859. The issue was using %s format specifier for a StringRef - used Format's left_justify(StringRef, int) instead. It'd be nice to have __attribute__((format(..))) on llvm::format, but apparently it's only implemented for c-style variadics, not C++ variadic templates. Perhaps we could fix that & conditionalize the attribute on such... llvm-svn: 253065
* dwarfdump: Added macro support to llvm-dwarfdump tool.Amjad Aboud2015-11-125-1/+122
| | | | | | | | Added "macro" option to "-debug-dump" flag, which trigger parsing and dumping of the ".debug_macinfo" section. Differential Revision: http://reviews.llvm.org/D14294 llvm-svn: 252866
* Mostly revert 252842 due to failures on some buildbots.David Blaikie2015-11-121-59/+5
| | | | | | | | | | | | | | I imagine there's some UB in here somewhere, though Valgrind doesn't seem to have picked it up (not sure if I have a working asan build right now to test there). GDB bot seems to be crashing: http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/26267/steps/check-all/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dwp.test Hexagon ELF bot is, presumably, just getting different output: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/32927/steps/check-all/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dwp.test llvm-svn: 252859
* dwarfdump: Add error checking to fix the buildbots/correctnessDavid Blaikie2015-11-121-4/+4
| | | | llvm-svn: 252845
* dwarfdump: Add some error handling for DWP index sections of the wrong sizeDavid Blaikie2015-11-121-0/+7
| | | | llvm-svn: 252843
* dwarfdump: Dump the contents of DWP indexesDavid Blaikie2015-11-121-5/+82
| | | | llvm-svn: 252842
* dwarfdump: DWP type unit index dumping skeletonDavid Blaikie2015-11-111-0/+10
| | | | llvm-svn: 252786
* Format my previous commitDavid Blaikie2015-11-112-6/+5
| | | | llvm-svn: 252782
* dwarfdump: First piece of support for DWP dumpingDavid Blaikie2015-11-113-0/+52
| | | | | | Just a tiny piece of index dumping - the header in this instance. llvm-svn: 252781
* Use numeric_limits instead of LLONG_MAXMatt Arsenault2015-10-211-2/+2
| | | | | | | This is a build fix for configurations where LLONG_MAX is not defined in system headers. llvm-svn: 250946
* Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type ↵Craig Topper2015-09-211-2/+2
| | | | | | extra times. NFC llvm-svn: 248140
* [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
OpenPOWER on IntegriCloud