summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* [codeview] Fix buggy BeginIndexMapSize assertionReid Kleckner2017-03-291-13/+12
| | | | | | | | | | | This assert is just trying to test that processing each record adds exactly one entry to the index map. The assert logic was wrong when the first record in the type stream was a field list. I've simplified the code by moving the LF_FIELDLIST-specific logic into the callback for that record type. llvm-svn: 299035
* Re-land: "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"Adrian McCarthy2017-03-294-34/+83
| | | | | | | | | | | | | | This should work on all platforms now that r299006 has landed. Tested locally on Windows and Linux. This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Original Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 299019
* [PDB] Split item and type records when merging type streamsReid Kleckner2017-03-241-53/+87
| | | | | | | | | | | | Summary: MSVC does this when producing a PDB. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31316 llvm-svn: 298717
* [PDB] Use two DBs when dumping the IPI streamReid Kleckner2017-03-231-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When dumping these records from an object file section, we should use only one type database. However, when dumping from a PDB, we should use two: one for the type stream and one for the IPI stream. Certain type records that normally live in the .debug$T object file section get moved over to the IPI stream of the PDB file and they get new indices. So far, I've noticed that the MSVC linker always moves these records into IPI: - LF_FUNC_ID - LF_MFUNC_ID - LF_STRING_ID - LF_SUBSTR_LIST - LF_BUILDINFO - LF_UDT_MOD_SRC_LINE These records have index fields that can point into TPI or IPI. In particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID records to describe compilation command lines. I've modified the dumper to have an optional pointer to the item DB, and to do type name lookup of these fields in that DB. See printItemIndex. The result is that our pdbdump-headers.test is more faithful to the PDB contents and the output is less confusing. Reviewers: ruiu Subscribers: amccarth, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D31309 llvm-svn: 298649
* Somehow this still breaks because of ANSI color codes in test output on Linux.Adrian McCarthy2017-03-234-83/+34
| | | | | | | | | | Reverting until I can figure out the root cause. Revert "Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]" This reverts commit f461a70cc376f0f91c8b4917be79479cc86330a5. llvm-svn: 298626
* Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-234-34/+83
| | | | | | | | | | | | | | The new test should pass on all platforms now that llvm-pdbdump has the `-color-output` option. This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Original Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 298623
* [codeview] Move type index remapping logic to type mergerReid Kleckner2017-03-233-248/+219
| | | | | | | | | | | | | | | | | | | | | | Summary: This removes the 'remapTypeIndices' method on every TypeRecord class. My original idea was that this would be the beginning of some kind of generic entry point that would enumerate all of the TypeIndices inside of a TypeRecord, so that we could write generic graph algorithms for them without duplicating the knowledge of which fields are type index fields everywhere. This never happened, and nothing else uses this method. I need to change the API to deal with merging into IPI streams, so let's move it into the file that uses it first. Reviewers: zturner, ruiu Reviewed By: zturner, ruiu Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D31267 llvm-svn: 298564
* [codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLISTReid Kleckner2017-03-224-0/+43
| | | | | | | They are structurally the same, but now we need to distinguish them because one record lives in the IPI stream and the other lives in TPI. llvm-svn: 298474
* Revert "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"Zachary Turner2017-03-174-83/+34
| | | | | | | For some reason this is causing ANSI color codes to be printed even when run through FileCheck. llvm-svn: 298026
* [pdb] Fix an uninitialized read, and add a test for it.Zachary Turner2017-03-171-6/+3
| | | | | | | | | | | | | | | | | | | This was originally reported in pr32249, uncovered by PTVS-Studio. There was no code coverage for this path because it was difficult to construct odd-case PDB files that were not generated by cl. Now that we can write construct minimal PDB files from YAML, it's easy to construct fragments that generate whatever we want. In this patch I add a test that creates 2 type records. One with a unique name, and one without. I verify that we can go from PDB to Yaml with no errors. In a future patch I'd like to add something like llvm-pdbdump raw -lookup-type that will just dump one record and nothing else, which should make it a bit cleaner to find this kind of thing. llvm-svn: 298017
* [PDB] It is not an error getting the "Invalid" Annotation opcode.Zachary Turner2017-03-171-2/+2
| | | | | | | The linker can insert invalid opcodes to indicate padding bytes, and we should not fail in this case. llvm-svn: 298016
* Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-164-34/+83
| | | | | | | | | | | This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 298005
* Silence -Wcovered-switch-default warning.Zachary Turner2017-03-161-5/+9
| | | | llvm-svn: 297990
* [PDB] Add support for parsing Flags from PDB Stream.Zachary Turner2017-03-162-2/+45
| | | | | | | | | | | | | | | | | | | This was discovered when running `llvm-pdbdump diff` against two files, the second of which was generated by running the first one through pdb2yaml and then yaml2pdb. The second one was missing some bytes from the PDB Stream, and tracking this down showed that at the end of the PDB Stream were some additional bytes that we were ignoring. Looking back to the reference code, these seem to specify some additional flags that indicate whether the PDB supports various optional features. This patch adds support for reading, writing, and round-tripping these flags through YAML and the raw dumper, and updates the tests accordingly. llvm-svn: 297984
* [llvm-pdbdump] Add support for diffing the PDB Stream.Zachary Turner2017-03-162-1/+14
| | | | | | | | | | In doing so I discovered that we completely ignore some bytes of the PDB Stream after we "finish" loading it. These bytes seem to specify some additional information about what kind of data is present in the PDB. A subsequent patch will add code to read in those fields and store their values. llvm-svn: 297983
* [llvm-pdbdump] Add support for diffing the String Table.Zachary Turner2017-03-151-1/+12
| | | | llvm-svn: 297901
* [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
OpenPOWER on IntegriCloud