summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-0613-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* [DWARF] Adding support for the DWARF v5 string offsets table ↵Wolfgang Pieb2017-06-063-33/+176
| | | | | | | | | | (consumer/reader part only). Reviewers: dblaikie, aprantl Differential Revision: https://reviews.llvm.org/D32779 llvm-svn: 304759
* [DWARF] Introduce Dump OptionsAdrian Prantl2017-06-011-2/+6
| | | | | | | | | | | This commit introduces a structure that holds all the flags that control the pretty printing of dwarf output. Patch by Spyridoula Gravani! Differential Revision: https://reviews.llvm.org/D33749 llvm-svn: 304446
* Recommit "[DWARF] - Make collectAddressRanges() return section index in ↵George Rimar2017-05-274-34/+50
| | | | | | | | | | | | | | | | | | | | | | addition to Low/High PC" With fix of uninitialized variable. Original commit message: This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 304078
* Revert r304002 "[DWARF] - Make collectAddressRanges() return section index ↵George Rimar2017-05-264-49/+34
| | | | | | | | in addition to Low/High PC" Revert it again. Now another bot unhappy: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/8750 llvm-svn: 304011
* [DWARF] - Make collectAddressRanges() return section index in addition to ↵George Rimar2017-05-264-34/+49
| | | | | | | | | | | | | | | | | | Low/High PC This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 304002
* Revert "[DWARF] - Make collectAddressRanges() return section index in ↵George Rimar2017-05-264-47/+34
| | | | | | | | | | | | addition to Low/High PC" Broked BB again: TEST 'LLVM :: DebugInfo/X86/dbg-value-regmask-clobber.ll' FAILED ... LLVM ERROR: Section was outside of section table. llvm-svn: 303984
* Recommit r303978 "[DWARF] - Make collectAddressRanges() return section index ↵George Rimar2017-05-264-34/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | in addition to Low/High PC" With fix of test compilation. Initial commit message: This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 303983
* Revert r303978 "[DWARF] - Make collectAddressRanges() return section index ↵George Rimar2017-05-264-47/+34
| | | | | | | | in addition to Low/High PC" It failed BB. llvm-svn: 303981
* [DWARF] - Make collectAddressRanges() return section index in addition to ↵George Rimar2017-05-264-34/+47
| | | | | | | | | | | | | | | | | | | | | | Low/High PC This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 303978
* libDebugInfo: Support symbolizing using DWP filesDavid Blaikie2017-05-232-13/+44
| | | | llvm-svn: 303609
* FIX: Remove debugging assert left in previous commitDavid Blaikie2017-05-231-1/+0
| | | | | | Sorry for the bot noise. llvm-svn: 303592
* libDebugInfo: Avoid independently parsing the same .dwo file for two ↵David Blaikie2017-05-232-27/+38
| | | | | | | | | separate CUs residing there NFC, just an optimization. Will be building on this for DWP support shortly. llvm-svn: 303591
* libDebugInfo/DWARF: Apply relocations for debug_addr addresses in object filesDavid Blaikie2017-05-222-20/+22
| | | | | | | | | | | llvm-symbolizer would fail to symbolize addresses in unlinked object files when handling .dwo file data because the addresses would not be relocated in the same way as the ranges in the skeleton CU in the object file. Fix that so object files can be symbolized the same as executables. llvm-svn: 303532
* llvm-symbolizer: Support multiple CUs in a single DWO fileDavid Blaikie2017-05-201-6/+11
| | | | llvm-svn: 303482
* [DWARF] - Simplify RelocVisitor implementation.George Rimar2017-05-181-2/+2
| | | | | | | | | We do not need to store relocation width field. Patch removes relative code, that simplifies implementation. Differential revision: https://reviews.llvm.org/D33274 llvm-svn: 303335
* [lib/Object] - Minor API update for llvm::Decompressor.George Rimar2017-05-181-1/+1
| | | | | | | | | | | | | | | | | I revisited Decompressor API (issue with it was triggered during D32865 review) and found it is probably provides more then we really need. Issue was about next method's signature: Error decompress(SmallString<32> &Out); It is too strict. At first I wanted to change it to decompress(SmallVectorImpl<char> &Out), but then found it is still not flexible because sticks to SmallVector. During reviews was suggested to use templating to simplify code. Patch do that. Differential revision: https://reviews.llvm.org/D33200 llvm-svn: 303331
* [DWARF] - Cleanup relocations proccessing.George Rimar2017-05-171-39/+22
| | | | | | | | | | | | | | | RelocAddrMap was a pair of <width, address>, where width is relocation size (4/8/x, x < 8), and width field was never used in code. Relocations proccessing loop had checks for width field. Does not look like DWARF parser should do that. There is probably no much sense to validate relocations during proccessing them in parser. Patch removes relocation's width relative code from DWARFContext. Differential revision: https://reviews.llvm.org/D33194 llvm-svn: 303251
* [DWARF] - Add RelocAddrEntry for cleanup. NFCi.George Rimar2017-05-161-2/+2
| | | | | | Was mentioned as possible cleanup during review of D33184. llvm-svn: 303171
* [DWARF] - Use DWARFAddressRange struct instead of uint64_t pair for ↵George Rimar2017-05-164-19/+18
| | | | | | | | | | | DWARFAddressRangesVector. Recommit of r303159 "[DWARF] - Use DWARFAddressRange struct instead of uint64_t pair for DWARFAddressRangesVector" All places were shitched to use DWARFAddressRange now. Suggested during review of D33184. llvm-svn: 303163
* Revert r303159 "[DWARF] - Use DWARFAddressRange struct instead of uint64_t ↵George Rimar2017-05-162-8/+10
| | | | | | | | | pair for DWARFAddressRangesVector." Something went wrong, it broke BB. http://green.lab.llvm.org/green//job/clang-stage1-cmake-RA-incremental_build/38477/consoleFull#-200034420049ba4694-19c4-4d7e-bec5-911270d8a58c llvm-svn: 303162
* [DWARF] - Use DWARFAddressRange struct instead of uint64_t pair for ↵George Rimar2017-05-162-10/+8
| | | | | | | | DWARFAddressRangesVector. Suggested during review of D33184. llvm-svn: 303159
* [DWARF] - Speedup handling of relocations in DWARFContextInMemory.George Rimar2017-05-151-4/+17
| | | | | | | | | | | | | | | | | | | I am working on a speedup of building .gdb_index in LLD and noticed that relocations that are proccessed in DWARFContextInMemory often uses the same symbol in a row. This patch introduces caching to reduce the relocations proccessing time. For benchmark, I took debug LLC binary objects configured with -ggnu-pubnames and linked it using LLD. Link time without --gdb-index is about 4,45s. Link time with --gdb-index: a) Without patch: 19,16s b) With patch: 15,52s That means time spent on --gdb-index in this configuration is 19,16s - 4,45s = 14,71s (without patch) vs 15,52s - 4,45s = 11,07s (with patch). Differential revision: https://reviews.llvm.org/D31136 llvm-svn: 303051
* [DWARF] Fix a parsing issue with type unit headers.Wolfgang Pieb2017-05-091-1/+5
| | | | | | | | Reviewers: dblaikie Differential Revision: https://reviews.llvm.org/D32987 llvm-svn: 302574
* Revert "[Dwarf] Disable reference verification for now (PR32972)"Diana Picus2017-05-091-2/+1
| | | | | | This reverts commit r302520 because it break the unit tests. llvm-svn: 302524
* [Dwarf] Disable reference verification for now (PR32972)Renato Golin2017-05-091-1/+2
| | | | | | | | | | | | | | | There is no other explanation about why this only started happening now, even though it crashes on old code (supposedly reachable from here). The only common factor between the failing bots is that they use GCC (4.9 and 5.3) to compile Clang, while the others use Clang 3.8, but the failure is while building the tests, as an assertion, on Clang. Commenting it out for now in hope the bots will go back green, but we should keep looking for the real cause, and update bugzilla. llvm-svn: 302520
* Add const to "DWARFDie &Die" in a few functions as they can't change the ↵Greg Clayton2017-05-081-2/+2
| | | | | | DWARFDie. llvm-svn: 302471
* Fix typoEugene Zemtsov2017-05-081-1/+1
| | | | llvm-svn: 302470
* Fix typo "veify" to "verify".Greg Clayton2017-05-081-1/+1
| | | | llvm-svn: 302466
* [llvm-dwarfdump] - Print an error message if section decompression failed.George Rimar2017-05-051-10/+25
| | | | | | | | | | | | | llvm-dwarfdump currently prints no message if decompression fails for some reason. I noticed that during work on one of LLD patches where LLD produced an broken output. It was a bit confusing to see no output for section dumped and no any error message at all. Patch adds error message for such cases. Differential revision: https://reviews.llvm.org/D32865 llvm-svn: 302221
* Don't return an invalid line table if the DW_AT_stmt_list value is not in ↵Greg Clayton2017-05-041-0/+4
| | | | | | the .debug_line section. llvm-svn: 302180
* clang-format and restyle DWARFFormValue before working on it. NFCPaul Robinson2017-05-031-280/+301
| | | | llvm-svn: 302086
* Break verification down into smaller functions to keep code clean.Greg Clayton2017-05-031-142/+167
| | | | | | | | Adrian requested that we break things down to make things clean in the DWARFVerifier. This patch breaks everything down into nice individual functions and cleans up the code quite a bit and prepares us for the next round of verifiers. Differential Revision: https://reviews.llvm.org/D32812 llvm-svn: 302062
* Create DWARFVerifier.cpp and .h and move all DWARF verification code over ↵Greg Clayton2017-05-033-7/+261
| | | | | | | | | | into it. Adrian requested we create a DWARFVerifier.cpp file to contain all of the DWARF verification stuff. This change simply moves the functionality over into DWARFVerifier.h and DWARFVerifier.cpp, renames the DWARFVerifier methods to start with lower case, and switches DWARFContext.cpp over to using the new functionality. Differential Revision: https://reviews.llvm.org/D32809 llvm-svn: 302044
* Verify that no compile units share the same line table in "llvm-dwarfdump ↵Greg Clayton2017-05-031-2/+19
| | | | | | | | | | --verify" Check to make sure no compile units have the same DW_AT_stmt_list values. Report a verification error if they do. Differential Revision: https://reviews.llvm.org/D32771 llvm-svn: 302039
* Add line table verification to lldb-dwarfdump --verifyGreg Clayton2017-05-022-3/+80
| | | | | | | | | | | | This patch verifies the .debug_line: - verify all addresses in a line table sequence have ascending addresses - verify that all line table file indexes are valid Unit tests added for both cases. Differential Revision: https://reviews.llvm.org/D32765 llvm-svn: 301984
* [DWARFv5] Parse new line-table header format.Paul Robinson2017-05-021-18/+147
| | | | | | | | | | | | The directory and file tables now have form-based content descriptors. Parse these and extract the per-directory/file records based on the descriptors. For now we support only DW_FORM_string (inline) for the path names; follow-up work will add support for indirect forms (i.e., DW_FORM_strp, strx<N>, and line_strp). Differential Revision: http://reviews.llvm.org/D32713 llvm-svn: 301978
* Verify that all references point to actual DIEs in "llvm-dwarfdump --verify"Greg Clayton2017-05-021-81/+142
| | | | | | | | | | LTO and other fancy linking previously led to DWARF that contained invalid references. We already validate that CU relative references fall into the CU, and the DW_FORM_ref_addr references fall inside the .debug_info section, but we didn't validate that the references pointed to correct DIE offsets. This new verification will ensure that all references refer to actual DIEs and not an offset in between. This caught a bug in DWARFUnit::getDIEForOffset() where if you gave it any offset, it would match the DIE that mathes the offset _or_ the next DIE. This has been fixed. Differential Revision: https://reviews.llvm.org/D32722 llvm-svn: 301971
* Make DWARFDebugLine use StringRef for directory/file tables. NFCPaul Robinson2017-05-021-16/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D32728 llvm-svn: 301940
* Stylistic makeover of DWARFDebugLine before working on it. NFCPaul Robinson2017-05-011-180/+177
| | | | | | | Rename parameters and locals to CamelCase, doxygenize the header, and run clang-format on the whole thing. llvm-svn: 301883
* Adds initial llvm-dwarfdump --verify support with unit tests.Greg Clayton2017-05-012-2/+117
| | | | | | | | | | | | | | | | | | lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR. The first part of the verify does the following: - verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets - verifies that all DW_FORM_ref_addr references have valid .debug_info offsets - verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets - verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets - verifies that all DW_FORM_strp attributes have valid .debug_str offsets Unit tests were added for each of the above cases. Differential Revision: https://reviews.llvm.org/D32707 llvm-svn: 301844
* [DWARF] - Fix mistype in dump output of pub* tables. NFC.George Rimar2017-04-281-1/+1
| | | | | | | There was a garbage character in output introduced by myself in r290040 "[DWARF] - Introduce DWARFDebugPubTable class for dumping pub* sections." llvm-svn: 301631
* [llvm-dwarfdump] - Change format for .gdb_index dump.George Rimar2017-04-271-2/+3
| | | | | | | | | | | | | | It is useful to output size of ranges when address ranges section of .gdb_index is dumped. It helps to compare outputs produced by different linkers, for example. In that case address ranges can look very different, when they are the same at fact. Difference comes from different low address because of different address of .text. Differential revision: https://reviews.llvm.org/D32492 llvm-svn: 301527
* [DWARF] - Take relocations in account when extracting ranges from .debug_rangesGeorge Rimar2017-04-243-14/+22
| | | | | | | | | | | | | | | I found this when investigated "Bug 32319 - .gdb_index is broken/incomplete" for LLD. When we have object file with .debug_ranges section it may be filled with zeroes. Relocations are exist in file to relocate this zeroes into real values later, but until that a pair of zeroes is treated as terminator. And DWARF parser thinks there is no ranges at all when I am trying to collect address ranges for building .gdb_index. Solution implemented in this patch is to take relocations in account when parsing ranges. Differential revision: https://reviews.llvm.org/D32228 llvm-svn: 301170
* [DWARF] - Refactoring: localize handling of relocations in a single place.George Rimar2017-04-215-41/+27
| | | | | | | | | | | This is splitted from D32228, currently DWARF parsers code has few places that applied relocations values manually. These places has similar duplicated code. Patch introduces separate method that can be used to obtain relocated value. That helps to reduce code and simplifies things. Differential revision: https://reviews.llvm.org/D32284 llvm-svn: 300956
* Code style change as suggested in https://reviews.llvm.org/D32177 (NFC)Dehao Chen2017-04-191-16/+11
| | | | llvm-svn: 300753
* Using address range map to speedup finding inline stack for address.Dehao Chen2017-04-192-43/+48
| | | | | | | | | | | | | | | | | | | | Summary: In the current implementation, to find inline stack for an address incurs expensive linear search in 2 places: * linear search for the top-level DIE * recursive linear traverse the DIE tree to find the path to the leaf DIE In this patch, a map is built from address to its corresponding leaf DIE. The inline stack is built by traversing from the leaf DIE up to the root DIE. This speeds up batch symbolization by ~10X without noticible memory overhead. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32177 llvm-svn: 300742
* Revert r300697 which causes buildbot failure.Dehao Chen2017-04-192-47/+43
| | | | llvm-svn: 300708
* Using address range map to speedup finding inline stack for address.Dehao Chen2017-04-192-43/+47
| | | | | | | | | | | | | | | | | | | | Summary: In the current implementation, to find inline stack for an address incurs expensive linear search in 2 places: * linear search for the top-level DIE * recursive linear traverse the DIE tree to find the path to the leaf DIE In this patch, a map is built from address to its corresponding leaf DIE. The inline stack is built by traversing from the leaf DIE up to the root DIE. This speeds up batch symbolization by ~10X without noticible memory overhead. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32177 llvm-svn: 300697
* Add GNU_discriminator support for inline callsites in llvm-symbolizer.Dehao Chen2017-04-172-3/+7
| | | | | | | | | | | | | | Summary: LLVM symbolize cannot recognize GNU_discriminator for inline callsites. This patch adds support for it. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32134 llvm-svn: 300486
OpenPOWER on IntegriCloud