summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
* [Remarks] Warn if a remark file is not found when processing static archivesFrancis Visoiu Mistrih2020-01-034-0/+47
| | | | | | | | | | | 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.
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-242-4/+4
| | | | as cleanups after D56351
* [Remarks] Allow empty temporary remark filesFrancis Visoiu Mistrih2019-11-229-1/+9
| | | | | | | 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-0119-0/+101
| | | | | | | | | | | | | | | | | | | | 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] Print warning/error for unknown/missing arguments.Jonas Devlieghere2019-10-161-0/+6
| | | | | | | | | After changing dsymutil to use libOption, we lost error reporting for missing required arguments (input files). Additionally, we stopped complaining about unknown arguments. This patch fixes both and adds a test. llvm-svn: 375044
* [dsymutil] Support and relocate base address selection entries for debug_locJonas Devlieghere2019-10-153-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-094-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-094-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-094-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
* [dsymutil] Improve verbose output (NFC)Jonas Devlieghere2019-10-081-22/+44
| | | | | | | | | | | | The verbose output for finding relocations assumed that we'd always dump the DIE after (which starts with a newline) and therefore didn't include one itself. However, this isn't always true, leading to garbled output. This patch adds a newline to the verbose output and adds a line that says that the DIE is being kept (which isn't obvious otherwise). It also adds a 0x prefix to the relocations. llvm-svn: 374123
* [dsymutil] Tablegenify option parsingJonas Devlieghere2019-10-031-8/+6
| | | | | | | | | | | | | | | | | | | This patch reimplements command line option parsing in dsymutil with Tablegen and libOption. The main motivation for this change is to prevent clashes with other cl::opt options defined in llvm. Although it's a bit more heavyweight, it has some nice advantages such as no global static initializers and better separation between the code and the option definitions. I also used this opportunity to improve how dsymutil deals with incompatible options. Instead of having checks spread across the code, everything is now grouped together in verifyOptions. The fact that the options are no longer global means that we need to pass them around a bit more, but I think it's worth the trade-off. Differential revision: https://reviews.llvm.org/D68361 llvm-svn: 373622
* [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
* [lit] Delete empty lines at the end of lit.local.cfg NFCFangrui Song2019-06-171-1/+0
| | | | llvm-svn: 363538
* [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-222-0/+57
| | | | | | | | | | | | | | | | | | 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-283-0/+78
| | | | | | | | | | | 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
* [dsymutil] Upstream unobfuscation logic.Jonas Devlieghere2019-01-077-0/+213
| | | | | | | | | | The unobufscation support for BCSymbolMaps was the last piece of code that hasn't been upstreamed yet. This patch contains a reworked version of the existing code and relevant tests. Differential revision: https://reviews.llvm.org/D56346 llvm-svn: 350580
* 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-305-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-132-1/+1
| | | | | | rdar://problem/45883463 llvm-svn: 346815
* [dsymutil] Copy the LC_BUILD_VERSION load command into the companion binary.Adrian Prantl2018-11-082-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-303-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
* [PPC] Remove Darwin support from POWER backend.Kit Barton2018-08-282-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch issues an error message if Darwin ABI is attempted with the PPC backend. It also cleans up existing test cases, either converting the test to use an alternative triple or removing the test if the coverage is no longer needed. Updated Tests ------------- The majority of test cases were updated to use a different triple that does not include the Darwin ABI. Many tests were also updated to use FileCheck, in place of grep. Deleted Tests ------------- llvm/test/tools/dsymutil/PowerPC/sibling.test was originally added to test specific functionality of dsymutil using an object file created with an old version of llvm-gcc for a Powerbook G4. After a discussion with @JDevlieghere he suggested removing the test. llvm/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll was converted from a PPC test to a SystemZ test, as the behavior is also reproducible there. All other tests that were deleted were specific to the darwin/ppc ABI and no longer necessary. Phabricator Review: https://reviews.llvm.org/D50988 llvm-svn: 340795
* 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-252-0/+39
| | | | | | | | | | | | | | | | | | 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
* Replace unused output filenames with /dev/null in testsFangrui Song2018-07-022-2/+2
| | | | | | Similar to rLLD336129 llvm-svn: 336131
* [dsymutil] Make the CachedBinaryHolder the defaultJonas Devlieghere2018-06-291-6/+6
| | | | | | | | Replaces all uses of the old binary holder with its cached variant. Differential revision: https://reviews.llvm.org/D48770 llvm-svn: 335991
* [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
* [Support] Add color cl category.Jonas Devlieghere2018-05-241-0/+2
| | | | | | | | | This commit adds a color category so tools can document this option and enables it for dwarfdump and dsymuttil. rdar://problem/40498996 llvm-svn: 333176
* [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
* [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.Shiva Chen2018-05-092-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
* [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-083-0/+23
| | | | | | 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
OpenPOWER on IntegriCloud