summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/dsymutil/X86
Commit message (Collapse)AuthorAgeFilesLines
* [Remarks] Warn if a remark file is not found when processing static archivesFrancis Visoiu Mistrih2020-01-031-0/+43
| | | | | | | | | | | Static archives contain object files which contain sections pointing to external remark files. When static archives are shipped without the remark files, dsymutil shouldn't generate an error. Instead, generate a warning to inform the user that remarks for that library won't be available in the .dSYM.
* [Remarks] Allow empty temporary remark filesFrancis Visoiu Mistrih2019-11-221-0/+8
| | | | | | | When parsing bitstream remarks, allow external remark files to be empty, which means there are no remarks to be parsed. In the same way, dsymutil should not produce a remark file.
* DWARFDebugLoc(v4): Add an incremental parsing functionPavel Labath2019-11-153-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds a visitLocationList function to the DWARF v4 location lists, similar to what already exists for DWARF v5. It follows the approach outlined in previous patches (D69672), where the parsed form is always stored in the DWARF v5 format, which makes it easier for generic code to be built on top of that. v4 location lists are "upgraded" during parsing, and then this upgrade is undone while dumping. Both "inline" and section-based dumping is rewritten to reuse the existing "generic" location list dumper. This means that the output format is consistent for all location lists (the only thing one needs to implement is the function which prints the "raw" form of a location list), and that debug_loc dumping correctly processes base address selection entries, etc. The previous existing debug_loc functionality (e.g., parseOneLocationList) is rewritten on top of the new API, but it is not removed as there is still code which uses them. This will be done in follow-up patches, after I build the API to access the "interpreted" location lists in a generic way (as that is what those users really want). Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69847
* [dsymutil] Add -dump to llvm-bcanalyzer invocationsFrancis Visoiu Mistrih2019-11-132-4/+4
|
* [dsymutil] Second attempt to fix dsymutil tests on non-darwin platformsFrancis Visoiu Mistrih2019-11-011-1/+1
|
* [dsymutil] Require darwin in fat binary testFrancis Visoiu Mistrih2019-11-011-0/+2
| | | | | | | dsymutil uses lipo(1) to build the fat binary, which it invokes as a process. For that, we need to only run this test on darwin systems. Should fix: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/181/steps/test-check-all/logs/stdio
* [dsymutil] Add support for linking remarksFrancis Visoiu Mistrih2019-11-013-0/+78
| | | | | | | | | | | | | | | | | | | | This adds support to dsymutil for linking remark files and placing them in the final .dSYM bundle. The result will be placed in: * a.out.dSYM/Contents/Resources/Remarks/a.out or * a.out.dSYM/Contents/Resources/Remarks/a.out-<arch> for universal binaries When multi-threaded, this runs a third thread which loops over all the object files and parses remarks as it finds __remarks sections. Testing this involves running dsymutil on pre-built binaries and object files, then running llvm-bcanalyzer on the final result to check for remarks. Differential Revision: https://reviews.llvm.org/D69142
* [dsymutil] Support and relocate base address selection entries for debug_locJonas Devlieghere2019-10-151-0/+29
| | | | | | | | | | | | | | | Since r374600 clang emits base address selection entries. Currently dsymutil does not support these entries and incorrectly interprets them as location list entries. This patch adds support for base address selection entries in dsymutil and makes sure they are relocated correctly. Thanks to Dave for coming up with the test case! Differential revision: https://reviews.llvm.org/D69005 llvm-svn: 374957
* Re-land "[dsymutil] Fix handling of common symbols in multiple object files."Jonas Devlieghere2019-10-091-0/+39
| | | | | | | | The original patch got reverted because it hit a long-standing legacy issue on Windows that prevents files from being named `com`. Thanks Kristina & Jeremy for pointing this out. llvm-svn: 374178
* Revert r374139, "[dsymutil] Fix handling of common symbols in multiple ↵Jeremy Morse2019-10-091-39/+0
| | | | | | | | | object files." The added test files ("com", "com1.o", "com2.o") are reserved names on Windows, and makes 'git checkout' fail with a filesystem error. llvm-svn: 374144
* [dsymutil] Fix handling of common symbols in multiple object files.Jonas Devlieghere2019-10-091-0/+39
| | | | | | | | | | | | | For common symbols the linker emits only a single symbol entry in the debug map. This caused dsymutil to not relocate common symbols when linking DWARF coming form object files that did not have this entry. This patch fixes that by keeping track of common symbols in the object files and synthesizing a debug map entry for them using the address from the main binary. Differential revision: https://reviews.llvm.org/D68680 llvm-svn: 374139
* [llvm-readobj][MachO] Fix section type printingSeiya Nuta2019-08-151-13/+13
| | | | | | | | | | | | | | | | | | | Summary: Currently, llvm-readobj mistakenly decodes section type as section attribute. This patch fixes the bug and affected tests. Reviewers: JDevlieghere, jhenderson, rupprecht, alexshap, echristo Reviewed By: jhenderson, rupprecht, alexshap, echristo Subscribers: javed.absar, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66075 llvm-svn: 368974
* NFC: Unforget a colon in a few CHECK: directives.Artem Dergachev2019-07-122-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D64526 llvm-svn: 365863
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-013-6/+6
| | | | | | | | | | 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
* [dsymutil] Put Swift interface files into a per-arch subdirectory.Adrian Prantl2019-04-231-1/+1
| | | | | | | | | This was meant to be part of the original commit r358921, but somehow got lost. <rdar://problem/49751748> llvm-svn: 359010
* [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.Adrian Prantl2019-04-221-0/+23
| | | | | | | | | | | | | | | | | | When a Swift module built with debug info imports a library without debug info from a textual interface, the textual interface is necessary to reconstruct types defined in the library's interface. By recording the Swift interface files in DWARF dsymutil can collect them and LLDB can find them. This patch teaches dsymutil to look for DW_TAG_imported_modules and records all references to parseable Swift ingterfrace files and copies them to a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface <rdar://problem/49751748> llvm-svn: 358921
* dsymutil support for DW_OP_convertAdrian Prantl2019-02-281-0/+33
| | | | | | | | | | | Add support for cloning DWARF expressions that contain base type DIE references in dsymutil. <rdar://problem/48167812> Differential Revision: https://reviews.llvm.org/D58534 llvm-svn: 355148
* [dsymutil] Don't clone empty CUsJonas Devlieghere2019-02-132-6/+3
| | | | | | | | | | | | | | | The DWARF standard says that an empty compile unit is not valid: > Each such contribution consists of a compilation unit header (see > Section 7.5.1.1 on page 200) followed by a single DW_TAG_compile_unit or > DW_TAG_partial_unit debugging information entry, together with its > children. Therefore we shouldn't clone them in dsymutil. Differential revision: https://reviews.llvm.org/D57979 llvm-svn: 353903
* [test] Run the verifier for dsymutil module testsJonas Devlieghere2019-02-084-4/+6
| | | | | | | Dsymutil has an option "verify" that runs the dwarf verifier on the generated dSYM. This patch enables this for the module tests. llvm-svn: 353544
* Add missing -oso-prepend-path to dsymutil test.Adrian Prantl2018-12-201-1/+1
| | | | | | Thanks to Galina Kistanova for pointing this out! llvm-svn: 349793
* [dsymutil] Gather global and local symbol addresses in the main executable.Jonas Devlieghere2018-11-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | Usually local symbols will have their address described in the debug map. Global symbols have to have their address looked up in the symbol table of the main executable. By playing with 'ld -r' and export lists, you can get a symbol described as global by the debug map while actually being a local symbol as far as the link in concerned. By gathering the address of local symbols, we fix this issue. Also, we prefer a global symbol in case of a name collision to preserve the previous behavior. Note that using the 'ld -r' tricks, people can actually cause symbol names collisions that dsymutil has no way to figure out. This fixes the simple case where there is only one symbol of a given name. rdar://problem/32826621 Differential revision: https://reviews.llvm.org/D54922 llvm-svn: 348021
* Make dsymutil more robust when parsing load commands.Adrian Prantl2018-11-131-1/+1
| | | | | | rdar://problem/45883463 llvm-svn: 346815
* [dsymutil] Copy the LC_BUILD_VERSION load command into the companion binary.Adrian Prantl2018-11-081-0/+11
| | | | | | | | | | | | | LC_BUILD_VERSION contains platform information that is useful for LLDB to match up dSYM bundles with binaries. This patch copies the load command over into the dSYM. rdar://problem/44145175 rdar://problem/45883463 Differential Revision: https://reviews.llvm.org/D54233 llvm-svn: 346412
* Fix spelling errorAdrian Prantl2018-11-071-1/+1
| | | | llvm-svn: 346359
* [dsymutil] Set LSan blacklist whenever sanitizers are enabled.Jonas Devlieghere2018-09-241-1/+1
| | | | | | | | LSan can be enabled by itself or as part of the address sanitizer. Rather than checking the enabled sanitizers for both, just set the LSan env options whenever a sanitizer is enabled. llvm-svn: 342881
* [dsymutil] Suppress CoreFoundation leaks in tests.Jonas Devlieghere2018-09-212-0/+8
| | | | | | | | | | This suppresses CoreFoundation originated leaks in the dsymutil tests. I'm not sure if this is a false positive or not, but either way we don't have control over it and shouldn't keep the bot red. http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan/ llvm-svn: 342724
* dsymutil: Avoid pruning non-type forward declarations inside DW_TAG_moduleAdrian Prantl2018-08-301-0/+59
| | | | | | | | | | | | | | | | forward declarations. Especially with template instantiations, there are legitimate reasons why for declarations might be emitted into a DW_TAG_module skeleton / forward-declaration sub-tree, that are not forward declarations in the sense of that there is a more complete definition over in a .pcm file. The example in the testcase is a constant DW_TAG_member of a DW_TAG_class template instatiation. rdar://problem/43623196 llvm-svn: 341123
* fix comment typoNico Weber2018-08-271-1/+1
| | | | llvm-svn: 340744
* [dsymutil] Simplify temporary file handling.Jonas Devlieghere2018-07-293-12/+0
| | | | | | | | | | | Dsymutil's update functionality was broken on Windows because we tried to rename a file while we're holding open handles to that file. TempFile provides a solution for this through its keep(Twine) method. This patch changes dsymutil to make use of that functionality. Differential revision: https://reviews.llvm.org/D49860 llvm-svn: 338216
* [test] Disable dsymutil update test on windowsJonas Devlieghere2018-07-263-2/+8
| | | | | | | | | | | | | | | | Apparently, the issue with dsymutil update functionality on Windows was that Windows doesn't like dsymutil renaming files that have open handles to them. This disables the new accelerator test and updates the comment in the other two test. We should be able to enable the tests again once we updated the implementation to use TempFile::keep() to keep the temporary files in MachOUtils. A big thank you to Jeremy Morse from Sony for figuring this out and bringing it to my attention. llvm-svn: 338030
* [test] Do dsymutil update in placeJonas Devlieghere2018-07-261-6/+6
| | | | | | | | Update the dSYM bundle in place when swapping out the accelerator tables. This should unbreak the windows bot that have been failing with an access denied. llvm-svn: 338014
* [dsymutil] Add support for generating DWARF5 accelerator tables.Jonas Devlieghere2018-07-251-0/+38
| | | | | | | | | | | | | | | | | | This patch add support for emitting DWARF5 accelerator tables (.debug_names) from dsymutil. Just as with the Apple style accelerator tables, it's possible to update existing dSYMs. This patch includes a test that show how you can convert back and forth between the two types. If no kind of table is specified, dsymutil will default to generating Apple-style accelerator tables whenever it finds those in its input. The same is true when there are no accelerator tables at all. Finally, in the remaining case, where there's at least one DWARF v5 table and no Apple ones, the output will contains a DWARF accelerator tables (.debug_names). Differential revision: https://reviews.llvm.org/D49137 llvm-svn: 337980
* [dwarfdump] Add pretty printer for accelerator table based on Atom.Jonas Devlieghere2018-07-131-1/+1
| | | | | | | | For instance, When dumping .apple_types, the second atom represents the DW_TAG. In addition to printing the raw value, we now also pretty print the value if the ATOM tells us how. llvm-svn: 337026
* [dsymutil] Add support for outputting assemblyJonas Devlieghere2018-07-091-0/+3
| | | | | | | | | | | | | When implementing the DWARF accelerator tables in dsymutil I ran into an assertion in the assembler. Debugging these kind of issues is a lot easier when looking at the assembly instead of debugging the assembler itself. Since it's only a matter of creating an AsmStreamer instead of a MCObjectStreamer it made sense to turn this into a (hidden) dsymutil feature. Differential revision: https://reviews.llvm.org/D49079 llvm-svn: 336561
* [dsymutil] Escape HTML special characters in plist.Jonas Devlieghere2018-05-301-2/+2
| | | | | | | | | | When printing string in the Plist, we weren't escaping the characters which lead to invalid XML. This patch adds the escape logic to StringExtras. rdar://39785334 llvm-svn: 333565
* [DebugInfo] Use absolute addresses in location listsJonas Devlieghere2018-05-212-6/+6
| | | | | | | | | | | Rather than relying on the user to do the address calculating in DW_AT_location we should just dump the absolute address. rdar://problem/38513870 Differential revision: https://reviews.llvm.org/D47152 llvm-svn: 332873
* [dsymutil] Don't try to load Swift ASTs as objects.Jonas Devlieghere2018-04-091-0/+1
| | | | | | | | | | | | | | | | With the threading refactoring, loading of object files happens before checking whether we're dealing with a swift AST. While that's not an issue per se, it causes a warning to be printed: warning: /path/to/a.swiftmodule: The file was not recognized as a valid object file note: while processing /path/to/a.swiftmodule This suppresses the warning by checking for a Swift AST before attempting to load is as an object file. rdar://39240444 llvm-svn: 329553
* [dsymutil] Don't crash on empty CUJonas Devlieghere2018-04-081-0/+7
| | | | | | Add some additional checks so we don't crash on empty compile units. llvm-svn: 329537
* Another attempt to fix papertrail-warnings.test on Windows bots by making ↵Douglas Yung2018-04-021-3/+3
| | | | | | expected message less case sensitive. llvm-svn: 329008
* Attempt to fix papertrail-warnings.test on Windows bots.Nico Weber2018-04-021-2/+2
| | | | llvm-svn: 328971
* [dsymutil] Upstream emitting of papertrail warnings.Jonas Devlieghere2018-04-021-0/+30
| | | | | | | | | | When running dsymutil as part of your build system, it can be desirable for warnings to be part of the end product, rather than just being emitted to the output stream. This patch upstreams that functionality. Differential revision: https://reviews.llvm.org/D44639 llvm-svn: 328965
* [dsymutil] Rename llvm-dsymutil -> dsymutilJonas Devlieghere2018-03-1840-70/+70
| | | | | | | | | | | Now that almost all functionality of Apple's dsymutil has been upstreamed, the open source variant can be used as a drop in replacement. Hence we feel it's no longer necessary to have the llvm prefix. Differential revision: https://reviews.llvm.org/D44527 llvm-svn: 327790
* [dsymutil] Unify error handling and add colorJonas Devlieghere2018-03-092-2/+2
| | | | | | | | | We improved the handling of errors and warnings in dwarfdump's verifier in rL314498. This patch does the same thing for dsymutil. Differential revision: https://reviews.llvm.org/D44052 llvm-svn: 327137
* [dsymutil] Embed toolchain in dSYM bundleJonas Devlieghere2018-03-081-1/+6
| | | | | | | | | Allow us to embed the (Xcode) toolchain in the dSYM bundle's property list. Differential revision: https://reviews.llvm.org/D44151 llvm-svn: 326994
* [dwarfdump] Only print CU relative offset in verbose modeJonas Devlieghere2018-03-073-32/+32
| | | | | | | | | | | | Instead of only printing the CU-relative offset in non-verbose mode, it makes more sense to only printed the resolved address. In verbose mode we still print both. Differential revision: https://reviews.llvm.org/D44148 rdar://33525475 llvm-svn: 326903
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-233-27/+27
| | | | | | | | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. In this extension a content type is added, DW_LNCT_LLVM_source, which contains the embedded source code of the file. Add new optional attribute for !DIFile IR metadata called source which contains source text. Use this to output the source to the DWARF line table of code objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM to support optional source. Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output format of llvm-dwarfdump to make room for the new attribute on file_names entries, and support embedded sources for the -source option in llvm-objdump. Differential Revision: https://reviews.llvm.org/D42765 llvm-svn: 325970
* [dsymutil] Correctly handle DW_TAG_labelJonas Devlieghere2018-02-201-0/+16
| | | | | | | | | This patch contains logic for handling DW_TAG_label that's present in darwin's dsymutil implementation, but not yet upstream. Differential revision: https://reviews.llvm.org/D43438 llvm-svn: 325600
* [dwarfdump] Fix spurious verification errors for DW_AT_location attributesJonas Devlieghere2018-02-171-8/+23
| | | | | | | | | | | Verifying any DWARF file that is optimized and contains at least one tag with a DW_AT_location with a location list offset as a DW_AT_form_dataXXX results in dwarfdump spuriously claiming that the location list is invalid. Differential revision: https://reviews.llvm.org/D40199 llvm-svn: 325430
* Change "UNSUPPORTED: windows" to be "UNSUPPORTED: system-windows" so that ↵Douglas Yung2018-02-082-2/+2
| | | | | | | | test is actually skipped on Windows. Reviewed by Paul Robinson llvm-svn: 324632
* [test][dsymutil] Fix tests for Windows bots.Jonas Devlieghere2018-02-083-17/+2
| | | | | | | | | | The UNSUPPORTED directive was not honored by the bot, presumably because of the FIXME above it. This moves the comment down and removes the remaining update check from basic-linking-x86.test. This should un-break: llvm-clang-x86_64-expensive-checks-win/builds/7798/ llvm-svn: 324598
OpenPOWER on IntegriCloud