summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
* Add a "debugger tuning" concept that allows us to fine-tune how wePaul Robinson2015-07-152-1/+45
| | | | | | | | | | | emit debug info, according to the preferences of the different debuggers used on various targets. Darwin and FreeBSD default to tuning for LLDB; PS4 defaults to tuning for the SCE (Sony Computer Entertainment) debugger. All others default to GDB. Differential Revision: http://reviews.llvm.org/D8506 llvm-svn: 242338
* Debug Info: Add basic support for external types references.Adrian Prantl2015-07-151-0/+51
| | | | | | | | | | | | | | This is a necessary prerequisite for bootstrapping the emission of debug info inside modules. - Adds a FlagExternalTypeRef to DICompositeType. External types must have a unique identifier. - External type references are emitted using a forward declaration with a DW_AT_signature([DW_FORM_ref_sig8]) based on the UID. http://reviews.llvm.org/D9612 llvm-svn: 242302
* [CodeView] Add support for emitting column informationDavid Majnemer2015-07-094-34/+206
| | | | | | | | | | Column information is present in CodeView when the line table subsection has bit 0 set to 1 in it's flags field. The column information is represented as a pair of 16-bit quantities: a starting and ending column. This information is present at the end of the chunk, after all the line-PC pairs. llvm-svn: 241764
* Revert "[DWARF] Fix debug info generation for function static variables, ↵David Blaikie2015-07-011-129/+0
| | | | | | | | | | typedefs, and records" Caused PR24008 This reverts commit 37cb5f1c2db9f42d29f26b215585f56bb64ae4f5. llvm-svn: 241176
* Test committed in r241153 is more target-specific than I thought.Michael Kuperstein2015-07-011-1/+1
| | | | | | Moving the (original, x86-only) test to the X86 directory. llvm-svn: 241162
* Fix non-target-specific test not to use the x86 triple.Michael Kuperstein2015-07-011-1/+1
| | | | llvm-svn: 241158
* [DWARF] Fix debug info generation for function static variables, typedefs, ↵Michael Kuperstein2015-07-011-0/+129
| | | | | | | | | | | | | | | and records Function static variables, typedefs and records (class, struct or union) declared inside a lexical scope were associated with the function as their parent scope, rather than the lexical scope they are defined or declared in. This fixes PR19238 Patch by: amjad.aboud@intel.com Differential Revision: http://reviews.llvm.org/D9758 llvm-svn: 241153
* Debug info: Add dwarf backend support for DIModule.Adrian Prantl2015-06-301-0/+25
| | | | | | rdar://problem/20965932 llvm-svn: 241034
* Revert "Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed"Adrian Prantl2015-06-271-1/+1
| | | | | | This reverts commit 240890. Breaking the gdb buildbot. llvm-svn: 240893
* Don't use %llc_dwarf for target-specific tests.Benjamin Kramer2015-06-272-4/+2
| | | | | | Should fix running them on windows. llvm-svn: 240892
* Debug Info: One more bitfield bugfix. While yesterday's r240853 fixedAdrian Prantl2015-06-271-1/+1
| | | | | | | | | | the DW_AT_bit_offset computation, the byte offset is in fact also endian-dependent as it needs to point to the storage unit containing the most-significant bit of the the bitfield. I'm so looking forward to emitting the endian-agnostic DWARF 3 version instead. llvm-svn: 240890
* Add original source code to test case as suggested in review.Adrian Prantl2015-06-271-0/+58
| | | | llvm-svn: 240863
* Debug Info: Fix a bug in the DW_AT_bit_offset calculation that wouldAdrian Prantl2015-06-261-0/+45
| | | | | | | | | result in negative offsets and attempt a better job at documenting the algorithm. rdar://21082998 llvm-svn: 240853
* Debug info: Add more test coverage for bitfields.Adrian Prantl2015-06-261-0/+140
| | | | llvm-svn: 240834
* Make llvm-dwarfdump exit with non-zero exit code if error was occured.Alexey Samsonov2015-06-251-3/+3
| | | | llvm-svn: 240729
* Split test up into two target-spcific directories.Adrian Prantl2015-06-253-104/+148
| | | | llvm-svn: 240726
* Debug Info: Add basic test coverage for the DWARF encoding of bitfields.Adrian Prantl2015-06-251-0/+104
| | | | | | | | While looking at a couple of bugs in the debug info output for bitfields I noticed that there wasn't a single regression test to test my changes against, so here's a start. llvm-svn: 240717
* IAS: Use the root macro instanciation for locationFrederic Riss2015-06-251-0/+14
| | | | | | | | | | | | | | r224810 fixed the handling of macro debug locations in AsmParser. This patch fixes the logic to actually do what was intended: it uses the first macro of the macro stack instead of the last one. The updated testcase shows that the current scheme doesn't work when macro instanciations are nested and multiple files are used. Reviewers: compnerd Differential Revision: http://reviews.llvm.org/D10463 llvm-svn: 240705
* Make this test verify .debug_pubnames is actually missing.Paul Robinson2015-06-251-2/+2
| | | | | | It was matching at EOF regardless of whether the section was present. llvm-svn: 240679
* AsmPrinter: Don't emit empty .debug_loc entriesDuncan P. N. Exon Smith2015-06-211-0/+66
| | | | | | | | | | | If we don't know how to represent a .debug_loc entry, skip the entry entirely rather than emitting an empty one. Similarly, if a .debug_loc list has no entries, don't create the list. We still want to create the variables, just in an optimized-out form that doesn't have a DW_AT_location. llvm-svn: 240244
* Move the personality function from LandingPadInst to FunctionDavid Majnemer2015-06-177-17/+17
| | | | | | | | | | | | | | | | | | | The personality routine currently lives in the LandingPadInst. This isn't desirable because: - All LandingPadInsts in the same function must have the same personality routine. This means that each LandingPadInst beyond the first has an operand which produces no additional information. - There is ongoing work to introduce EH IR constructs other than LandingPadInst. Moving the personality routine off of any one particular Instruction and onto the parent function seems a lot better than have N different places a personality function can sneak onto an exceptional function. Differential Revision: http://reviews.llvm.org/D10429 llvm-svn: 239940
* Revert "[DWARF] Fix a few corner cases in expression emission"David Blaikie2015-06-091-110/+0
| | | | | | | This reverts commit r239380 due to apparently GDB regressions: http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/22562 llvm-svn: 239420
* llvm/test/DebugInfo/X86/expressions.ll: %llc_dwarf shouldn't be used with ↵NAKAMURA Takumi2015-06-091-2/+2
| | | | | | | | -mtriple, since %llc_dwarf implies the triple. In this case, use plain "llc". llvm-svn: 239390
* Move X86-only test case to appropriate directoryKeno Fischer2015-06-091-0/+0
| | | | llvm-svn: 239384
* [DWARF] Fix a few corner cases in expression emissionKeno Fischer2015-06-091-0/+110
| | | | | | | | | | | | | | | | | | | Summary: I noticed an object file with `DW_OP_reg4 DW_OP_breg4 0` as a DWARF expression, which I traced to a missing break (and `++I`) in this code snippet. While I was at it, I also added support for a few other corner cases along the same lines that I could think of. Test Plan: Hand-crafted test case to exercises these cases is included. Reviewers: echristo, dblaikie, aprantl Reviewed By: aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10302 llvm-svn: 239380
* Revert "[Object, ELF] Fix segmentation fault in ELFFile::getSectionName()."Alexey Samsonov2015-06-042-3/+0
| | | | | | This reverts commit r239124. llvm-svn: 239125
* [Object, ELF] Fix segmentation fault in ELFFile::getSectionName().Alexey Samsonov2015-06-042-0/+3
| | | | | | Don't do a null dereference if .shstrtab section is missing. llvm-svn: 239124
* [Object, ELF] Don't assert on invalid magic in createELFObjectFile.Alexey Samsonov2015-06-042-0/+2
| | | | | | Instead, return a proper error code from factory. llvm-svn: 239116
* [Object, ELF] Don't call llvm_unreachable() from createELFObjectFile.Alexey Samsonov2015-06-042-0/+2
| | | | | | Instead, return a proper error code from factory. llvm-svn: 239113
* Erase constant dbgloc on reuse in PHI nodeSergey Dmitrouk2015-06-041-0/+81
| | | | | | | | | | | | | | | | | | | | Basic block selection involves checking successor BBs for PHI nodes that depend on the current BB. In case such BBs are found, the value being selected is a constant and such constant already exists in current BB, it's value is reused. This might lead to wrong locations in some situations, especially if same constant value ends up being materialized twice in two different ways, which discards that sharing and leaves us with wrong debug location in the successor BB. In code this involves the following sequence of calls: SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks -> SelectionDAGBuilder::CopyValueToVirtualRegister -> SelectionDAGBuilder::getNonRegisterValue llvm-svn: 239089
* Improve test added in r238481.Alexey Samsonov2015-06-031-2/+2
| | | | llvm-svn: 238985
* [DWARF] Fix a bug in line info handlingKeno Fischer2015-05-312-9/+37
| | | | | | | | | | | | | | | | | | | | 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
* For COFF and MachO, compute the gap between to symbols.Rafael Espindola2015-05-311-1/+6
| | | | | | Before r238028 we used to do this in O(N^2), now we do it in O(N log N). llvm-svn: 238698
* Add RelocVisitor support for MachOKeno Fischer2015-05-303-0/+7
| | | | | | | | | | | | This commit adds partial support for MachO relocations to RelocVisitor. A simple test case is added to show that relocations are indeed being applied and that using llvm-dwarfdump on MachO files no longer errors. Correctness is not yet tested, due to an unrelated bug in DebugInfo, which will be fixed with appropriate testcase in a followup commit. Differential Revision: http://reviews.llvm.org/D8148 llvm-svn: 238663
* Object, ELF: Use error code instead of calling report_fatal_error()Alexey Samsonov2015-05-282-0/+4
| | | | | | | Make createELFObjectFile() return object_error::parse_failed on encountering invalid ELF file, instead of crashing the program. llvm-svn: 238481
* DebugInfo: .debug_line DWARF64 supportEd Maste2015-05-282-0/+15
| | | | | | | | | | | 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
* AsmPrinter: Emit the DwarfStringPool offset directly when possibleDuncan P. N. Exon Smith2015-05-242-5/+4
| | | | | | | | | | | | | Change `DwarfStringPool` to calculate byte offsets on-the-fly, and update `DwarfUnit::getLocalString()` to use a `DIEInteger` instead of a `DIEDelta` when Dwarf doesn't use relocations (i.e., Mach-O). This eliminates another call to `EmitLabelDifference()`, and drops memory usage from 865 MB down to 861 MB, around 0.5%. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 238114
* DebugInfo: Clarify test/DebugInfo/X86/stmt-list-multiple-compile-units.llDuncan P. N. Exon Smith2015-05-241-4/+6
| | | | | | | | This test was relying on the numbering of preceding .set directives, but an upcoming commit is going to remove some of them. Make the CHECKs more nuanced. llvm-svn: 238113
* Make it easier to use DwarfContext with MCJITKeno Fischer2015-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Temporary delete the test while we're investigating crashes in LLVMObject it ↵Alexey Samsonov2015-05-203-14/+0
| | | | | | causes. llvm-svn: 237809
* [DWARF parser] Add basic support for DWZ DWARF multifile extensions.Alexey Samsonov2015-05-194-0/+20
| | | | | | | | | | | | | | | | | | | | | 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
* [DebugInfo] Debug locations for constant SD nodesSergey Dmitrouk2015-05-136-6/+150
| | | | | | | | | | | | | | | | | | | | | Several updates for [DebugInfo] Add debug locations to constant SD nodes (r235989). Includes: * re-enabling the change (disabled recently); * missing change for FP constants; * resetting debug location of constant node if it's used more than at one place to prevent emission of wrong locations in case of coalesced constants; * a couple of additional tests. Now all look ups in CSEMap are wrapped by additional method. Comment in D9084 suggests that debug locations aren't useful for "target constants", so there might be one more change related to this API (namely, dropping debug locations for getTarget*Constant methods). Differential Revision: http://reviews.llvm.org/D9604 llvm-svn: 237237
* Disable r235989 "Reapply r235977 "[DebugInfo] Add debug locations to ↵Sergey Dmitrouk2015-05-073-0/+6
| | | | | | | | | constant SD nodes"" Will be re-enabled with missing changes for ConstantFPSDNode and fixes for wrong locations due to constant coalescing. llvm-svn: 236758
* DwarfDebug: Emit number of bytes in .debug_loc entry directlyDuncan P. N. Exon Smith2015-05-061-4/+1
| | | | | | | | | | | | | | | | | | | | | | Emit the number of bytes in a `.debug_loc` entry directly. The old code created temp labels (expensive), emitted the difference between them, and then emitted one on each side of the relevant bytes. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc` (the optimized version of ld64's `-save-temps` when linking the `verify-uselistorder` executable in an LTO bootstrap). I've hacked `MCContext::Allocate()` to just call `malloc()` instead of using the `BumpPtrAllocator` so that the heap profile is easier to read. As far as peak memory is concerned, `MCContext::Allocate()` is equivalent to a leak, since it only gets freed at process teardown. In my heap profile, this patch drops memory usage of `DwarfDebug::emitDebugLoc()` from 132.56 MB (11.4%) down to 29.86 MB (2.7%) at peak memory. Some of that must be noise from `SmallVector` (or other) allocations -- peak memory only dropped from 1160 MB down to 1100 MB -- but this nevertheless shaves 5% off the top.) llvm-svn: 236629
* DebugInfo: Use low_pc relative debug_ranges under fission when the CU has a ↵David Blaikie2015-05-021-2/+7
| | | | | | | | | low_pc Seems we were setting the base address on the wrong DwarfCompileUnit object so it wasn't being used when generating the ranges. llvm-svn: 236377
* IR: Give 'DI' prefix to debug info metadataDuncan P. N. Exon Smith2015-04-29237-4710/+4710
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finish off PR23080 by renaming the debug info IR constructs from `MD*` to `DI*`. The last of the `DIDescriptor` classes were deleted in r235356, and the last of the related typedefs removed in r235413, so this has all baked for about a week. Note: If you have out-of-tree code (like a frontend), I recommend that you get everything compiling and tests passing with the *previous* commit before updating to this one. It'll be easier to keep track of what code is using the `DIDescriptor` hierarchy and what you've already updated, and I think you're extremely unlikely to insert bugs. YMMV of course. Back to *this* commit: I did this using the rename-md-di-nodes.sh upgrade script I've attached to PR23080 (both code and testcases) and filtered through clang-format-diff.py. I edited the tests for test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns were off-by-three. It should work on your out-of-tree testcases (and code, if you've followed the advice in the previous paragraph). Some of the tests are in badly named files now (e.g., test/Assembler/invalid-mdcompositetype-missing-tag.ll should be 'dicompositetype'); I'll come back and move the files in a follow-up commit. llvm-svn: 236120
* Reapply r235977 "[DebugInfo] Add debug locations to constant SD nodes"Sergey Dmitrouk2015-04-283-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | [DebugInfo] Add debug locations to constant SD nodes This adds debug location to constant nodes of Selection DAG and updates all places that create constants to pass debug locations (see PR13269). Can't guarantee that all locations are correct, but in a lot of cases choice is obvious, so most of them should be. At least all tests pass. Tests for these changes do not cover everything, instead just check it for SDNodes, ARM and AArch64 where it's easy to get incorrect locations on constants. This is not complete fix as FastISel contains workaround for wrong debug locations, which drops locations from instructions on processing constants, but there isn't currently a way to use debug locations from constants there as llvm::Constant doesn't cache it (yet). Although this is a bit different issue, not directly related to these changes. Differential Revision: http://reviews.llvm.org/D9084 llvm-svn: 235989
* Revert "[DebugInfo] Add debug locations to constant SD nodes"Daniel Jasper2015-04-283-99/+0
| | | | | | | This breaks a test: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/23870 llvm-svn: 235987
* [DebugInfo] Add debug locations to constant SD nodesSergey Dmitrouk2015-04-283-0/+99
| | | | | | | | | | | | | | | | | | | | | | | This adds debug location to constant nodes of Selection DAG and updates all places that create constants to pass debug locations (see PR13269). Can't guarantee that all locations are correct, but in a lot of cases choice is obvious, so most of them should be. At least all tests pass. Tests for these changes do not cover everything, instead just check it for SDNodes, ARM and AArch64 where it's easy to get incorrect locations on constants. This is not complete fix as FastISel contains workaround for wrong debug locations, which drops locations from instructions on processing constants, but there isn't currently a way to use debug locations from constants there as llvm::Constant doesn't cache it (yet). Although this is a bit different issue, not directly related to these changes. Differential Revision: http://reviews.llvm.org/D9084 llvm-svn: 235977
* Use CIE version 1 for .eh_frame.Rafael Espindola2015-04-274-4/+4
| | | | | | | | | | According to http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/ehframechpt.html we should always use 1. llvm-svn: 235923
OpenPOWER on IntegriCloud