summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix warnings and -Werror build on clang.Zachary Turner2016-04-261-1/+1
| | | | llvm-svn: 267589
* Parse and dump PDB DBI Stream Header InformationZachary Turner2016-04-265-1/+191
| | | | | | | | | | | | | | | | | | The DBI stream contains a lot of bookkeeping information for other streams. In particular it contains information about section contributions and linked modules. This patch is a first attempt at parsing some of the information out of the DBI stream. It currently only parses and dumps the headers of the DBI stream, so none of the module data or section contribution data is pulled out. This is just a proof of concept that we understand the basic properties of the DBI stream's metadata, and followup patches will try to extract more detailed information out. Differential Revision: http://reviews.llvm.org/D19500 Reviewed By: majnemer, ruiu llvm-svn: 267585
* Fix build broken due to order of initialization problem.Zachary Turner2016-04-261-2/+1
| | | | llvm-svn: 267571
* Refactor some more PDB reading code into DebugInfoPDB.Zachary Turner2016-04-263-0/+164
| | | | | | | Differential Revision: http://reviews.llvm.org/D19445 Reviewed By: David Majnemer llvm-svn: 267564
* Resubmit "Refactor raw pdb dumper into library"Zachary Turner2016-04-255-3/+468
| | | | | | | This fixes a number of endianness issues as well as an ODR violation that hopefully causes everything to be happy. llvm-svn: 267431
* llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo ↵David Blaikie2016-04-221-5/+8
| | | | | | | | | | | contains a dwo_name attribute The dwo_name was added to dwo files to improve diagnostics in dwp, but it confuses tools that attempt to load any dwo named by a dwo_name, even ones inside dwos. Avoid this by keeping track of whether a unit is already a dwo unit, and if so, not loading further dwos. llvm-svn: 267241
* llvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo ↵David Blaikie2016-04-221-12/+7
| | | | | | | | | | | | | | | | | | | | | file is present Rather than relying on the gmlt-like data emitted into the .o/executable which only contains the simple name of any inlined functions, use the .dwo file if present. Test symbolication with/without a .dwo, and the old test that was testing behavior when no gmlt-like data was present. (I haven't included a test of non-gmlt-like data + no .dwo (that would be akin to symbolication with no debug info) but we could add one for completeness) The test was simplified a bit to be a little clearer (unoptimized, force inline, using a function call as the inlined entity) and regenerated with ToT clang. For the no-gmlt-like-data case, I modified Clang back to its old behavior temporarily & the .dwo file is identical so it is shared between the two executables. llvm-svn: 267227
* Revert r267049, r26706[16789], r267071 - Refactor raw pdb dumper into libraryDaniel Sanders2016-04-225-468/+3
| | | | | | r267049 broke multiple buildbots (e.g. clang-cmake-mips, and clang-x86_64-linux-selfhost-modules) which the follow-ups have not yet resolved and this is preventing subsequent committers from being notified about additional failures on the affected buildbots. llvm-svn: 267148
* Fix PDB warnings and testReid Kleckner2016-04-212-22/+9
| | | | llvm-svn: 267071
* Remove dead code. NFCAmaury Sechet2016-04-211-4/+0
| | | | llvm-svn: 267069
* Fix -Wreturn-type warning with HAVE_DIA_SDK is false.Zachary Turner2016-04-211-0/+2
| | | | llvm-svn: 267068
* Fix for case sensitive filename failure.Zachary Turner2016-04-211-1/+1
| | | | llvm-svn: 267066
* Remove various warnings. NFCAmaury Sechet2016-04-212-5/+4
| | | | llvm-svn: 267061
* Refactor raw pdb dumper into libraryZachary Turner2016-04-215-3/+484
| | | | | | | | | | | | | | | | | | PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the parsing of this code into DebugInfoPDB and makes the dumper use this. This is achieved by implementing the skeleton of RawPdbSession, the non-DIA counterpart to the existing PDB read interface. None of the type / source file / etc information is accessible yet, so this implementation is not yet close to achieving parity with the DIA counterpart, but the RawSession class simply holds a reference to a PDBFile class which handles parsing the file format. Additionally a PDBStream class is introduced which allows accessing the bytes of a particular stream in a PDB file. Differential Revision: http://reviews.llvm.org/D19343 Reviewed By: majnemer llvm-svn: 267049
* Thread Expected<...> up from libObject’s getName() for symbols to allow ↵Kevin Enderby2016-04-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | llvm-objdump to produce a good error message. Produce another specific error message for a malformed Mach-O file when a symbol’s string index is past the end of the string table. The existing test case in test/Object/macho-invalid.test for macho-invalid-symbol-name-past-eof now reports the error with the message indicating that a symbol at a specific index has a bad sting index and that bad string index value. Again converting interfaces to Expected<> from ErrorOr<> does involve touching a number of places. Where the existing code reported the error with a string message or an error code it was converted to do the same. There is some code for this that could be factored into a routine but I would like to leave that for the code owners post-commit to do as they want for handling an llvm::Error. An example of how this could be done is shown in the diff in lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h which had a Check() routine already for std::error_code so I added one like it for llvm::Error . Also there some were bugs in the existing code that did not deal with the old ErrorOr<> return values.  So now with Expected<> since they must be checked and the error handled, I added a TODO and a comment: “// TODO: Actually report errors helpfully” and a call something like consumeError(NameOrErr.takeError()) so the buggy code will not crash since needed to deal with the Error. Note there fixes needed to lld that goes along with this that I will commit right after this. So expect lld not to built after this commit and before the next one. llvm-svn: 266919
* [llvm-pdbdump] Print a better error message when PDB loading fails.Zachary Turner2016-04-192-14/+19
| | | | | | Differential Revision: http://reviews.llvm.org/D19234 llvm-svn: 266772
* Unbreak building llvm-pdbdump on Windows after r266595.Nico Weber2016-04-183-1/+4
| | | | llvm-svn: 266612
* [NFC] Header cleanupMehdi Amini2016-04-183-4/+1
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* Update and fix LLVM_ENABLE_MODULES:Richard Smith2016-04-161-1/+0
| | | | | | | | | | | | | | | | 1) We need to add this flag prior to adding any other, in case the user has specified a -fmodule-cache-path= flag in their custom CXXFLAGS. Such a flag causes -Werror builds to fail, and thus all config checks fail, until we add the corresponding -fmodules flag. The modules selfhost bot does this, for instance. 2) Delete module maps that were putting .cpp files into modules. 3) Enable -fmodules-local-submodule-visibility, to get proper module visibility rules applied across submodules of the same module. Disable -fmodules for C builds, since that flag is not available there. llvm-svn: 266502
* Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump ↵Kevin Enderby2016-04-062-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to produce a real error message Produce the first specific error message for a malformed Mach-O file describing the problem instead of the generic message for object_error::parse_failed of "Invalid data was encountered while parsing the file”.  Many more good error messages will follow after this first one. This is built on Lang Hames’ great work of adding the ’Error' class for structured error handling and threading Error through MachOObjectFile construction. And making createMachOObjectFile return Expected<...> . So to to get the error to the llvm-obdump tool, I changed the stack of these methods to also return Expected<...> : object::ObjectFile::createObjectFile() object::SymbolicFile::createSymbolicFile() object::createBinary() Then finally in ParseInputMachO() in MachODump.cpp the error can be reported and the specific error message can be printed in llvm-objdump and can be seen in the existing test case for the existing malformed binary but with the updated error message. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now use of errorToErrorCode() and errorOrToExpected() are used where the callers are yet to be converted. Also there some were bugs in the existing code that did not deal with the old ErrorOr<> return values. So now with Expected<> since they must be checked and the error handled, I added a TODO and a comment: “// TODO: Actually report errors helpfully” and a call something like consumeError(ObjOrErr.takeError()) so the buggy code will not crash since needed to deal with the Error. Note there is one fix also needed to lld/COFF/InputFiles.cpp that goes along with this that I will commit right after this. So expect lld not to built after this commit and before the next one. llvm-svn: 265606
* Make DIASession work if msdia*.dll isn't registered.Nico Weber2016-04-011-9/+34
| | | | | | | | | This fixes various symbolization test failures for me when I build with a hermetic VS2015 without having run the 2015 installer. http://reviews.llvm.org/D18707 llvm-svn: 265193
* Fix Clang-tidy modernize-deprecated-headers warnings in some files; other ↵Eugene Zelenko2016-03-281-10/+19
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D18469 llvm-svn: 264598
* Fix a crash in running llvm-objdump -t with an invalid Mach-O file alreadyKevin Enderby2016-03-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the test suite. While this is not really an interesting tool and option to run on a Mach-O file to show the symbol table in a generic libObject format it shouldn’t crash. The reason for the crash was in MachOObjectFile::getSymbolType() when it was calling MachOObjectFile::getSymbolSection() without checking its return value for the error case. What makes this fix require a fair bit of diffs is that the method getSymbolType() is in the class ObjectFile defined without an ErrorOr<> so I needed to add that all the sub classes.  And all of the uses needed to be updated and the return value needed to be checked for the error case. The MachOObjectFile version of getSymbolType() “can” get an error in trying to come up with the libObject’s internal SymbolRef::Type when the Mach-O symbol symbol type is an N_SECT type because the code is trying to select from the SymbolRef::ST_Data or SymbolRef::ST_Function values for the SymbolRef::Type. And it needs the Mach-O section to use isData() and isBSS to determine if it will return SymbolRef::ST_Data. One other possible fix I considered is to simply return SymbolRef::ST_Other when MachOObjectFile::getSymbolSection() returned an error. But since in the past when I did such changes that “ate an error in the libObject code” I was asked instead to push the error out of the libObject code I chose not to implement the fix this way. As currently written both the COFF and ELF versions of getSymbolType() can’t get an error. But if isReservedSectionNumber() wanted to check for the two known negative values rather than allowing all negative values or the code wanted to add the same check as in getSymbolAddress() to use getSection() and check for the error then these versions of getSymbolType() could return errors. At the end of the day the error printed now is the generic “Invalid data was encountered while parsing the file” for object_error::parse_failed. In the future when we thread Lang’s new TypedError for recoverable error handling though libObject this will improve. And where the added // Diagnostic(… comment is, it would be changed to produce and error message like “bad section index (42) for symbol at index 8” for this case. llvm-svn: 264187
* [DebugInfo] Dump CIE augmentation data as a list of hex bytesSimon Atanasyan2016-03-011-2/+7
| | | | | | | | | CIE augmentation data might contain non-printable characters. The patch prints the data as a list of hex bytes. Differential Revision: http://reviews.llvm.org/D17759 llvm-svn: 262361
* [DebugInfoPDB] Add source / line number accessors for PDB.Zachary Turner2016-02-183-3/+93
| | | | | | | This patch adds a variety of different methods to query source and line number information from PDB files. llvm-svn: 261239
* [DebugInfoPDB] A few cleanups on PDB Variant class.Zachary Turner2016-02-171-2/+4
| | | | | | | | Also implements the PDBSymbolCompilandEnv::getValue() method, which until now had been unimplemented specifically because variant did not support string values. llvm-svn: 261173
* [DebugInfoPDB] Raise getSymIndexId() up to PDBSymbolZachary Turner2016-02-171-0/+1
| | | | | | | | | | | | | Every symbol, no matter what it's tag is, supports the method getSymIndexId(). However, this was being forwarded on every concrete symbol type, so if someone had a PDBSymbol that they didn't know what type it was (or simply didn't have an instance of the concrete symbol type), they would not be able to get its index id. This patch moves the method up to PDBSymbol, so that no matter what type of object you have, you can always get its id. llvm-svn: 261153
* [DebugInfoPDB] Teach Variant to support string types.Zachary Turner2016-02-172-22/+36
| | | | | | | | | | The IDiaSymbol::getValue() method returns a variant. Until now, I had never encountered a string value, so the Variant wrapper did not support VT_BSTR. Now we have need to support string values, so this patch just adds support for one extra type to Variant. llvm-svn: 261152
* [DebugInfo] Eliminate compilation warning about used variable LSDADmitry Polukhin2016-02-051-2/+1
| | | | | | | The waring was: lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:643:20: warning: variable ‘LSDA’ set but not used llvm-svn: 259877
* [DebugInfo] Support zero-length CIE in the _eh_frame parserIgor Laevsky2016-01-271-30/+27
| | | | | | | | | | | | MCJIT emits zero-length CIE at the end of the _eh_frame section. This change ensures that parser inside DebugInfo will not crash and correctly record such cases. We are now recording DW_EH_PE_omit as a default value for FDE and LSDA encodings. Also Offset != EndAugmentationOffset assertion check will only happen if augmentation string had 'z' letter in it. Differential Revision: http://reviews.llvm.org/D16588 llvm-svn: 258931
* Remove autoconf supportChris Bieneman2016-01-265-72/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."Igor Laevsky2016-01-263-19/+186
| | | | | | | Originally this change was causing failures on windows buildbots. But those problems were fixed in r258806. llvm-svn: 258811
* [DebugInfo] Fix DWARFDebugFrame instruction operand orderingIgor Laevsky2016-01-261-6/+14
| | | | | | | | We can't rely on the evalution order of function arguments. Differential Revision: http://reviews.llvm.org/D16509 llvm-svn: 258806
* Fix instance of -Wcovered-switch-defaultReid Kleckner2016-01-131-2/+0
| | | | llvm-svn: 257665
* [readobj] Expand CodeView dumping functionalityReid Kleckner2016-01-131-26/+24
| | | | | | | | | | | | | | | | This rewrites and expands the existing codeview dumping functionality in llvm-readobj using techniques similar to those in lib/Object. This defines a number of new records and enums useful for reading memory mapped codeview sections in COFF objects. The dumper is intended as a testing tool for LLVM as it grows more codeview output capabilities. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D16104 llvm-svn: 257658
* fixing type.Mike Aizatsky2016-01-091-1/+2
| | | | llvm-svn: 257238
* llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp: Fix build in -m32. 1L is ↵NAKAMURA Takumi2016-01-091-1/+1
| | | | | | incompatible to int64_t. llvm-svn: 257237
* [llvm-symbolizer] -print-source-context-lines option to print source code ↵Mike Aizatsky2016-01-091-4/+35
| | | | | | | | around the line. Differential Revision: http://reviews.llvm.org/D15909 llvm-svn: 257236
* Fix several accidental DOS line endings in source filesDimitry Andric2016-01-032-117/+117
| | | | | | | | | | | | | | | Summary: There are a number of files in the tree which have been accidentally checked in with DOS line endings. Convert these to native line endings. There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those. Reviewers: joerg, aaron.ballman Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D15848 llvm-svn: 256707
* Remove unused constants from TypeTableBuilder.cpp.Dave Bartolomeo2015-12-241-4/+0
| | | | llvm-svn: 256389
* Fix case of path nameBill Seurer2015-12-241-1/+1
| | | | llvm-svn: 256388
* Fix CodeView library name and non-CMake buildsDave Bartolomeo2015-12-243-4/+21
| | | | llvm-svn: 256387
* LLVM CodeView libraryDave Bartolomeo2015-12-2412-2/+670
| | | | | | | | | | | | | | | | | | Summary: This diff is the initial implementation of the LLVM CodeView library. There is much more work to be done, namely a CodeView dumper and tests. This patch should help others make progress on the LLVM->CodeView debug info emission while I continue with the implementation of the dumper and tests. This library implements support for emitting debug info in the CodeView format. This phase of the implementation only includes support for CodeView type records. Clients that need to emit type records will use a class derived from TypeTableBuilder. TypeTableBuilder provides member functions for writing each kind of type record; each of these functions eventually calls the writeRecord virtual function to emit the actual bits of the record. Derived classes override writeRecord to implement the folding of duplicate records and the actual emission to the appropriate destination. LLVMCodeView provides MemoryTypeTableBuilder, which creates the table in memory. In the future, other classes derived from TypeTableBuilder will write to other destinations, such as the type stream in a PDB. The rest of the types in LLVMCodeView define the actual CodeView type records and all of the supporting enums and other types used in the type records. The TypeIndex class is of particular interest, because it is used by clients as a handle to a type in the type table. The library provides a relatively low-level interface based on the actual on-disk format of CodeView. For example, type records refer to other type records by TypeIndex, rather than by an actual pointer to the referent record. This allows clients to emit type records one at a time, rather than having to keep the entire transitive closure of type records in memory until everything has been emitted. At some point, having a higher-level interface layered on top of this one may be useful for debuggers and other tools that want a more holistic view of the debug info. The lower-level interface should be sufficient for compilers and linkers to do the debug info manipulation that they need to do efficiently. Reviewers: rnk, majnemer Subscribers: silvas, rnk, jevinskie, llvm-commits Differential Revision: http://reviews.llvm.org/D14961 llvm-svn: 256385
* [Symbolize] Improve the ownership of parsed objects.Alexey Samsonov2015-12-181-46/+45
| | | | | | | | | | | | | | | | | | This code changes the way Symbolize handles parsed binaries: now parsed OwningBinary<Binary> is not broken into (binary, memory buffer) pair, and is just stored as-is in a cache. ObjectFile components of Mach-O universal binaries are also stored explicitly in a separate cache. Additionally, this change: * simplifies the code that parses/caches binaries: it's now done in a single place, not three different functions. * makes flush() method behave as expected, and actually clear the cached parsed binaries and objects. * fixes a dangling pointer issue described in http://reviews.llvm.org/D15638 llvm-svn: 256041
* Revert "Improve DWARFDebugFrame::parse to also handle __eh_frame."Pete Cooper2015-12-183-186/+19
| | | | | | | | This reverts commit r256008. Its breaking multiple buildbots, although works for me locally. llvm-svn: 256013
* Improve DWARFDebugFrame::parse to also handle __eh_frame.Pete Cooper2015-12-183-19/+186
| | | | | | | | | | | | | | | LLVM MC has single methods which can handle the output of EH frame and DWARF CIE's and FDE's. This code improves DWARFDebugFrame::parse to do the same for parsing. This also allows llvm-objdump to support the --dwarf=frames option which objdump supports. This option dumps the .eh_frame section using the new code in DWARFDebugFrame::parse. http://reviews.llvm.org/D15535 Reviewed by Rafael Espindola. llvm-svn: 256008
* Test commitDave Bartolomeo2015-12-171-1/+1
| | | | llvm-svn: 255926
* [llvm-dwp] Retrieve the DWOID from the CU for the cu_index entryDavid Blaikie2015-12-041-2/+8
| | | | llvm-svn: 254731
* dwarfdump: Correctly indentify the indicies for DWP recordsDavid Blaikie2015-12-031-1/+1
| | | | | | The indicies are one-based, not zero-based, per the spec. llvm-svn: 254626
* [llvm-dwp] Don't rely on implicit move assignment operator (MSVC won't ↵David Blaikie2015-12-021-2/+7
| | | | | | synthesize one) llvm-svn: 254492
OpenPOWER on IntegriCloud