summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
...
* [dsymutil] Fix handling of inlined_subprogram low_pcsFrederic Riss2015-08-314-0/+33
| | | | | | | | | The value of an inlined subprogram low_pc attribute should not get relocated, but it can happen that it matches the enclosing function's start address and thus gets the generic treatment. Special case it to avoid applying the PC offset twice. llvm-svn: 246406
* [dsymutil] Implement -symtab/-s option.Frederic Riss2015-08-311-0/+44
| | | | | | | This option dumps the STAB entries that define the debug map(s) stored in the input binaries, and then exits. llvm-svn: 246403
* DI: Require subprogram definitions to be distinctDuncan P. N. Exon Smith2015-08-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "[dsymutil] Emit real dSYM companion binaries."Frederic Riss2015-08-262-339/+0
| | | | | | | This reverts commit r246012. Some bots do not like it (mips/s390). llvm-svn: 246019
* [dsymutil] Emit real dSYM companion binaries.Frederic Riss2015-08-262-0/+339
| | | | | | | | | | | | | | | | | | | 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: 246012
* [dsymutil] Store an optional BinaryPath in the debug map.Frederic Riss2015-08-262-0/+5
| | | | | | | | | llvm-dsymutil needs to emit dSYM companion bundles. These are binary files that replicate some of the orignal binary file properties (sections and symbols). To get acces to these properties, pass the binary path in the debug map. llvm-svn: 246011
* [dsymutil] actually fix test.Frederic Riss2015-08-251-2/+1
| | | | | | Not all machines have lipo installed. Do not try to invoke it. llvm-svn: 245991
* [dsymutil] Reapply r245960.Frederic Riss2015-08-253-1/+25
| | | | | | | | | | | | | | | | | | There was an issue in the test setup because the test requires an arch that wasn't filtered by the lit.local.cfg, but given the set of bots that failed, I'm not confident this is the (only) issue. So this commit also adds more output to the test to help me track down the failure if it happens again. Original commit message: [dsymutil] Rewrite thumb triple names in user visible messages. We autodetect triples from the input file(s) while reading the mach-o debug map. As we need to create a Target from those triples, we always chose the thumb variant (because the arm variant might not be 'instantiable' eg armv7m). The user visible architecture names should still be 'arm' and not 'thumb' variants though. llvm-svn: 245988
* Revert "[dsymutil] Rewrite thumb triple names in user visible messages."Frederic Riss2015-08-252-22/+1
| | | | | | | | This reverts commit r245960. Multiple bots are failing on the new test. It seemd like llvm-dsymutil exits with an error. Investigating. llvm-svn: 245964
* [dsymutil] Rewrite thumb triple names in user visible messages.Frederic Riss2015-08-252-1/+22
| | | | | | | | | | We autodetect triples from the input file(s) while reading the mach-o debug map. As we need to create a Target from those triples, we always chose the thumb variant (because the arm variant might not be 'instantiable' eg armv7m). The user visible architecture names should still be 'arm' and not 'thumb' variants though. llvm-svn: 245960
* [dsymutil] Not finding any debug info is not a fatal errorFrederic Riss2015-08-251-0/+8
| | | | llvm-svn: 245959
* [dsymutil] Remove old ODR uniquing testsFrederic Riss2015-08-2316-1190/+0
| | | | | | | These tests have been obsoleted by the refactored versions introduced in the previous commit. llvm-svn: 245804
* [dsymutil] Refactor ODR uniquing tests to be more readable.Frederic Riss2015-08-2311-0/+385
| | | | | | | | | This patch adds all the refactored tests in new files, the old tests will be removed by a followup commit. Thanks to D. Blaikie for all the feedback. llvm-svn: 245803
* Enable five passing dsymutil tests on Windows. Yaron Keren2015-08-115-5/+0
| | | | | | | These tests pass with Windows 7 x64 + MSYS2. I'll see if the bots like them as well and disable the failing ones. llvm-svn: 244572
* Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCIJonathan Roelofs2015-08-101-1/+1
| | | | | | | I looked into adding a warning / error for this to FileCheck, but there doesn't seem to be a good way to avoid it triggering on the instances of it in RUN lines. llvm-svn: 244481
* [dsymutil] Use the new MCDwarfLineTableParams customization to emit linetablesFrederic Riss2015-08-073-0/+46
| | | | | | | | llvm-dsymutil has to be able to process debug info produced by other compilers which use different line table settings. The testcase wasn't generated by another compiler, but by a modified clang. llvm-svn: 244319
* Tweak llvm/test/tools/dsymutil/arch-option.test to avoid globbing on mingw-w64.NAKAMURA Takumi2015-08-071-1/+1
| | | | llvm-svn: 244311
* [dsymutil] Implement dSYM bundle creationFrederic Riss2015-08-062-11/+64
| | | | | | | | | | | | | | A dSYM bundle is a file hierarchy that looks slike this: <bundle name>.dSYM/ Contents/ Info.plist Resources/ DWARF/ <DWARF file(s)> This is the default output mode of dsymutil. llvm-svn: 244270
* [dsymutil] Add (unimplemented) --flat optionFrederic Riss2015-08-0612-19/+19
| | | | | | | | | | | | | | dsymutil should by default generate dSYM bundles which are filesystem hierarchies containing the debug info and an additional Info.plist. Currently llvm-dsymutil emits raw binaries containing the debug info. This is what we call the 'flat mode'. Add a -f/-flat option that is supposed to enable that flat mode, but don't wire it for now, only pass it to the tests that will need it to stay functional once we do bundle generation by default. This basically makes this commit NFC and removes the noise from the actual commit that adds support for bundle generation. llvm-svn: 244269
* Revert "Make sure all temporary files get created under %T."Frederic Riss2015-08-051-3/+1
| | | | | | | | | This reverts commit r244163. The workaround shouldn't be necessary after r244172, and moreover the commit was slightly buggy as it dis a simple mkdir without removing the directory first, which could cause 'File exists' errors. llvm-svn: 244182
* [dsymutil] Update source used to generate test binary.Frederic Riss2015-08-051-2/+13
| | | | | | Forgot to include that in the last commit. llvm-svn: 244171
* Make sure all temporary files get created under %T.Artem Belevich2015-08-051-1/+3
| | | | llvm-svn: 244163
* [dsymutil] Add support for the -arch option.Frederic Riss2015-08-053-0/+39
| | | | | | | | This option allows to select a subset of the architectures when performing a universal binary link. The filter is done completely in the mach-o specific part of the code. llvm-svn: 244160
* [dsymutil] Fix test patterns.Frederic Riss2015-08-051-3/+3
| | | | | | | Depending on the filesystem paths, the YAML dump might quote paths. Account for that in the regex patterns. llvm-svn: 244094
* [dsymutil] Implement support for handling mach-o universal binaries as main ↵Frederic Riss2015-08-052-0/+32
| | | | | | | | | | | | | | | | | input/output. The DWARF linker isn't touched by this, the implementation links individual files and merges them together into a fat binary by calling out to the 'lipo' utility. The main change is that the MachODebugMapParser can now return multiple debug maps for a single binary. The test just verifies that lipo would be invoked correctly, but doesn't actually generate a binary. This mimics the way clang tests its external iplatform tools integration. llvm-svn: 244087
* DI: Disallow uniquable DICompileUnitsDuncan P. N. Exon Smith2015-08-032-2/+2
| | | | | | | | | | | | | | | | | | Since r241097, `DIBuilder` has only created distinct `DICompileUnit`s. The backend is liable to start relying on that (if it hasn't already), so make uniquable `DICompileUnit`s illegal and automatically upgrade old bitcode. This is a nice cleanup, since we can remove an unnecessary `DenseSet` (and the associated uniquing info) from `LLVMContextImpl`. Almost all the testcases were updated with this script: git grep -e '= !DICompileUnit' -l -- test | grep -v test/Bitcode | xargs sed -i '' -e 's,= !DICompileUnit,= distinct !DICompileUnit,' I imagine something similar should work for out-of-tree testcases. llvm-svn: 243885
* Fix the test added at r243777.Alexander Kornienko2015-08-031-2/+2
| | | | | | | When RUN: lines are split into multiple lines, each one must be prefixed with RUN:. llvm-svn: 243868
* [dsymutil] Support multiple input files on the command lineFrederic Riss2015-07-312-0/+13
| | | | llvm-svn: 243777
* DI: Remove DW_TAG_arg_variable and DW_TAG_auto_variableDuncan P. N. Exon Smith2015-07-319-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [dsymutil] Rename -v option to -verboseFrederic Riss2015-07-294-10/+10
| | | | | | | | | | | | The dsymutil-classic -v option dumps the tool version rather than putting it in verbose mode. Rename -v to -verbose and update the tests that use it (in the process removing it from a few tests that didn't require it anymore since the -dump-debug-map option was introduced). A followup commit will reintroduce the -v option that dumps the version. llvm-svn: 243582
* llvm/test/tools/dsymutil/ARM/lit.local.cfg: Fix possibly typo, s/X86/ARM/.NAKAMURA Takumi2015-07-241-1/+1
| | | | llvm-svn: 243106
* [dsymutil] Implement support for universal mach-o object files.Frederic Riss2015-07-248-0/+80
| | | | | | | | | | | | | This patch allows llvm-dsymutil to read universal (aka fat) macho object files and archives. The patch touches nearly everything in the BinaryHolder, but it is fairly mechinical: the methods that returned MemoryBufferRefs or ObjectFiles now return a vector of those, and the high-level access function takes a triple argument to select the architecture. There is no support yet for handling fat executables and thus no support for writing fat object files. llvm-svn: 243096
* [dsymutil] Make the triple detection more strict.Frederic Riss2015-07-246-10/+10
| | | | | | | | MachOObjectFile offers a method for detecting the correct triple, use it instead of the previous approximation. This doesn't matter right now, but it will become important for mach-o universal (fat) binaries. llvm-svn: 243095
* [dsymutil] Check archive members timestamps.Frederic Riss2015-07-222-0/+27
| | | | | | | | | The debug map contains the timestamp of the object files in references. We do not check these in the general case, but it's really useful if you have archives where different versions of an object file have been appended. This allows llvm-dsymutil to find the right one. llvm-svn: 242965
* [dsymutil] Implement ODR uniquing for C++ code.Frederic Riss2015-07-2116-0/+1190
| | | | | | | | | | | | | | | | | This optimization allows the DWARF linker to reuse definition of types it has emitted in previous CUs rather than reemitting them in each CU that references them. The size and link time gains are huge. For example when linking the DWARF for a debug build of clang, this generates a ~150M dwarf file instead of a ~700M one (the numbers date back a bit and must not be totally accurate these days). As with all the other parts of the llvm-dsymutil codebase, the goal is to keep bit-for-bit compatibility with dsymutil-classic. The code is littered with a lot of FIXMEs that should be addressed once we can get rid of the compatibilty goal. llvm-svn: 242847
* [dsymutil] Fix misspelled CHECK line.Frederic Riss2015-06-051-1/+1
| | | | llvm-svn: 239200
* [dsymutil] Add support for linking the debug_frame section.Frederic Riss2015-06-055-0/+231
| | | | | | | | | | | Linking the debug frame section is actually very easy as we just have to patch the start address in the FDE header and then copy the rest of the FDE without even looking at it. The only small complexity comes from the handling of the CIEs that we should unique across object file. This is also really easy by using a StringMap keyed on the raw contents of the CIE. llvm-svn: 239198
* [dsymutil] Have the YAML deserialization rewrite the object address of symbols.Frederic Riss2015-06-051-0/+44
| | | | | | | | | | | The main use of the YAML debug map format is for testing inside LLVM. If we have IR files in the tests used to generate object files, then we obviously don't know the addresses of the symbols inside the object files beforehand. This change lets the YAML import lookup the addresses in the object files and rewrite them. This will allow to have test that really don't need any binary input. llvm-svn: 239189
* [dsymutil] Handle the -oso-prepend-path option when the input is a YAML ↵Frederic Riss2015-06-052-2/+2
| | | | | | | | debug map All the tests using a YAML debug map will need this. llvm-svn: 239163
* Reapply r238941 - [dsymutil] Accept a YAML debug map as input instead of a ↵Frederic Riss2015-06-032-0/+3
| | | | | | | | | | | | | | | | | | | | | binary. With a couple more constructors that GCC thinks are necessary. Original commit message: [dsymutil] Accept a YAML debug map as input instead of a binary. To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238959
* Revert "[dsymutil] Accept a YAML debug map as input instead of a binary."Frederic Riss2015-06-032-3/+0
| | | | | | This reverts commit r238941 while I figure out the bot issues. llvm-svn: 238943
* [dsymutil] Accept a YAML debug map as input instead of a binary.Frederic Riss2015-06-032-0/+3
| | | | | | | | | | | | | To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238941
* [dsymutil] Replace -parse-only option with -dump-debug-mapFrederic Riss2015-06-031-5/+5
| | | | | | | | | | As the serialized debug map is becoming a first class citizen, a way to cleanly dump it is required. We used -parse-only combined with -v for that purpose before, but it dumps a lot of unrelated debug stuff. Dumping the debug map was the only use of the -parse-only flag anyway, so replace it with a more useful option. llvm-svn: 238940
* [dsymutil] Use YAMLIO to dump debug map.Frederic Riss2015-06-011-40/+42
| | | | | | | | | | | Doing so will allow us to also accept a YAML debug map in input as using YAMLIO gives us the parsing for free. Being able to have textual debug maps will in turn allow much more control over the tests, because 1/ no need to check-in a binary containing the debug map and 2/ it will allow to use the same objects/IR files with made-up debug-maps to test different scenari. llvm-svn: 238781
* [dsymutil] Temporarily disable some tests on windows.Frederic Riss2015-03-243-0/+3
| | | | | | | | It seems one windows bot fails since I added ilne table linking to llvm-dsymutil (see r232333 commit thread). Disable the affected tests until I can figure out what's happening. llvm-svn: 233130
* [dsymutil] Add support to generate .debug_pubnames and .debug_pubtypesFrederic Riss2015-03-163-1/+71
| | | | | | | | The information gathering part of the patch stores a bit more information than what is strictly necessary for these 2 sections. The rest will become useful when we start emitting __apple_* type accelerator tables. llvm-svn: 232342
* Rework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test ↵NAKAMURA Takumi2015-03-161-8/+7
| | | | | | dospath-tolerant. llvm-svn: 232339
* Suppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will ↵NAKAMURA Takumi2015-03-151-0/+1
| | | | | | fix later. llvm-svn: 232337
* llvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions ↵NAKAMURA Takumi2015-03-152-8/+8
| | | | | | to meet dos path. llvm-svn: 232336
* [dsymutil] Add support for linking line tables.Frederic Riss2015-03-153-1/+138
| | | | | | | | | | | | | | | This code comes with a lot of cruft that is meant to mimic darwin's dsymutil behavior. A much simpler approach (described in the numerous FIXMEs that I put in there) gives the right output for the vast majority of cases. The extra corner cases that are handled differently need to be investigated: they seem to correctly handle debug info that is in the input, but that info looks suspicious in the first place. Anyway, the current code needs to handle this, but I plan to revisit it as soon as the big round of validation against the classic dsymutil is over. llvm-svn: 232333
OpenPOWER on IntegriCloud