summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [codeview] Dump line number and column information.Zachary Turner2016-06-032-12/+65
| | | | | | | | | | | | | | | | | | | | | | | | | To facilitate this, a couple of changes had to be made: 1. `ModuleSubstream` got moved from `DebugInfo/PDB` to `DebugInfo/CodeView`, and various codeview related types are defined there. It turns out `DebugInfo/CodeView/Line.h` already defines many of these structures, but this is really old code that is not endian aware, doesn't interact well with `StreamInterface` and not very helpful for getting stuff out of a PDB. Eventually we should migrate the old readobj `COFFDumper` code to these new structures, or at least merge their functionality somehow. 2. A `ModuleSubstream` visitor is introduced. Depending on where your module substream array comes from, different subsets of record types can be expected. We are already hand parsing these substream arrays in many places especially in `COFFDumper.cpp`. In the future we can migrate these paths to the visitor as well, which should reduce a lot of code in `COFFDumper.cpp`. Differential Revision: http://reviews.llvm.org/D20936 Reviewed By: ruiu, majnemer llvm-svn: 271621
* Fix indentation.Rui Ueyama2016-06-031-6/+6
| | | | llvm-svn: 271620
* Revert "[yaml2obj] Sort MachO LinkEdit write operations based on offset"Chris Bieneman2016-06-021-66/+26
| | | | | | | | | | This reverts commit r271611 because it broke a bot: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/38184 I don't currently have a handle on what went wrong, so I'll revert while I investigate. llvm-svn: 271613
* [yaml2obj] Sort MachO LinkEdit write operations based on offsetChris Bieneman2016-06-021-26/+66
| | | | | | Although ld64 always outputs linkedit data in the same order, it isn't actually required to. This change makes yaml2obj resilient if the offsets are in arbitrary order. llvm-svn: 271611
* [obj2yaml] [yaml2obj] Support for MachO nlist and string tableChris Bieneman2016-06-022-7/+73
| | | | | | This commit adds round tripping for MachO symbol data. Symbols are entries in the name list, that contain offsets into the string table which is at the end of the __LINKEDIT segment. llvm-svn: 271604
* Fixup r271533, or check-clang didn't find llvm-lto as the target.NAKAMURA Takumi2016-06-021-0/+1
| | | | llvm-svn: 271585
* [llvm-pdbdump] Dump CodeView line information.Zachary Turner2016-06-021-16/+42
| | | | | | | | | This first pass only splits apart the records and dumps the line info kinds and binary data. Subsequent patches will parse out the binary data into more useful information and dump it in detail. llvm-svn: 271576
* pdbdump: print out COFF section headers.Rui Ueyama2016-06-021-0/+39
| | | | | | | | | | | | Unlike other sections that can grow to any size, the COFF section header stream has maximum length because each record is fixed size and the COFF file format limits the maximum number of sections. So I decided to not create a specific stream class for it. Instead, I added a member function to DbiStream class which returns a vector of COFF headers. Differential Revision: http://reviews.llvm.org/D20717 llvm-svn: 271557
* Rename IMAGE_DEBUG_TYPE_NO_TIMESTAMP to IMAGE_DEBUG_TYPE_REPRODavid Majnemer2016-06-021-1/+2
| | | | | | This matches the COFF spec llvm-svn: 271549
* [COFF] Expose the PE debug data directory and dump itReid Kleckner2016-06-023-1/+63
| | | | | | | | | | | | This directory is used to find if there is a PDB associated with an executable. I plan to use this functionality to teach llvm-symbolizer whether it should use DIA or DWARF to symbolize a given DLL. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D20885 llvm-svn: 271539
* [llvm-cov] Use string getters (NFC)Vedant Kumar2016-06-021-2/+3
| | | | llvm-svn: 271537
* [pdb] Parse and dump section map and section contribsZachary Turner2016-06-021-13/+95
| | | | | | | Differential Revision: http://reviews.llvm.org/D20876 Reviewed By: rnk, ruiu llvm-svn: 271488
* Add new LLVM_EXTERNAL_PROJECTS option to cmakeTamas Berghammer2016-06-011-0/+5
| | | | | | | | | | | | | | | | | | | The new option makes it possible to build external projects as part of the llvm build without copying (or symlinking) then into llvm/tool with specifying a few additional cmake variables. Example usage (2 additional project called foo and bar): -DLLVM_EXTERNAL_PROJECTS="Foo;Bar" -DLLVM_EXTERNAL_FOO_SOURCE_DIR=/src/foo -DLLVM_EXTERNAL_BAR_SOURCE_DIR=/src/bar Note: This is the extension of the approach we already support for clang/lldb/poly with adding an option to specify additional supported projects. Differential revision: http://reviews.llvm.org/D20838 llvm-svn: 271440
* [MC] Rename EmitFill to emitFillPetr Hosek2016-06-011-1/+1
| | | | | | | | This is to match the overloaded variants as well as the new style. Differential Revision: http://reviews.llvm.org/D20690 llvm-svn: 271359
* llvm-pdbdump-fuzzer: fix the buildKostya Serebryany2016-05-311-8/+9
| | | | llvm-svn: 271352
* [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.Lang Hames2016-05-311-2/+1
| | | | | | | | | | This tidies up some code that was manually constructing RuntimeDyld::SymbolInfo instances from JITSymbols. It will save more mess in the future when JITSymbol::getAddress is extended to return an Expected<TargetAddress> rather than just a TargetAddress, since we'll be able to embed the error checking in the conversion. llvm-svn: 271350
* Speculative build fix for codeview type dumper API changeReid Kleckner2016-05-311-1/+1
| | | | llvm-svn: 271344
* Change llvm-objdump, llvm-nm and llvm-size when reporting an object file errorKevin Enderby2016-05-317-37/+148
| | | | | | | | | | | | | | | | | | | when the object is from a slice of a Mach-O Universal Binary use something like "foo.o (for architecture i386)" as part of the error message when expected. Also fixed places in these tools that were ignoring object file errors from MachOUniversalBinary::getAsObjectFile() when the code moved on to see if the slice was an archive. To do this MachOUniversalBinary::getAsObjectFile() and MachOUniversalBinary::getObjectForArch() were changed from returning ErrorOr<...> to Expected<...> then that was threaded up to its users. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now the use of errorToErrorCode() is still used in two places yet to be fully converted. llvm-svn: 271332
* [codeview] Improve readability of type record assemblyReid Kleckner2016-05-312-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the method MCStreamer::EmitBinaryData, which is usually an alias for EmitBytes. In the MCAsmStreamer case, it is overridden to emit hex dump output like this: .byte 0x0e, 0x00, 0x08, 0x10 .byte 0x03, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x10, 0x00, 0x00 Also, when verbose asm comments are enabled, this patch prints the dump output for each comment before its record, like this: # ArgList (0x1000) { # TypeLeafKind: LF_ARGLIST (0x1201) # NumArgs: 0 # Arguments [ # ] # } .byte 0x06, 0x00, 0x01, 0x12 .byte 0x00, 0x00, 0x00, 0x00 This should make debugging easier and testing more convenient. Reviewers: aaboud Subscribers: majnemer, zturner, amccarth, aaboud, llvm-commits Differential Revision: http://reviews.llvm.org/D20711 llvm-svn: 271313
* [codeview] Add a CVTypeDumper::dump(ArrayRef<uint8_t>) overloadReid Kleckner2016-05-311-24/+2
| | | | | | | This is a convenient wrapper when the type record is already laid out as bytes in memory. llvm-svn: 271309
* [obj2yaml][yaml2obj] Support for reading and dumping the MachO export trieChris Bieneman2016-05-312-10/+174
| | | | | | The MachO export trie is a serially encoded trie keyed by symbol name. This code parses the trie and preserves the structure so that it can be dumped again. llvm-svn: 271300
* [llvm-pdbdump-fuzzer] Add a fuzzer for llvm-pdbdumpDavid Majnemer2016-05-313-0/+96
| | | | llvm-svn: 271243
* [llvm-dwarfdump-fuzzer] Get this compiling againDavid Majnemer2016-05-311-2/+4
| | | | | | | Looks like the dwarfdump fuzzer has bitrotted, update it to take into account updates to the libobject API. llvm-svn: 271242
* Remove some 'const' specifiers that do nothing but prevent moving the argument.Benjamin Kramer2016-05-291-1/+1
| | | | | | | Found by clang-tidy's misc-move-const-arg. While there drop some obsolete c_str() calls. llvm-svn: 271181
* Don't dereference a symbol iterator before checking for the end caseDavid Majnemer2016-05-291-3/+7
| | | | llvm-svn: 271173
* Move RelaxELFRel out to llvm-mc.Rafael Espindola2016-05-291-0/+6
| | | | llvm-svn: 271160
* [COFFDumper] Validate that the next offset is not too largeDavid Majnemer2016-05-281-0/+2
| | | | llvm-svn: 271147
* [COFFDumper] Make sure there is sufficient padding left in the string tableDavid Majnemer2016-05-281-1/+4
| | | | llvm-svn: 271146
* [COFFDumper] Make sure there is sufficient padding left in the checksumDavid Majnemer2016-05-281-0/+2
| | | | llvm-svn: 271143
* [llvm-readobj] Validate the string table offset before using itDavid Majnemer2016-05-281-2/+8
| | | | llvm-svn: 271139
* Use consume instead of manually using drop_frontDavid Majnemer2016-05-281-2/+2
| | | | llvm-svn: 271137
* llvm-pdbdump should have a non-zero exit code on errorDavid Majnemer2016-05-281-19/+10
| | | | llvm-svn: 271132
* [pdb] Finish conversion to zero copy pdb access.Zachary Turner2016-05-282-9/+54
| | | | | | | | | | | | | | This converts remaining uses of ByteStream, which was still left in the symbol stream and type stream, to using the new StreamInterface zero-copy classes. RecordIterator is finally deleted, so this is the only way left now. Additionally, more error checking is added when iterating the various streams. With this, the transition to zero copy pdb access is complete. llvm-svn: 271101
* Apply clang-tidy's misc-move-constructor-init throughout LLVM.Benjamin Kramer2016-05-274-11/+16
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270997
* Avoid some copies by using const references.Benjamin Kramer2016-05-273-10/+10
| | | | | | | clang-tidy's performance-unnecessary-copy-initialization with some manual fixes. No functional changes intended. llvm-svn: 270988
* Recommit 270977 - [llvm-mc] - Teach llvm-mc to generate zlib styled ↵George Rimar2016-05-271-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | compression sections. Fix: updated clang code which was not updated by mistake. Original commit message: [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections. This patch is strongly based on previously reverted D20331. (because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style) Difference that this patch supports both zlib and zlib-gnu styles. -compress-debug-sections option now supports next values: -compress-debug-sections=zlib-gnu -compress-debug-sections=zlib -compress-debug-sections=none Previously specifying -compress-debug-sections enabled zlib-gnu compression, so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior that was before this patch for case when compression was enabled. Differential revision: http://reviews.llvm.org/D20676 llvm-svn: 270987
* Revert r270977 ([llvm-mc] - Teach llvm-mc to generate zlib styled ↵George Rimar2016-05-271-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compression sections.) It broke buildbot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/13585/steps/build/logs/stdio Initial commit message: [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections. This patch is strongly based on previously reverted D20331. (because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style) Difference that this patch supports both zlib and zlib-gnu styles. -compress-debug-sections option now supports next values: -compress-debug-sections=zlib-gnu -compress-debug-sections=zlib -compress-debug-sections=none Previously specifying -compress-debug-sections enabled zlib-gnu compression, so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior that was before this patch for case when compression was enabled. Differential revision: http://reviews.llvm.org/D20676 llvm-svn: 270978
* [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.George Rimar2016-05-271-5/+14
| | | | | | | | | | | | | | | | | | | | This patch is strongly based on previously reverted D20331. (because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style) Difference that this patch supports both zlib and zlib-gnu styles. -compress-debug-sections option now supports next values: -compress-debug-sections=zlib-gnu -compress-debug-sections=zlib -compress-debug-sections=none Previously specifying -compress-debug-sections enabled zlib-gnu compression, so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior that was before this patch for case when compression was enabled. Differential revision: http://reviews.llvm.org/D20676 llvm-svn: 270977
* Linker: teach the IR mover to return llvm::Error.Peter Collingbourne2016-05-271-11/+12
| | | | | | | | | This will be needed in order to consistently return an Error to clients of the API being developed in D20268. Differential Revision: http://reviews.llvm.org/D20550 llvm-svn: 270967
* [codeview] Remove StreamReader copying method.Zachary Turner2016-05-271-1/+7
| | | | | | | | | | | Since we want to move toward zero-copy access to stream data, we want to remove all instances of copying operations. So get rid of some of those here. Differential Revision: http://reviews.llvm.org/D20720 Reviewed By: ruiu llvm-svn: 270960
* [codeview,pdb] Try really hard to conserve memory when reading.Zachary Turner2016-05-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | PDBs can be extremely large. We're already mapping the entire PDB into the process's address space, but to make matters worse the blocks of the PDB are not arranged contiguously. So, when we have something like an array or a string embedded into the stream, we have to make a copy. Since it's convenient to use traditional data structures to iterate and manipulate these records, we need the memory to be contiguous. As a result of this, we were using roughly twice as much memory as the file size of the PDB, because every stream was copied out and re-stitched together contiguously. This patch addresses this by improving the MappedBlockStream to allocate from a BumpPtrAllocator only when a read requires a discontiguous read. Furthermore, it introduces some data structures backed by a stream which can iterate over both fixed and variable length records of a PDB. Since everything is backed by a stream and not a buffer, we can read almost everything from the PDB with zero copies. Differential Revision: http://reviews.llvm.org/D20654 Reviewed By: ruiu llvm-svn: 270951
* pdbdump: print out the name of the stream 0.Rui Ueyama2016-05-271-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D20712 llvm-svn: 270943
* pdbdump: Add -raw-all to enable all -raw-* flags.Rui Ueyama2016-05-261-0/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D20707 llvm-svn: 270937
* Fix typo.Rui Ueyama2016-05-261-15/+15
| | | | llvm-svn: 270934
* [obj2yaml][yaml2obj] Support for MachO lazy bindingsChris Bieneman2016-05-262-0/+4
| | | | | | This adds support for YAML round tripping dyld info lazy bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld, and can have DONE opcodes in the middle of the opcode lists. llvm-svn: 270920
* [obj2yaml][yaml2obj] Support for MachO weak bindingsChris Bieneman2016-05-262-16/+28
| | | | | | This adds support for YAML round tripping dyld info weak bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld. llvm-svn: 270911
* [obj2yaml][yaml2obj] Support for MachO bind opcodesChris Bieneman2016-05-262-0/+83
| | | | | | This adds support for YAML round tripping dyld info bind opcodes. Bind opcodes can have signed or unsigned LEB128 data, and they can have symbols associated with them. llvm-svn: 270901
* [Orc] Merge some common code for creating CompileCallbackManagers andLang Hames2016-05-262-55/+3
| | | | | | IndirectStubsManagers. llvm-svn: 270874
* [CMake] Restrict libxar linkage to just llvm-objdumpChris Bieneman2016-05-261-0/+4
| | | | | | At some point we're going to need libObject to have this dependency, but as it is now this is causing too many headaches. This commit will reduce the linkage to just llvm-objdump where it is strictly needed, and we'll cross the libObject bridge later when we need it. llvm-svn: 270866
* Revert "[CMake] LINK_LIBS need to be public for Darwin dylib targets"Steven Wu2016-05-261-11/+0
| | | | | | This reverts r270723. This commit breaks greendragon. llvm-svn: 270820
OpenPOWER on IntegriCloud