summaryrefslogtreecommitdiffstats
path: root/llvm/docs/SourceLevelDebugging.rst
Commit message (Collapse)AuthorAgeFilesLines
* [docs] NFC: Fix typos in documentsHans Wennborg2020-01-071-1/+1
| | | | | | | | | "the the" -> "the" "an" -> "a" Patch by Kazuaki Ishizaki <ishizaki@jp.ibm.com>! Differential revision: https://reviews.llvm.org/D72091
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-241-1/+1
| | | | as cleanups after D56351
* Fix a few typos in SourceLevelDebugging.rstAdrian Prantl2019-10-311-5/+5
|
* [DWARF5] Added support for deleted C++ special member functions.Adrian Prantl2019-10-291-0/+33
| | | | | | | | | | This patch adds support for deleted C++ special member functions in clang and llvm. Also added Defaulted member encodings for future support for defaulted member functions. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D69215
* Update link to the DWARF spec.Adrian Prantl2019-09-111-6/+6
| | | | llvm-svn: 371650
* Update documentation.Adrian Prantl2019-09-111-6/+6
| | | | llvm-svn: 371648
* [DebugInfo][Docs] Document that prologue/epilogue variable location changes ↵Jeremy Morse2019-06-181-4/+13
| | | | | | | | | | | | | | | | | | | | are ignored This patch documents that LLVM does not describe all changes in variable locations during the prologue and the epilogue. The debugger doesn't / shouldn't step through that portion of the function anyway, and describing every location through such stages would bloat location lists. Perform some minor cleanup at the same time, * Fix an enumerated list * Document that dbg.declare intrinsics have their variable location recorded in a MachineFunction table, not with DBG_VALUE meta-insts * Adds frame-indexes to the list of things that can be operands to DBG_VALUEs. Differential Revision: https://reviews.llvm.org/D63083 llvm-svn: 363654
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-011-2/+2
| | | | | | | | | | We use both -long-option and --long-option in tests. Switch to --long-option for consistency. In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf. While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf). llvm-svn: 359649
* [Docs] Switch a code block from LLVM to textJeremy Morse2019-04-151-1/+1
| | | | | | | | | | While I can't replicate this locally, it looks like the buildbots don't recognize the IR block in r358385 l764 as IR. Downgrade it to being just text while I look into it. http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30132 llvm-svn: 358391
* [Docs] Correct some indentation muppetry that trips buildbotsJeremy Morse2019-04-151-3/+3
| | | | llvm-svn: 358388
* [DebugInfo][Docs] Document variable location metadata transformationsJeremy Morse2019-04-151-0/+310
| | | | | | | | | | | | | This patch adds documentation explaining how variable location information is compiled from the IR representation down to the end of the codegen pipeline, but avoiding discussion of file formats and encoding. This should make it clearer how the dbg.value / dbg.declare etc intrinsics are transformed and arranged into DBG_VALUE instructions, and their meaning. Differential Revision: https://reviews.llvm.org/D59790 llvm-svn: 358385
* Add IR debug info support for Elemental, Pure, and Recursive Procedures.Adrian Prantl2019-03-141-0/+31
| | | | | | | | Patch by Eric Schweitz! Differential Revision: https://reviews.llvm.org/D54043 llvm-svn: 356163
* [DebugInfo][Docs] Document how dbg.value intrinsics are interpreted in ↵Jeremy Morse2019-03-131-0/+125
| | | | | | | | | | | | | | | | | optimized code This patch adds a section, ``Object lifetime in optimized code'', that documents how such intrinsics are supposed to be handled. It sets out some of the principles of how they specify variable locations, and how long those locations are valid for. This patch also documents one of the objectives behind the variable-location design, that we should never allow the debugger to observe a state of the program that would not have appeared without optimization. Differential Revision: https://reviews.llvm.org/D58726 llvm-svn: 356041
* Remove irrelevant references to legacy git repositories fromJames Y Knight2019-01-151-2/+2
| | | | | | | | | compiler identification lines in test-cases. (Doing so only because it's then easier to search for references which are actually important and need fixing.) llvm-svn: 351200
* It's itsPaul Robinson2018-11-191-1/+1
| | | | llvm-svn: 347271
* [IR] Add a boolean field in DILocation to know if a line must covered or notCalixte Denizet2018-09-201-0/+15
| | | | | | | | | | | | | | | | | | | | | Summary: Some lines have a hit counter where they should not have one. For example, in C++, some cleanup is adding at the end of a scope represented by a '}'. So such a line has a hit counter where a user expects to not have one. The goal of the patch is to add this information in DILocation which is used to get the covered lines in GCOVProfiling.cpp. A following patch in clang will add this information when generating IR (https://reviews.llvm.org/D49916). Reviewers: marco-c, davidxl, vsk, javed.absar, rnk Reviewed By: rnk Subscribers: eraman, xur, danielcdh, aprantl, rnk, dblaikie, #debug-info, vsk, llvm-commits, sylvestre.ledru Tags: #debug-info Differential Revision: https://reviews.llvm.org/D49915 llvm-svn: 342631
* Revamp test-suite documentationMatthias Braun2018-08-311-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove duplication: Both TestingGuide and TestSuiteMakefileGuide would give a similar overview over the test-suite. - Present cmake/lit as the default/normal way of running the test-suite: - Move information about the cmake/lit testsuite into the new TestSuiteGuide.rst file. Mark the remaining information in TestSuiteMakefilesGuide.rst as deprecated. - General simplification and shorting of language. - Remove paragraphs about tests known to fail as everything should pass nowadays. - Remove paragraph about zlib requirement; it's not required anymore since we copied a zlib source snapshot into the test-suite. - Remove paragraph about comparison with "native compiler". Correctness is always checked against reference outputs nowadays. - Change cmake/lit quickstart section to recommend `pip` for installing lit and use `CMAKE_C_COMPILER` and a cache file in the example as that is what most people will end up doing anyway. Also a section about compare.py to quickstart. - Document `Bitcode` and `MicroBenchmarks` directories. - Add section with commonly used cmake configuration options. - Add section about showing and comparing result files via compare.py. - Add section about using external benchmark suites. - Add section about using custom benchmark suites. - Add section about profile guided optimization. - Add section about cross-compilation and running on external devices. Differential Revision: https://reviews.llvm.org/D51465 llvm-svn: 341260
* [docs] Fix a small typo in a debug info exampleAlex Langford2018-08-211-1/+1
| | | | llvm-svn: 340246
* [docs] Continue working around broken Sphinx parsing of LLVM code blocksChandler Carruth2018-08-061-1/+1
| | | | | | by switching to `text` in another place. llvm-svn: 339001
* [docs] Remove the `dso_local` tag from these functions.Chandler Carruth2018-08-061-2/+2
| | | | | | | | | The sphinx build bot is erroring on these examples for some unknown reason, and really the dso_local doesn't seem to be relevant to the example in any way so its cleaner to omit it. And now they will look a bit more like other (successful) IR examples. llvm-svn: 338998
* [docs] Clarify role of DIExpressions within debug intrinsicsVedant Kumar2018-07-281-0/+5
| | | | | | | | | This should make the semantics of DIExpressions within llvm.dbg.{addr, declare, value} easier to understand. Differential Revision: https://reviews.llvm.org/D49572 llvm-svn: 338182
* [Docs] Testing Debug Info Preservation in OptimizationsAnastasis Grammenos2018-07-191-2/+179
| | | | | | Differential Revision: https://reviews.llvm.org/D49053 llvm-svn: 337457
* [docs] Update code block for compatibility with Sphinx 1.5.1Jonas Devlieghere2017-11-061-1/+1
| | | | | | | | | | | | | | | It is currently not possible to build the documentation with cmake and the same version of Sphinx (1.5.1) used to generate the public facing documentation on llvm.org. When code blocks cannot be parsed by Pygments, it generates a warning which is treated as an error. In addition to being annoying and confusing for developers, this needlessly increases the bar for newcomers that want to get involved. This patch removes the language specifier from the affected block. The result is the same as when parsing fails: the block are not highlighted. llvm-svn: 317472
* [docs] Fix a small typoVedant Kumar2017-10-261-2/+2
| | | | llvm-svn: 316682
* Re-land r313825: "[IR] Add llvm.dbg.addr, a control-dependent version of ↵Reid Kleckner2017-09-211-15/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | llvm.dbg.declare" The fix is to avoid invalidating our insertion point in replaceDbgDeclare: Builder.insertDeclare(NewAddress, DIVar, DIExpr, Loc, InsertBefore); + if (DII == InsertBefore) + InsertBefore = &*std::next(InsertBefore->getIterator()); DII->eraseFromParent(); I had to write a unit tests for this instead of a lit test because the use list order matters in order to trigger the bug. The reduced C test case for this was: void useit(int*); static inline void inlineme() { int x[2]; useit(x); } void f() { inlineme(); inlineme(); } llvm-svn: 313905
* Revert r313825: "[IR] Add llvm.dbg.addr, a control-dependent version of ↵Daniel Jasper2017-09-211-47/+15
| | | | | | | | | | | llvm.dbg.declare" .. as well as the two subsequent changes r313826 and r313875. This leads to segfaults in combination with ASAN. Will forward repro instructions to the original author (rnk). llvm-svn: 313876
* [IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declareReid Kleckner2017-09-201-15/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This implements the design discussed on llvm-dev for better tracking of variables that live in memory through optimizations: http://lists.llvm.org/pipermail/llvm-dev/2017-September/117222.html This is tracked as PR34136 llvm.dbg.addr is intended to be produced and used in almost precisely the same way as llvm.dbg.declare is today, with the exception that it is control-dependent. That means that dbg.addr should always have a position in the instruction stream, and it will allow passes that optimize memory operations on local variables to insert llvm.dbg.value calls to reflect deleted stores. See SourceLevelDebugging.rst for more details. The main drawback to generating DBG_VALUE machine instrs is that they usually cause LLVM to emit a location list for DW_AT_location. The next step will be to teach DwarfDebug.cpp how to recognize more DBG_VALUE ranges as not needing a location list, and possibly start setting DW_AT_start_offset for variables whose lifetimes begin mid-scope. Reviewers: aprantl, dblaikie, probinson Subscribers: eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D37768 llvm-svn: 313825
* Remove the obsolete offset parameter from @llvm.dbg.valueAdrian Prantl2017-07-281-6/+5
| | | | | | | | | | | | There is no situation where this rarely-used argument cannot be substituted with a DIExpression and removing it allows us to simplify the DWARF backend. Note that this patch does not yet remove any of the newly dead code. rdar://problem/33580047 Differential Revision: https://reviews.llvm.org/D35951 llvm-svn: 309426
* PR32382: Fix emitting complex DWARF expressions.Adrian Prantl2017-04-181-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DWARF specification knows 3 kinds of non-empty simple location descriptions: 1. Register location descriptions - describe a variable in a register - consist of only a DW_OP_reg 2. Memory location descriptions - describe the address of a variable 3. Implicit location descriptions - describe the value of a variable - end with DW_OP_stack_value & friends The existing DwarfExpression code is pretty much ignorant of these restrictions. This used to not matter because we only emitted very short expressions that we happened to get right by accident. This patch makes DwarfExpression aware of the rules defined by the DWARF standard and now chooses the right kind of location description for each expression being emitted. This would have been an NFC commit (for the existing testsuite) if not for the way that clang describes captured block variables. Based on how the previous code in LLVM emitted locations, DW_OP_deref operations that should have come at the end of the expression are put at its beginning. Fixing this means changing the semantics of DIExpression, so this patch bumps the version number of DIExpression and implements a bitcode upgrade. There are two major changes in this patch: I had to fix the semantics of dbg.declare for describing function arguments. After this patch a dbg.declare always takes the *address* of a variable as the first argument, even if the argument is not an alloca. When lowering a DBG_VALUE, the decision of whether to emit a register location description or a memory location description depends on the MachineLocation — register machine locations may get promoted to memory locations based on their DIExpression. (Future) optimization passes that want to salvage implicit debug location for variables may do so by appending a DW_OP_stack_value. For example: DBG_VALUE, [RBP-8] --> DW_OP_fbreg -8 DBG_VALUE, RAX --> DW_OP_reg0 +0 DBG_VALUE, RAX, DIExpression(DW_OP_deref) --> DW_OP_reg0 +0 All testcases that were modified were regenerated from clang. I also added source-based testcases for each of these to the debuginfo-tests repository over the last week to make sure that no synchronized bugs slip in. The debuginfo-tests compile from source and run the debugger. https://bugs.llvm.org/show_bug.cgi?id=32382 <rdar://problem/31205000> Differential Revision: https://reviews.llvm.org/D31439 llvm-svn: 300522
* [docs] Fix some typos. NFC.Vedant Kumar2016-11-011-15/+14
| | | | llvm-svn: 285772
* DebugInfo: make DW_TAG_atomic_type validVictor Leschuk2016-10-311-0/+1
| | | | | | | | | | | | | | DW_TAG_atomic_type was already included in Dwarf.defs and emitted correctly, however Verifier didn't recognize it as valid. Thus we introduce the following changes: * Make DW_TAG_atomic_type valid tag for IR and DWARF (enabled only with -gdwarf-5) * Add it to related docs * Add DebugInfo tests Differential Revision: https://reviews.llvm.org/D26144 llvm-svn: 285624
* DebugInfo: support for DWARFv5 DW_AT_alignment attributeVictor Leschuk2016-10-261-21/+26
| | | | | | | | | | | | * Assume that clang passes non-zero alignment value to DIBuilder only in case when it was forced by C++11 'alignas', C11 '_Alignas' or compiler attribute '__attribute__((aligned (N)))'. * Emit DW_AT_alignment if alignment is specified for type/object. Differential Revision: https://reviews.llvm.org/D24425 llvm-svn: 285189
* Revert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".Vassil Vassilev2016-10-261-26/+21
| | | | | | The commit broke the builds. llvm-svn: 285183
* DebugInfo: support for DWARFv5 DW_AT_alignment attributeVictor Leschuk2016-10-261-21/+26
| | | | | | | | | | | | * Assume that clang passes non-zero alignment value to DIBuilder only in case when it was forced by C++11 'alignas', C11 '_Alignas' or compiler attribute '__attribute__((aligned (N)))'. * Emit DW_AT_alignment if alignment is specified for type/object. Differential Revision: https://reviews.llvm.org/D24425 llvm-svn: 285181
* [docs] Fixing Sphinx warnings to unclog the buildbotRenato Golin2016-07-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Lots of blocks had "llvm" or "nasm" syntax types but either weren't following the syntax, or the syntax has changed (and sphinx hasn't keep up) or the type doesn't even exist (nasm?). Other documents had :options: what were invalid. I only removed those that had warnings, and left the ones that didn't, in order to follow the principle of least surprise. This is like this for ages, but the buildbot is now failing on errors. It may take a while to upgrade the buildbot's sphinx, if that's even possible, but that shouldn't stop us from getting docs updates (which seem down for quite a while). Also, we're not losing any syntax highlight, since when it doesn't parse, it doesn't colour. Ie. those blocks are not being highlighted anyway. I'm trying to get all docs in one go, so that it's easy to revert later if we do fix, or at least easy to know what's to fix. llvm-svn: 276109
* Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind.Adrian Prantl2016-07-141-1/+7
| | | | | | | | | | This adds Clang-specific DWARF constants for nullability and ObjC class properties that are already generated by clang. This patch adds dwarfdump support and a more comprehensive testcase. <rdar://problem/27335745> llvm-svn: 275354
* Add info to SourceLevelDebugging about CodeViewReid Kleckner2016-06-071-5/+78
| | | | | | | Adds some discussion of the nature of the format, and some developer docs on how to work with it in LLVM. llvm-svn: 272057
* testcase gardening: update the emissionKind enum to the new syntax. (NFC)Adrian Prantl2016-04-011-2/+2
| | | | llvm-svn: 265081
* Fix minor error with debug info doc.Mark Lacey2016-02-121-1/+1
| | | | | | Replace 'third' with 'fourth' in the description of the fourth argument. llvm-svn: 260656
* docs: Document function-attached metadata and IR changes from r252219.Peter Collingbourne2015-11-061-8/+7
| | | | llvm-svn: 252268
* Fix typos.Bruce Mitchener2015-09-121-1/+1
| | | | | | | | | | Summary: This fixes a variety of typos in docs, code and headers. Subscribers: jholewinski, sanjoy, arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D12626 llvm-svn: 247495
* DI: Require subprogram definitions to be distinctDuncan P. N. Exon Smith2015-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | As a follow-up to r246098, require `DISubprogram` definitions (`isDefinition: true`) to be 'distinct'. Specifically, add an assembler check, a verifier check, and bitcode upgrading logic to combat testcase bitrot after the `DIBuilder` change. While working on the testcases, I realized that test/Linker/subprogram-linkonce-weak-odr.ll isn't relevant anymore. Its purpose was to check for a corner case in PR22792 where two subprogram definitions match exactly and share the same metadata node. The new verifier check, requiring that subprogram definitions are 'distinct', precludes that possibility. I updated almost all the IR with the following script: git grep -l -E -e '= !DISubprogram\(.* isDefinition: true' | grep -v test/Bitcode | xargs sed -i '' -e 's/= \(!DISubprogram(.*, isDefinition: true\)/= distinct \1/' Likely some variant of would work for out-of-tree testcases. llvm-svn: 246327
* Update docs for accessing !dbg attachmentsDuncan P. N. Exon Smith2015-08-061-6/+5
| | | | llvm-svn: 244238
* DI: Remove DW_TAG_arg_variable and DW_TAG_auto_variableDuncan P. N. Exon Smith2015-07-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Remove the fake `DW_TAG_auto_variable` and `DW_TAG_arg_variable` tags, using `DW_TAG_variable` in their place Stop exposing the `tag:` field at all in the assembly format for `DILocalVariable`. Most of the testcase updates were generated by the following sed script: find test/ -name "*.ll" -o -name "*.mir" | xargs grep -l 'DILocalVariable' | xargs sed -i '' \ -e 's/tag: DW_TAG_arg_variable, //' \ -e 's/tag: DW_TAG_auto_variable, //' There were only a handful of tests in `test/Assembly` that I needed to update by hand. (Note: a follow-up could change `DILocalVariable::DILocalVariable()` to set the tag to `DW_TAG_formal_parameter` instead of `DW_TAG_variable` (as appropriate), instead of having that logic magically in the backend in `DbgVariable`. I've added a FIXME to that effect.) llvm-svn: 243774
* Fixed some typos and broken links in source level debugging docs.Michael Kuperstein2015-05-141-10/+10
| | | | llvm-svn: 237357
* IR: Give 'DI' prefix to debug info metadataDuncan P. N. Exon Smith2015-04-291-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* docs: Update LangRef and SourceLevelDebuggingDuncan P. N. Exon Smith2015-03-171-667/+108
| | | | | | | | | | | | | | Cleanup some bitrot in SourceLevelDebugging.rst. - Pull the still-relevant details about individual descriptors into LangRef.rst. Cut a lot of it to avoid over-describing the fields, as the C++ classes and assembly format are mostly self-describing now. If there's anything specific that I shouldn't have cut, let me know and I'll add it back. - Rewrite the remaining sections to refer to the new debug info hierarchy in LangRef.rst. llvm-svn: 232566
* DebugInfo: Remove DW_TAG_constantDuncan P. N. Exon Smith2015-02-091-1/+0
| | | | | | | | Remove handling for DW_TAG_constant. We started producing it in r110656, but reverted that in r110876 without dropping the support. Finish the job. llvm-svn: 228623
* Update dwarf::ApplePropertyAttributes enum to meaningful values.Frederic Riss2014-10-081-15/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently emit an DW_AT_APPLE_property_attribute with a value that is a bitfield describing the various attributes applied to an ObjectiveC property. While trying to add testing to one of my dwarfdump patches that would pretty print that, I realized this information looks totally broken and has maybe never been correct. As with every DWARF info, we have some enum in Dwarf.h that describes this attribute (enum ApplePropertyAttributes). It seems however that the attribute value is set from another definition of these flags in Sema/DeclSpec.h (enum ObjCPropertyAttributeKind). And these 2 enums aren't in sync. This patch updates the Dwarf.h values to the ones we are (and have been for a very long time) emitting. We change some publicly (and even documented in SourceLevelDebugging.rst) values, but I doubt this could be an issue as the information has been wrong for so long... Reviewers: echristo, dblaikie, aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5653 llvm-svn: 219311
* DI: Fixup global syntax in exampleDuncan P. N. Exon Smith2014-10-041-1/+1
| | | | llvm-svn: 219056
OpenPOWER on IntegriCloud