summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil
Commit message (Collapse)AuthorAgeFilesLines
...
* dsymutil: Make DwarfLinker::reportWarning() public. (NFC)Adrian Prantl2015-09-221-3/+3
| | | | llvm-svn: 248310
* Fix a typo.Adrian Prantl2015-09-221-4/+4
| | | | llvm-svn: 248283
* Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders2015-09-151-2/+2
| | | | | | | | related. NFC. Eric has replied and has demanded the patch be reverted. llvm-svn: 247702
* Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* ↵Daniel Sanders2015-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and related. NFC. Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Thanks go to Pavel Labath for fixing LLDB for me. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247692
* Revert r247684 - Replace Triple with a new TargetTuple ...Daniel Sanders2015-09-151-2/+2
| | | | | | LLDB needs to be updated in the same commit. llvm-svn: 247686
* Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.Daniel Sanders2015-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247683
* dsymutil: Remove the now obsolete RelocMgr argument from cloneDIE. (NFC)Adrian Prantl2015-09-141-8/+6
| | | | llvm-svn: 247636
* dsymutil: Factor out the DIE cloning into a DIECloner class. (NFC)Adrian Prantl2015-09-141-161/+169
| | | | llvm-svn: 247577
* dsymutil: Factor out the relocation handling into a RelocationManager (NFC)Adrian Prantl2015-09-111-125/+176
| | | | llvm-svn: 247490
* [dsymutil] Discard useless location attributes.Frederic Riss2015-09-111-4/+68
| | | | | | | | | | | | | | 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
* [dsymutil] Rename some variables NFC.Frederic Riss2015-09-111-11/+11
| | | | | | | lldb doesn't like having variables named as an existing type. In order to ease debugging, rename those variables to avoid that conflict. llvm-svn: 247385
* Reapply r246012 [dsymutil] Emit real dSYM companion binaries.Frederic Riss2015-09-023-3/+439
| | | | | | | | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | isn't found. llvm-svn: 246412
* [dsymutil] Do not crash on empty debug_range range.Frederic Riss2015-08-311-9/+11
| | | | | | | | | | 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
* [dsymutil] Fix caching of current range. NFC.Frederic Riss2015-08-311-2/+3
| | | | | | | The current range cache will will just be hit more often, no visible external change. llvm-svn: 246409
* [dsymutil] Fix handling of inlined_subprogram low_pcsFrederic Riss2015-08-311-3/+14
| | | | | | | | | 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] Do not construct a StringRef from a std::string temporaryFrederic Riss2015-08-311-2/+1
| | | | llvm-svn: 246404
* [dsymutil] Implement -symtab/-s option.Frederic Riss2015-08-313-0/+193
| | | | | | | This option dumps the STAB entries that define the debug map(s) stored in the input binaries, and then exits. llvm-svn: 246403
* Revert "[dsymutil] Emit real dSYM companion binaries."Frederic Riss2015-08-263-436/+3
| | | | | | | This reverts commit r246012. Some bots do not like it (mips/s390). llvm-svn: 246019
* [dsymutil] Emit real dSYM companion binaries.Frederic Riss2015-08-263-3/+436
| | | | | | | | | | | | | | | | | | | 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-263-2/+9
| | | | | | | | | 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] Make the warn and error helpers globally available. NFC.Frederic Riss2015-08-262-11/+14
| | | | llvm-svn: 246010
* [dsymutil] Split NonRelocatableStringPool into its own file. NFC.Frederic Riss2015-08-262-86/+103
| | | | llvm-svn: 246009
* [dsymutil] Reapply r245960.Frederic Riss2015-08-253-1/+11
| | | | | | | | | | | | | | | | | | 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-253-11/+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-253-1/+11
| | | | | | | | | | 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-252-5/+4
| | | | llvm-svn: 245959
* Remove raw_svector_ostream::resync and users. It's no-op after r244870.Yaron Keren2015-08-131-3/+0
| | | | llvm-svn: 244888
* Recommit r244470+ r244471 together, the bot failed between them.Yaron Keren2015-08-101-7/+5
| | | | llvm-svn: 244476
* Revert r244470 and 244471 while looking into it.Yaron Keren2015-08-101-5/+7
| | | | llvm-svn: 244472
* Second part of r244470 (source file was unsaved in editor).Yaron Keren2015-08-101-5/+5
| | | | llvm-svn: 244471
* Really implement David Blaikie suggestion in full of seperatingYaron Keren2015-08-101-3/+1
| | | | | | | variable initialization from its usage in the push_back making collapse of the two statements unlikely even without a comment. llvm-svn: 244470
* Fully apply David Blaikie suggestion and add comment explaining why.Yaron Keren2015-08-101-1/+3
| | | | llvm-svn: 244461
* Modify r244405 to clearer code, per David Blaikie suggestion.Yaron Keren2015-08-101-2/+2
| | | | llvm-svn: 244455
* Fix dangling reference in DwarfLinker.cpp. The original codeYaron Keren2015-08-081-0/+1
| | | | | | | | | | | | Seq.emplace_back(Seq.back()); does not work as planned, since Seq.back() may become a dangling reference when emplace_back is called and possibly reallocates vector. To avoid this, the vector allocation should be reserved first and only then used. This broke test/tools/dsymutil/X86/custom-line-table.test with Visual C++ 2013. llvm-svn: 244405
* Convert getSymbolSection to return an ErrorOr.Rafael Espindola2015-08-071-2/+7
| | | | | | | This function can actually fail since the symbol contains an index to the section and that can be invalid. llvm-svn: 244375
* [dsymutil] Use the new MCDwarfLineTableParams customization to emit linetablesFrederic Riss2015-08-071-10/+17
| | | | | | | | 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
* [dsymutil] Implement dSYM bundle creationFrederic Riss2015-08-061-6/+101
| | | | | | | | | | | | | | 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-061-2/+12
| | | | | | | | | | | | | | 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
* [dsymutil] Do not create temporary files in -no-output mode.Frederic Riss2015-08-051-5/+19
| | | | | | | | | The files were never written to and then deleted, but they were created nonetheless. To prevent that, create a wrapper around the 2 variants of createUniqueFile and use the one that only does an access(Exists) call to check for name unicity in -no-output mode. llvm-svn: 244172
* [dsymutil] Add support for the -arch option.Frederic Riss2015-08-053-13/+50
| | | | | | | | 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] Implement support for handling mach-o universal binaries as main ↵Frederic Riss2015-08-058-40/+203
| | | | | | | | | | | | | | | | | 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
* [dsymutil] Introduce exit helper. NFC.Frederic Riss2015-08-052-3/+12
| | | | | | | | llvm-dsymutil will start creating temporary files in a followup commit. To ease the correct cleanup of this files, introduce a helper called to exit dsymutil. llvm-svn: 244086
* [dsymutil] Split some logic into a helper function. NFCFrederic Riss2015-08-051-10/+10
| | | | llvm-svn: 244085
* DwarfLinker: Use DIEValueList instead of DIE, NFCDuncan P. N. Exon Smith2015-08-021-2/+3
| | | | | | | Use `DIEValueList` as a pointer to either `DIEBlock` or `DIELoc` instead of `DIE`, since soon they won't inherit from the latter. llvm-svn: 243857
* [dsymutil] Support multiple input files on the command lineFrederic Riss2015-07-311-23/+33
| | | | llvm-svn: 243777
* [dsymutil] Re-add command line option -v this time printing the version.Frederic Riss2015-07-291-0/+6
| | | | llvm-svn: 243584
* [dsymutil] Use option categories.Frederic Riss2015-07-291-9/+22
| | | | | | | | Prevent all the unrelated LLVM options to appear in the -help output by introducing a tool specific option category. As a drive-by improve the wording of the help message. llvm-svn: 243583
* [dsymutil] Rename -v option to -verboseFrederic Riss2015-07-291-1/+1
| | | | | | | | | | | | 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
* [dsymutil] Implement support for universal mach-o object files.Frederic Riss2015-07-245-107/+220
| | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud