summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* [pdb] Write the module info and symbol record streams.Zachary Turner2017-03-154-66/+184
| | | | | | | | | | | Previously we did not have support for writing detailed module information for each module, as well as the symbol records. This patch adds support for this, and in doing so enables the ability to construct minimal PDBs from just a few lines of YAML. A test is added to illustrate this functionality. llvm-svn: 297900
* NFC: Corrects comments that were supposed to go in with earlier commit.Adrian McCarthy2017-03-151-4/+5
| | | | llvm-svn: 297887
* Introduce NativeEnumModules and NativeCompilandSymbolAdrian McCarthy2017-03-154-2/+115
| | | | | | | | | | | Together, these allow lldb-pdbdump to list all the modules from a PDB using a native reader (rather than DIA). Note that I'll probably be specializing NativeRawSymbol in a subsequent patch. Differential Revision: https://reviews.llvm.org/D30956 llvm-svn: 297883
* Fix llvm-symbolizer to navigate both DW_AT_abstract_origin and ↵David Blaikie2017-03-131-22/+10
| | | | | | | | | DW_AT_specification in a single chain In a recent refactoring (r291959) this regressed to only following one or the other, not both, in a single chain. llvm-svn: 297676
* [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB.Zachary Turner2017-03-132-0/+53
| | | | | | | | Previously we could round-trip type records from PDB -> Yaml -> PDB, but for symbols we could only go from PDB -> Yaml. This completes the round-tripping for symbols as well. llvm-svn: 297625
* [DWARFv5] Update definitions to match published spec.Paul Robinson2017-03-062-6/+26
| | | | | | | | | | | | | Some late additions to DWARF v5 were not in Dwarf.def; also one form was redefined. Add the new cases to relevant switches in different parts of LLVM. Replace DW_FORM_ref_sup with DW_FORM_ref_sup[4,8]. I did not add support for DW_FORM_strx3/addrx3 other that defining the constants. We don't have any infrastructure to support these. Differential Revision: http://reviews.llvm.org/D30664 llvm-svn: 297085
* [Support] Move Stream library from MSF -> Support.Zachary Turner2017-03-0234-257/+44
| | | | | | | | | | After several smaller patches to get most of the core improvements finished up, this patch is a straight move and header fixup of the source. Differential Revision: https://reviews.llvm.org/D30266 llvm-svn: 296810
* [DWARF] Print leading zeros in type signaturePaul Robinson2017-03-011-2/+2
| | | | llvm-svn: 296663
* [DebugInfo] Fix some Include What You Use warnings; other minor fixes (NFC).Eugene Zelenko2017-03-0112-76/+126
| | | | llvm-svn: 296559
* [DWARFv5] Emit new unit header format.Paul Robinson2017-02-283-6/+17
| | | | | | | | | Requesting DWARF v5 will now get you the new compile-unit and type-unit headers. llvm-dwarfdump will also recognize them. Differential Revision: http://reviews.llvm.org/D30206 llvm-svn: 296514
* Fix -Wcovered-switch-default warning.Zachary Turner2017-02-281-2/+0
| | | | llvm-svn: 296501
* [PDB] Add BinaryStreamError.Zachary Turner2017-02-285-25/+76
| | | | | | | This migrates the stream code away from MSFError to using its own custom Error class. llvm-svn: 296494
* [PDB] Make streams carry their own endianness.Zachary Turner2017-02-2817-91/+79
| | | | | | | | | | | | | Before the endianness was specified on each call to read or write of the StreamReader / StreamWriter, but in practice it's extremely rare for streams to have data encoded in multiple different endiannesses, so we should optimize for the 99% use case. This makes the code cleaner and more general, but otherwise has NFC. llvm-svn: 296415
* [DebugInfo] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-02-279-46/+83
| | | | | | other minor fixes (NFC). llvm-svn: 296413
* Remove some code accidentally left in.Zachary Turner2017-02-271-2/+0
| | | | llvm-svn: 296407
* [PDB] Partial resubmit of r296215, which improved PDB Stream Library.Zachary Turner2017-02-2729-202/+185
| | | | | | | | | | | | | | | | | This was reverted because it was breaking some builds, and because of incorrect error code usage. Since the CL was large and contained many different things, I'm resubmitting it in pieces. This portion is NFC, and consists of: 1) Renaming classes to follow a consistent naming convention. 2) Fixing the const-ness of the interface methods. 3) Adding detailed doxygen comments. 4) Fixing a few instances of passing `const BinaryStream& X`. These are now passed as `BinaryStreamRef X`. llvm-svn: 296394
* Revert r296215, "[PDB] General improvements to Stream library." and followings.NAKAMURA Takumi2017-02-2530-310/+284
| | | | | | | | | | | | | | | | | r296215, "[PDB] General improvements to Stream library." r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily." r296220, "Re-enable BinaryStreamTest.StreamReaderObject." r296244, "[PDB] Disable some tests that are breaking bots." r296249, "Add static_cast to silence -Wc++11-narrowing." std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission. (Seek discussions around llvm/xray.) I could substitute s/no_buffer_space/others/g, but I revert whole them ATM. Could we define and use LLVM errors there? llvm-svn: 296258
* [DebugInfo] Skip implicit_const attributes when dumping .debug_info. NFC.Victor Leschuk2017-02-251-0/+6
| | | | | | | | | | | When dumping .debug_info section we loop through all attributes mentioned in .debug_abbrev section and dump values using DWARFFormValue::extractValue(). We need to skip implicit_const attributes here as their values are not really located in .debug_info but directly in .debug_abbrev. This patch fixes triggered assert() in DWARFFormValue::extractValue() caused by trying to access implicit_const values from .debug_info. llvm-svn: 296253
* [PDB] General improvements to Stream library.Zachary Turner2017-02-2530-284/+310
| | | | | | | | | | | | | | | This adds various new functionality and cleanup surrounding the use of the Stream library. Major changes include: * Renaming of all classes for more consistency / meaningfulness * Addition of some new methods for reading multiple values at once. * Full suite of unit tests for reader / writer functionality. * Full set of doxygen comments for all classes. * Streams now store their own endianness. * Fixed some bugs in a few of the classes that were discovered by the unit tests. llvm-svn: 296215
* [PDB] Rename Stream related source files.Zachary Turner2017-02-2532-50/+50
| | | | | | | | | | | | | | This is part of a larger effort to get the Stream code moved up to Support. I don't want to do it in one large patch, in part because the changes are so big that it will treat everything as file deletions and add, losing history in the process. Aside from that though, it's just a good idea in general to make small changes. So this change only changes the names of the Stream related source files, and applies necessary source fix ups. llvm-svn: 296211
* Implement some methods for NativeRawSymbolAdrian McCarthy2017-02-243-6/+24
| | | | | | | | | | | This allows the ability to call IPDBSession::getGlobalScope with a NativeSession and to then query it for some basic fields from the PDB's InfoStream. Note that the symbols now have non-const references back to the Session so that NativeRawSymbol can access the PDBFile through the Session. Differential Revision: https://reviews.llvm.org/D30314 llvm-svn: 296049
* Don't assume little endian in StreamReader / StreamWriter.Zachary Turner2017-02-1815-152/+75
| | | | | | | In an effort to generalize this so it can be used by more than just PDB code, we shouldn't assume little endian. llvm-svn: 295525
* [pdb] Add the ability to resolve TypeServer PDBs.Zachary Turner2017-02-169-9/+213
| | | | | | | | | | | | | | Some PDBs or object files can contain references to other PDBs where the real type information lives. When this happens, all type indices in the original PDB are meaningless because their records are not there. With this patch we add the ability to pull type info from those secondary PDBs. Differential Revision: https://reviews.llvm.org/D29973 llvm-svn: 295382
* Add an additional set of braces to deal with subobject initialization.Eric Christopher2017-02-101-1/+1
| | | | llvm-svn: 294674
* Fix build break from r294633.Adrian McCarthy2017-02-091-3/+3
| | | | llvm-svn: 294642
* Introduce NativeRawSymbol for PDB reading.Adrian McCarthy2017-02-092-0/+701
| | | | | | | | | | This is a stub for a new concrete implementation of IPDBRawSymbol. Nothing uses this uses this implementation yet. My plan is to locally switch lldb-pdbdump from the DIA reader to the Native one and flesh out the implementations of these method stubs in the order they're needed. llvm-svn: 294633
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings in ↵Eugene Zelenko2017-02-092-17/+38
| | | | | | | | SubtargetFeature; other minor fixes (NFC). Same changes in files affected by reduced SubtargetFeature.h dependencies. llvm-svn: 294548
* Get function start line number from DWARF infoDavid Blaikie2017-02-063-12/+35
| | | | | | | | | | | | | | | DWARF info contains info about the line number at which a function starts (DW_AT_decl_line). This patch creates a function to look up the start line number for a function, and returns it in DILineInfo when looking up debug info for a particular address. Patch by Simon Que! Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D27962 llvm-svn: 294231
* Properly parse the TypeServer2 record.Zachary Turner2017-02-036-25/+57
| | | | llvm-svn: 294046
* Re-submit r293820: Return Error instead of bool from mergeTypeStreams().Rui Ueyama2017-02-021-17/+21
| | | | llvm-svn: 293847
* Revert r293820: Return Error instead of bool from mergeTypeStreams().Rui Ueyama2017-02-011-21/+17
| | | | | | It broke buildbots. llvm-svn: 293824
* Return Error instead of bool from mergeTypeStreams().Rui Ueyama2017-02-011-17/+21
| | | | | | | | | | Previously, mergeTypeStreams returns only true or false, so it was impossible to know the reason if it failed. This patch changes the function signature so that it returns an Error object. Differential Revision: https://reviews.llvm.org/D29362 llvm-svn: 293820
* [pdb] Add a new command for analyzing hash collisions.Zachary Turner2017-02-011-0/+4
| | | | | | | | | | This introduces the `analyze` subcommand. For now there is only one option, to analyze hash collisions in the type streams. In the future, however, we could add many more things here, such as performing size analyses, compacting, and statistics about the type of records etc. llvm-svn: 293795
* Add a verbose/human readable mode to llvm-symbolizer to investigate ↵David Blaikie2017-01-311-2/+10
| | | | | | | | | | discriminators and other line table/backtrace features Patch by Simon Que! Differential Revision: https://reviews.llvm.org/D29094 llvm-svn: 293697
* Cleanup dump() functions.Matthias Braun2017-01-281-1/+1
| | | | | | | | | | | | | | | | | | We had various variants of defining dump() functions in LLVM. Normalize them (this should just consistently implement the things discussed in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html For reference: - Public headers should just declare the dump() method but not use LLVM_DUMP_METHOD or #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - The definition of a dump method should look like this: #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MyClass::dump() { // print stuff to dbgs()... } #endif llvm-svn: 293359
* NFC: Rename PDB_ReaderType::Raw to Native for consistency with the ↵Adrian McCarthy2017-01-271-2/+2
| | | | | | NativeSession rename. llvm-svn: 293235
* NFC: Rename (PDB) RawSession to NativeSessionAdrian McCarthy2017-01-2526-176/+188
| | | | | | | | This eliminates one overload on the term Raw. Differential Revision: https://reviews.llvm.org/D29098 llvm-svn: 293104
* [pdb] Correctly parse the hash adjusters table from TPI stream.Zachary Turner2017-01-251-9/+6
| | | | | | | | | | | | | This is not a list of pairs, it is a hash table data structure. We now correctly parse this out and dump it from llvm-pdbdump. We still need to understand the conditions that lead to a type getting an entry in the hash adjuster table. That will be done in a followup investigation / patch. Differential Revision: https://reviews.llvm.org/D29090 llvm-svn: 293090
* [pdb] Write the Named Stream mapping to Yaml and binary.Zachary Turner2017-01-204-12/+47
| | | | | | Differential Revision: https://reviews.llvm.org/D28919 llvm-svn: 292665
* [pdb] Merge NamedStreamMapBuilder and NamedStreamMap.Zachary Turner2017-01-206-71/+69
| | | | | | | | | | | While the builder pattern has proven useful for certain other larger types, in this case it was hampering the ability to use the data structure, as for runtime access we need a map that we can efficiently read from and write to. So the two are merged into a single data structure that can efficiently be read to, written from, deserialized from bytes, and serialized to bytes. llvm-svn: 292664
* [PDB] Rename some files to be more intuitive.Zachary Turner2017-01-208-44/+44
| | | | llvm-svn: 292663
* [DWARF] [ObjectYAML] Adding APIs for unittestingChris Bieneman2017-01-201-34/+46
| | | | | | | | | | | | Summary: This patch adds some new APIs to enable using the YAML DWARF representation in unit tests. The most basic new API is DWARFYAML::EmitDebugSections which converts a YAML string into a series of owned MemoryBuffer objects stored in a StringMap. The string map can then be used to construct a DWARFContext for parsing in place of an ObjectFile. Reviewers: dblaikie, clayborg Subscribers: mgorny, fhahn, jgosnell, aprantl, llvm-commits Differential Revision: https://reviews.llvm.org/D28828 llvm-svn: 292634
* Fix a few more build errors.Zachary Turner2017-01-191-0/+2
| | | | llvm-svn: 292538
* Fix incorrectly formed assert statement.Zachary Turner2017-01-191-1/+1
| | | | llvm-svn: 292537
* [pdb] Add HashTable data structure.Zachary Turner2017-01-194-170/+331
| | | | | | | | | | | | | | | | This was being parsed / serialized ad-hoc inside the code for a specific PDB stream. But this data structure is used in multiple ways / places within the PDB format. To be able to re-use it we need to raise this code out and make it more generic. In doing so, a number of bugs are fixed in the original implementation, and support is added for growing the hash table and deleting items from the hash table, which had either been omitted or incorrect implemented in the initial version. Differential Revision: https://reviews.llvm.org/D28715 llvm-svn: 292535
* PDB: Add a class to create the /names stream contents.Rui Ueyama2017-01-153-8/+105
| | | | | | | | | | This patch adds a new class NameHashTableBuilder which creates /names streams. This patch contains a test to confirm that a stream created by NameHashTableBuilder can be read by NameHashTable reader class. Differential Revision: https://reviews.llvm.org/D28707 llvm-svn: 292040
* Add a variant of DWARFDie::find() and DWARFDie::findRecursively() that takes ↵Greg Clayton2017-01-132-12/+33
| | | | | | | | | | a llvm::ArrayRef<dwarf::Attribute>. This allows us efficiently look for more than one attribute, something that is quite common in DWARF consumption. Differential Revision: https://reviews.llvm.org/D28704 llvm-svn: 291967
* Cleanup how DWARFDie attributes are accessed and decoded.Greg Clayton2017-01-134-89/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed all DWARFDie::getAttributeValueAs*() calls. Renamed: Optional<DWARFFormValue> DWARFDie::getAttributeValue(dwarf::Attribute); To: Optional<DWARFFormValue> DWARFDie::find(dwarf::Attribute); Added: Optional<DWARFFormValue> DWARFDie::findRecursively(dwarf::Attribute); All decoding of Optional<DWARFFormValue> values are now done using the dwarf::to*() functions from DWARFFormValue.h: Old code: auto DeclLine = DWARFDie.getAttributeValueAsSignedConstant(DW_AT_decl_line).getValueOr(0); New code: auto DeclLine = toUnsigned(DWARFDie.find(DW_AT_decl_line), 0); This composition helps us since we can now easily do: auto DeclLine = toUnsigned(DWARFDie.findRecursively(DW_AT_decl_line), 0); This allows us to easily find attribute values in the current DIE only (the first new code above) or in any DW_AT_abstract_origin or DW_AT_specification Dies using the line above. Note that the code line length is shorter and more concise. Differential Revision: https://reviews.llvm.org/D28581 llvm-svn: 291959
* Apply clang-tidy's performance-unnecessary-value-param to LLVM.Benjamin Kramer2017-01-131-1/+1
| | | | | | | With some minor manual fixes for using function_ref instead of std::function. No functional change intended. llvm-svn: 291904
* Add the ability to iterate across all attributes in a DIE.Greg Clayton2017-01-132-1/+53
| | | | | | Differential Revision: https://reviews.llvm.org/D28386 llvm-svn: 291861
OpenPOWER on IntegriCloud