summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
...
* [dwarfdump] Add verbose output for .debug-line sectionJonas Devlieghere2017-09-215-363/+357
| | | | | | | | | | | | This patch adds dumping of line table instructions as well as the final state at each specified pc value in verbose mode. This is essentially the same as the default in Darwin's dwarfdump. Dumping the actual line table opcodes can be particularly useful for something like debugging a bad `.debug_line` section. Differential revision: https://reviews.llvm.org/D37971 llvm-svn: 313910
* [dsymutil] Don't resolve DIE reference to NULL DIE.Jonas Devlieghere2017-09-212-0/+41
| | | | | | | | | | | | | This patch prevents dsymutil from resolving a reference to a NULL DIE when a bogus reference happens to be coincidentally referencing a NULL DIE. Now this is detected as an invalid reference and a warning is printed. Fixes: https://bugs.llvm.org/show_bug.cgi?id=33873 Differential revision: https://reviews.llvm.org/D38078 llvm-svn: 313872
* [dwarfdump] Make .eh_frame an alias for .debug_frameJonas Devlieghere2017-09-182-4/+4
| | | | | | | | | | | | | | | | | | | | This patch makes the `.eh_frame` extension an alias for `.debug_frame`. Up till now it was only possible to dump the section using objdump, but not with dwarfdump. Since the two are essentially interchangeable, we dump whichever of the two is present. As a workaround, this patch also adds parsing for 3 currently unimplemented CFA instructions: `DW_CFA_def_cfa_expression`, `DW_CFA_expression`, and `DW_CFA_val_expression`. Because I lack the required knowledge, I just parse the fields without actually creating the instructions. Finally, this also fixes the typo in the `.debug_frame` section name which incorrectly contained a trailing `s`. Differential revision: https://reviews.llvm.org/D37852 llvm-svn: 313530
* llvm-dwarfdump: automatically dump both regular and .dwo variant of sectionsAdrian Prantl2017-09-131-2/+1
| | | | | | | | | | | | Since users typically don't really care about the .dwo / non.dwo distinction, this patch makes it so dwarfdump --debug-<info,...> dumps .debug_info and (if available) also .debug_info.dwo. This simplifies the command line interface (I've removed all dwo-specific dump options) and makes the tool friendlier to use. Differential Revision: https://reviews.llvm.org/D37771 llvm-svn: 313207
* llvm-dwarfdump: Make -brief the default and add a -verbose option instead.Adrian Prantl2017-09-1112-29/+29
| | | | | | Differential Revision: https://reviews.llvm.org/D37717 llvm-svn: 312972
* llvm-dwarfdump: Replace -debug-dump=sect option with individual options.Adrian Prantl2017-09-1119-20/+20
| | | | | | | | | | | | | | | | | | | | | | As discussed on llvm-dev in http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html this changes the command line interface of llvm-dwarfdump to match the one used by the dwarfdump utility shipping on macOS. In addition to being shorter to type this format also has the advantage of allowing more than one section to be specified at the same time. In a nutshell, with this change $ llvm-dwarfdump --debug-dump=info $ llvm-dwarfdump --debug-dump=apple-objc becomes $ dwarfdump --debug-info --apple-objc Differential Revision: https://reviews.llvm.org/D37714 llvm-svn: 312970
* [dsymutil] Don't mark forward declarations as canonical.Jonas Devlieghere2017-08-318-0/+278
| | | | | | | | | | | | | | | | | | This patch completes the work done by Frederic Riss to addresses dsymutil incorrectly considering forward declaration as canonical during uniquing. This resulted in references to the forward declaration even after the definition was encountered. In addition to the test provided by Alexander Shaposhnikov in D29609, I added another test to cover several scenarios that were mentioned in his conversation with Fred. We now also check that uniquing still occurs after the definition was encountered. For more context please refer to D29609 Differential revision: https://reviews.llvm.org/D37127 llvm-svn: 312274
* Revert "[dsymutil] Don't mark forward declarations as canonical."Jonas Devlieghere2017-08-318-278/+0
| | | | | | This reverts commit r312264. llvm-svn: 312271
* [dsymutil] Don't mark forward declarations as canonical.Jonas Devlieghere2017-08-318-0/+278
| | | | | | | | | | | | | | | | | | This patch completes the work done by Frederic Riss to addresses dsymutil incorrectly considering forward declaration as canonical during uniquing. This resulted in references to the forward declaration even after the definition was encountered. In addition to the test provided by Alexander Shaposhnikov in D29609, I added another test to cover several scenarios that were mentioned in his conversation with Fred. We now also check that uniquing still occurs after the definition was encountered. For more context please refer to D29609 Differential revision: https://reviews.llvm.org/D37127 llvm-svn: 312264
* [dwarfdump] Pretty print location expressions and location listsReid Kleckner2017-08-295-62/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Based on Fred's patch here: https://reviews.llvm.org/D6771 I can't seem to commandeer the old review, so I'm creating a new one. With that change the locations exrpessions are pretty printed inline in the DIE tree. The output looks like this for debug_loc entries: DW_AT_location [DW_FORM_data4] (0x00000000 0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3 0x000000000000000b - 0x0000000000000012: DW_OP_consts +7 0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4 0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0) And like this for debug_loc.dwo entries: DW_AT_location [DW_FORM_sec_offset] (0x00000000 Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4) Simple locations without ranges are printed inline: DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0) The debug_loc(.dwo) dumping in changed accordingly to factor the code. Reviewers: dblaikie, aprantl, friss Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D37123 llvm-svn: 312042
* dsymutil: don't copy compile units without children from PCM filesAdrian Prantl2017-08-223-0/+28
| | | | | | rdar://problem/33830532 llvm-svn: 311416
* [llvm] Get rid of "%T" expansionsKuba Mracek2017-08-152-23/+23
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in llvm. Differential Revision: https://reviews.llvm.org/D36495 llvm-svn: 310953
* dsymutil: support dwarf version mismatches between object and clang moduleAdrian Prantl2017-08-082-0/+23
| | | | | | | | | | This adds a missing call to maybeUpdateMaxDwarfVersion when visitng a clang module. Failing to do so will cause a failure when emitting DWARF 4 forms into a CU that AsmPrinter believes to be DWARF 2. rdar://problem/33666528 llvm-svn: 310392
* dsymutil: strip unused types from imported DW_TAG_modulesAdrian Prantl2017-07-213-12/+37
| | | | | | | | | | | This patch teaches dsymutil to strip types from the imported DW_TAG_module inside of an object file (not inside the PCM) if they can be resolved to the full definition inside the PCM. This reduces the size of the .dSYM from WebCore from webkit.org by almost 2/3. <rdar://problem/33047213> llvm-svn: 308710
* [dsymutil] Fix handling of empty CUs in LTO links.Frederic Riss2017-02-091-0/+33
| | | | | | | | | r288399 introduced the DIEUnit class, and in the process broke the corner case where dsymutil generates an empty CU during an LTO link. This restores the logic and adds a test for the corner case. llvm-svn: 294618
* dsymutil/modules: Reword the warning for static libraries without module cachesAdrian Prantl2016-05-207-26/+53
| | | | | | | | | | | | In addition to clarifying the warning message this contains a minor functional change in that it now warns if the *immediate* parent directory in which the missing PCM is expected to be isn't found. This patch also includes a more comprehensive testcase. rdar://problem/25860711 llvm-svn: 270269
* dsymutil: Fix the DWOId mismatch check for cached modules.Adrian Prantl2016-05-131-1/+8
| | | | | | | | | | | | | | In verbose mode, we emit a warning if the DWOId of a skeleton CU mismatches the DWOId of the referenced module. This patch updates the cached DWOId after a module has been loaded to the DWOId of the module on disk (instead of storing the DWOId we expected to load). This allows us to correctly emit the mismatch warning for all subsequent object files that want to import the same module. This patch also ensures both warnings are only emitted in verbose mode. rdar://problem/26214027 llvm-svn: 269383
* [dsymutil] Prevent use-after-freeFrederic Riss2016-05-092-0/+10
| | | | | | | | | | | | The BinaryHolder would query the archive member MemoryBuffer name to check if the current open archive also contains the next requested objectfile. This comparison was using a StringRef to a temporary buffer. It only happened with fat archives. This commit adds long-lived storage along with the MemoryBuffers for the fat archive filename. The added test would fail during an ASAN build without the fix. llvm-svn: 268924
* [dsymutil] Fix -arch option for thumb variants.Frederic Riss2016-05-093-0/+13
| | | | | | | | | | r267249 removed the dual ARM/Thumb interface from MachOObjectFile, simplifying llvm-dsymutil's code. This unfortunately also regressed llvm-dsymutil's ability to select thumb slices, because the simplified code was also dealing with the discrepency between the slice arch (eg. armv7m) and the triple arch name (eg. thumbv7m). llvm-svn: 268894
* [dsymutil] Create the temporary files in the system temp directory.Frederic Riss2016-05-021-3/+1
| | | | | | | | | | llvm-dsymutil used to create the temporary files in the output directory. This works fine except when the output directory contains a '%' char, which is then replaced by llvm::sys::fs::createUniqueFile() generating an invalid path. Just use the default temp dir for those files. llvm-svn: 268304
* dsymutil: Only warn about clang module DWO id mismatches in verbose mode.Adrian Prantl2016-04-251-1/+1
| | | | | | | | | | Until PR27449 (https://llvm.org/bugs/show_bug.cgi?id=27449) is fixed in clang this warning is pointless, since ASTFileSignatures will change randomly when a module is rebuilt. rdar://problem/25610919 llvm-svn: 267427
* MachO: remove weird ARM/Thumb interface from MachOObjectFileTim Northover2016-04-222-3/+3
| | | | | | | | | | | | | | | | Only one consumer (llvm-objdump) actually cared about the fact that there were two triples. Others were actively working around the fact that the Triple returned by getArch might have been invalid. As for llvm-objdump, it needs to be acutely aware of both Triples anyway, so being generic in the exposed API is no benefit. Also rename the version of getArch returning a Triple. Users were having to pass an unwanted nullptr to disambiguate the two, which was nasty. The only functional change here is that armv7m and armv7em object files no longer crash llvm-objdump. llvm-svn: 267249
* [PR27284] Reverse the ownership between DICompileUnit and DISubprogram.Adrian Prantl2016-04-152-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently each Function points to a DISubprogram and DISubprogram has a scope field. For member functions the scope is a DICompositeType. DIScopes point to the DICompileUnit to facilitate type uniquing. Distinct DISubprograms (with isDefinition: true) are not part of the type hierarchy and cannot be uniqued. This change removes the subprograms list from DICompileUnit and instead adds a pointer to the owning compile unit to distinct DISubprograms. This would make it easy for ThinLTO to strip unneeded DISubprograms and their transitively referenced debug info. Motivation ---------- Materializing DISubprograms is currently the most expensive operation when doing a ThinLTO build of clang. We want the DISubprogram to be stored in a separate Bitcode block (or the same block as the function body) so we can avoid having to expensively deserialize all DISubprograms together with the global metadata. If a function has been inlined into another subprogram we need to store a reference the block containing the inlined subprogram. Attached to https://llvm.org/bugs/show_bug.cgi?id=27284 is a python script that updates LLVM IR testcases to the new format. http://reviews.llvm.org/D19034 <rdar://problem/25256815> llvm-svn: 266446
* testcase gardening: update the emissionKind enum to the new syntax. (NFC)Adrian Prantl2016-04-012-2/+2
| | | | llvm-svn: 265081
* Fix tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.Paul Robinson2016-02-261-1/+1
| | | | | | | | FileCheck actually doesn't support combo suffixes. Differential Revision: http://reviews.llvm.org/D17588 llvm-svn: 262054
* [dsymutil] Support scattered relocs.Frederic Riss2016-02-014-0/+213
| | | | | | | | | | Although it seems like clang will never emit scattered relocations in the debug information (at least I couldn't find a way), we have too support them for the benefit of other compilers. As clang doesn't generate them, the included testcase was produced from hacked up assembly. llvm-svn: 259339
* [dsymutil] Fix FileCheck command.Frederic Riss2016-01-311-1/+1
| | | | | | Damn case-insensitive filesystem... llvm-svn: 259319
* [dsymutil] Fix handling of common symbols.Frederic Riss2016-01-317-7/+32
| | | | | | | | | | | | | | | | | llvm-dsymutil was misinterpreting the value of common symbols as their address when it actually contains their size. This didn't impact llvm-dsymutil's ability to link the debug information for common symbols because these are always found by name and not by address. Things could however go wrong when the size of a common object matched the object file address of another symbol. Depending on the link order of the symbols the common object might incorrectly evict this other object from the address to symbol mapping, and then link the evicted symbol with a wrong binary address. Use the new ability to have symbols without an object file address to fix this. llvm-svn: 259318
* dsymutil: Provide better warnings when clang modules cannot be found.Adrian Prantl2016-01-142-12/+25
| | | | | | rdar://problem/22823264 llvm-svn: 257784
* Relax testcase so it works on Windows.Adrian Prantl2016-01-131-2/+3
| | | | llvm-svn: 257667
* dsymutil: Only warn about missing clang modules once.Adrian Prantl2016-01-132-0/+12
| | | | | | rdar://problem/22269336 llvm-svn: 257664
* llvm-dwarfdump: Add support for dumping .dSYM bundles.Adrian Prantl2015-12-231-0/+6
| | | | | | | | This replicates the logic of Darwin dwarfdump for manually opening up .dSYM bundles without introducing any new dependencies. <rdar://problem/20491670> llvm-svn: 256350
* [dsymutil] Ignore absolute symbols in the debug mapFrederic Riss2015-12-113-0/+16
| | | | | | | | | | | | Quoting from the comment added to the code: // Objective-C on i386 uses artificial absolute symbols to // perform some link time checks. Those symbols have a fixed 0 // address that might conflict with real symbols in the object // file. As I cannot see a way for absolute symbols to find // their way into the debug information, let's just ignore those. llvm-svn: 255350
* dsymutil: Prune module forward decl DIEs if a uniquable definition wasAdrian Prantl2015-11-102-10/+11
| | | | | | | | | | already emitted and fix a latent bug in DIECloner where the DW_CHILDREN_yes flag is set based on the number of children in the input DIE rather than the number of children that are actually being cloned. rdar://problem/23439845 llvm-svn: 252649
* DI: Reverse direction of subprogram -> function edge.Peter Collingbourne2015-11-052-8/+8
| | | | | | | | | | | | | | | | | | | | | | | Previously, subprograms contained a metadata reference to the function they described. Because most clients need to get or set a subprogram for a given function rather than the other way around, this created unneeded inefficiency. For example, many passes needed to call the function llvm::makeSubprogramMap() to build a mapping from functions to subprograms, and the IR linker needed to fix up function references in a way that caused quadratic complexity in the IR linking phase of LTO. This change reverses the direction of the edge by storing the subprogram as function-level metadata and removing DISubprogram's function field. Since this is an IR change, a bitcode upgrade has been provided. Fixes PR23367. An upgrade script for textual IR for out-of-tree clients is attached to the PR. Differential Revision: http://reviews.llvm.org/D14265 llvm-svn: 252219
* dsymutil: Don't prune forward declarations inside of an imported TAG_moduleAdrian Prantl2015-10-053-1/+15
| | | | | | | | if there exists not definition for the type. For this to work, we need to clone the imported modules before building the decl context chains of the DIEs in the non-skeleton CUs. llvm-svn: 249362
* dsymutil: Also ignore the ByteSize when building the DeclContext cache forAdrian Prantl2015-10-024-1/+23
| | | | | | | | clang modules. Forward decls of ObjC interfaces don't have a bytesize. llvm-svn: 249110
* dsymutil: Fix the condition to distinguish module imports form definitions.Adrian Prantl2015-09-243-0/+40
| | | | llvm-svn: 248512
* dsymutil: Don't prune forward declarations inside a module definition.Adrian Prantl2015-09-234-3/+8
| | | | llvm-svn: 248428
* Fix this dsymutil testcase by not passing in a path to the modulemap file,Adrian Prantl2015-09-232-3/+1
| | | | | | | | so the lookup works as expected after prepending the oso-prepend-path. This manifested only on Windows, because "/" is not a relative path there. llvm-svn: 248423
* Fix the order of operations.Adrian Prantl2015-09-231-1/+1
| | | | llvm-svn: 248406
* Temporarily make testcase more verbose to debug a msvc buildbot failure.Adrian Prantl2015-09-231-1/+3
| | | | llvm-svn: 248403
* dsymutil: Resolve forward decls for types defined in clang modules.Adrian Prantl2015-09-232-11/+31
| | | | | | | | | This patch extends llvm-dsymutil's ODR type uniquing machinery to also resolve forward decls for types defined in clang modules. http://reviews.llvm.org/D13038 llvm-svn: 248398
* dsymutil: print a warning when there is a module hash mismatch.Adrian Prantl2015-09-237-1/+29
| | | | | | | This also updates the module binaries in the test directory because their module hash mismatched. llvm-svn: 248396
* dsymutil: Follow references to clang modules and recursively clone theAdrian Prantl2015-09-225-1/+63
| | | | | | | | debug info. This does not yet resolve external type references. llvm-svn: 248331
* [dsymutil] Discard useless location attributes.Frederic Riss2015-09-112-0/+48
| | | | | | | | | | | | | | When cloning the debug info for a function that hasn't been linked, strip the DIEs from all location attributes that wouldn't contain any meaningful information anyway. This kind of situation can happen when a function got discarded by the linker, but its debug information is still wanted in the final link because it was marked as required as some other DIE dependency. The easiest way to get into that situation is to have using directives. They get linked unconditionally, but their targets might not always be present. llvm-svn: 247386
* Reapply r246012 [dsymutil] Emit real dSYM companion binaries.Frederic Riss2015-09-022-0/+339
| | | | | | | | | | | | | | | | | | | | | | | With a fix for big endian machines. Thanks to Daniel Sanders for the debugging! Original commit message: The binaries containing the linked DWARF generated by dsymutil are not standard relocatable object files like emitted did previsously. They should be dSYM companion files, which means they have a different file type in the header, but also a couple other peculiarities: - they contain the segments and sections from the original binary in their load commands, but not the actual contents. This means they get an address and a size, but their offset is always 0 (but these are not virtual sections) - they also conatin all the defined symbols from the original binary This makes MC a really bad fit to emit these kind of binaries. The approach that was used in this patch is to leverage MC's section layout for the debug sections, but to use a replacement for MachObjectWriter that lives in MachOUtils.cpp. Some of the low-level helpers from MachObjectWriter were reused too. llvm-svn: 246673
* [dsymutil] Do not mistakenly reuse the current object file when the next one ↵Frederic Riss2015-08-311-0/+4
| | | | | | isn't found. llvm-svn: 246412
* [dsymutil] Fix testcase.Frederic Riss2015-08-312-1/+1
| | | | | | | | This testcase required 2 copies of the same file, and the second copy was missing. It was currently working because of a bug I'm about to fix. llvm-svn: 246411
* [dsymutil] Do not crash on empty debug_range range.Frederic Riss2015-08-313-1/+58
| | | | | | | | | | The fix is trivial (The actual patch is 2 lines, but as it changes indentation it looks like more). clang does not produce this kind of (slightly bogus) debug info anymore, thus I had to rely on a hand-crafted assembly test to trigger that case. llvm-svn: 246410
OpenPOWER on IntegriCloud