summaryrefslogtreecommitdiffstats
path: root/lldb/lit/SymbolFile/NativePDB/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Re-land "[test] Split LLDB tests into API, Shell & Unit"Jonas Devlieghere2019-10-0920-1448/+0
| | | | | | | The original patch got reverted because it broke `check-lldb` on a clean build. This fixes that. llvm-svn: 374201
* Revert [test] Split LLDB tests into API, Shell & UnitAdrian Prantl2019-10-0920-0/+1448
| | | | | | | | as it appears to have broken check-lldb. This reverts r374184 (git commit 22314179f0660c172514b397060fd8f34b586e82) llvm-svn: 374187
* [test] Split LLDB tests into API, Shell & UnitJonas Devlieghere2019-10-0920-1448/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLDB has three major testing strategies: unit tests, tests that exercise the SB API though dotest.py and what we currently call lit tests. The later is rather confusing as we're now using lit as the driver for all three types of tests. As most of this grew organically, the directory structure in the LLDB repository doesn't really make this clear. The 'lit' tests are part of the root and among these tests there's a Unit and Suite folder for the unit and dotest-tests. This layout makes it impossible to run just the lit tests. This patch changes the directory layout to match the 3 testing strategies, each with their own directory and their own configuration file. This means there are now 3 directories under lit with 3 corresponding targets: - API (check-lldb-api): Test exercising the SB API. - Shell (check-lldb-shell): Test exercising command line utilities. - Unit (check-lldb-unit): Unit tests. Finally, there's still the `check-lldb` target that runs all three test suites. Finally, this also renames the lit folder to `test` to match the LLVM repository layout. Differential revision: https://reviews.llvm.org/D68606 llvm-svn: 374184
* Changing representation of .cv_def_range directives in Codeview debug info ↵Nilanjana Basu2019-08-051-2/+2
| | | | | | assembly format for better readability llvm-svn: 367867
* Revert "Changing representation of .cv_def_range directives in Codeview ↵Nilanjana Basu2019-08-051-2/+2
| | | | | | | | debug info assembly format for better readability" This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881. llvm-svn: 367861
* Changing representation of .cv_def_range directives in Codeview debug info ↵Nilanjana Basu2019-08-051-2/+2
| | | | | | assembly format for better readability llvm-svn: 367850
* [NativePDB] Support member function types in PdbAstBuilderAleksandr Urakov2019-05-131-0/+8
| | | | | | | | | | | | | | | | | Summary: This patch implements missing case in PdbAstBuilder::CreateType for LF_MFUNCTION. This is necessary, for example, in stack unwinding of struct methods. Reviewers: amccarth, aleksandr.urakov Reviewed By: amccarth Subscribers: abidh, teemperor, lldb-commits, leonid.mashinskiy Differential Revision: https://reviews.llvm.org/D61128 llvm-svn: 360569
* [NativePDB] Add anonymous namespaces supportAleksandr Urakov2019-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds anonymous namespaces support to the native PDB plugin. I had to reference from the main function variables of the types that are inside of the anonymous namespace to include them in debug info. Without the references they are not included. I think it's because they are static, then are visible only in the current translation unit, so they are not needed without any references to them. There is also the problem case with variables of types that are nested in template structs. For now I've left FIXME in the test because this case is not related to the change. Reviewers: zturner, asmith, labath, stella.stamenova, amccarth Reviewed By: amccarth Subscribers: zloyrobot, aprantl, teemperor, lldb-commits, leonid.mashinskiy Tags: #lldb Differential Revision: https://reviews.llvm.org/D60817 llvm-svn: 358873
* [NativePDB] Process virtual bases in the correct orderAleksandr Urakov2019-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch makes virtual bases to be added in the correct order to the bases list. It is important because `VTableContext` (`MicrosoftVTableContext` in our case) uses then the order of virtual bases in the list to restore the virtual table indexes. These indexes are used then to resolve the layout of the virtual bases. We haven't enough information about offsets of virtual bases regarding to the object (moreover, in a common case we can't rely on such information, see the example here: https://reviews.llvm.org/D53506#1272306 ), but there should be enough information to restore the layout of the virtual bases from the indexes in runtime. After D53506 this information is used whenever possible, so there should be no problems with virtual bases' fields reading. Reviewers: zturner, rnk, stella.stamenova Subscribers: abidh, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D56904 llvm-svn: 353806
* [NativePDB] Add basic support of methods recostruction in ASTAleksandr Urakov2019-01-291-0/+5
| | | | | | | | | | | | | | | | | | Summary: This patch adds the basic support of methods reconstruction by native PDB plugin. It contains only most obvious changes (it processes LF_ONEMETHOD and LF_METHOD records), some things still remain unsolved: - mangled names retrieving; - support of template methods. Reviewers: zturner, labath, lemo, stella.stamenova Reviewed by: zturner Differential Revision: https://reviews.llvm.org/D56126 llvm-svn: 352464
* [NativePDB] Fix setting breakpoint by file and line.Zachary Turner2019-01-022-0/+3
| | | | | | | | | | | | | | | | | | | There were several problems preventing this from working. The first is that when the PDB had an absolute path to the main source file, we would construct an invalid path by prepending the compilation directory to it anyway. So we needed to check if the path is already absolute first. Second, LLDB assumes that the zero'th item in the support file list is the main compilation unit. We were respecting this requirement, but LLDB *also* requires that file to appear somewhere in the list starting from index 1 as well. So the main compilation file should appear in the support file list twice. And when parsing a line table, it expects the LineEntry records to be constructed using the 1-based index. With these two fixes we can now set breakpoints by file and line using the native PDB reader. llvm-svn: 350240
* [NativePDB] Create VarDecls for global variables.Zachary Turner2018-12-201-0/+2
| | | | | | | | | | Previously we would create these for local variables but not for global variables. Also updated existing tests which created global variables to check for them in the resulting AST. llvm-svn: 349854
* [NativePDB] Correctly reconstruct DeclContext for nested enums.Zachary Turner2018-12-181-0/+1
| | | | | | | | | | | | We reconstruct the AST hierarchy by trying to hack up a mangled name for the parent type using the child type's mangled name. This was failing for enums because their tag type is represented with two letters ("W4") instead of one letter ("T", "U", etc) as it is with classes, structs, and unions. After accounting for this we can now correctly determine when an enum is nested inside of a namespace or a class. llvm-svn: 349565
* [NativePDB] Add support for local variables.Zachary Turner2018-12-131-0/+32
| | | | | | | | | This patch adds support for parsing and evaluating local variables. using the native pdb plugin. Differential Revision: https://reviews.llvm.org/D55575 llvm-svn: 349067
* [NativePDB] Reconstruct function declarations from debug info.Zachary Turner2018-12-072-0/+8
| | | | | | | | | | | | Previously we would create an lldb::Function object for each function parsed, but we would not add these to the clang AST. This is a first step towards getting local variable support working, as we first need an AST decl so that when we create local variable entries, they have the proper DeclContext. Differential Revision: https://reviews.llvm.org/D55384 llvm-svn: 348631
* [NativePDB] Add support for S_CONSTANT records.Zachary Turner2018-11-132-0/+996
| | | | | | | | | | | | | | | | | clang-cl does not emit these, but MSVC does, so we need to be able to handle them. Because clang-cl does not generate them, it was a bit hard to write a test. So what I had to do was get an PDB file with some S_CONSTANT records in using cl and link, dump it using llvm-pdbutil dump -globals -sym-data to get the bytes of the records, generate the same object file using clang-cl but with -S to emit an assembly file, and replace all the S_LDATA32 records with the bytes of the S_CONSTANT records. This way, we can compile the file using llvm-mc and link it with lld-link. Differential Revision: https://reviews.llvm.org/D54452 llvm-svn: 346787
* [NativePDB] Improved support for nested type reconstruction.Zachary Turner2018-11-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a previous patch, we pre-processed the TPI stream in order to build the reverse mapping from nested type -> parent type so that we could accurately reconstruct a DeclContext hierarchy. However, there were some issues. An LF_NESTTYPE record is really just a typedef, so although it happens to be used to indicate the name of the nested type and referring to the global record which defines the type, it is also used for every other kind of nested typedef. When we rebuild the DeclContext hierarchy, we want it to be as accurate as possible, which means that if we have something like: struct A { struct B {}; using C = B; }; We don't want to create two CXXRecordDecls in the AST each with the exact same definition. We just want to create one for B and then define C as an alias to B. Previously, however, it would not be able to distinguish between the two cases and it would treat A::B and A::C as being two classes each with separate definitions. We address the first half of improving the pre-processing logic so that only actual definitions are treated this way. Later, in a followup patch, we can handle the case of nested typedefs since we're already going to be enumerating the field list anyway and this patch introduces the general framework for distinguishing between the two cases. Differential Revision: https://reviews.llvm.org/D54357 llvm-svn: 346786
* [NativePDB] Add support for bitfield records.Zachary Turner2018-11-091-0/+5
| | | | | | | | | Bitfields are represented as LF_MEMBER records whose TypeIndex points to an LF_BITFIELD record that describes the bit width, bit offset, and underlying type of the bitfield. All we need to do is resolve these when resolving record types. llvm-svn: 346511
* Resubmit "Fix bug in PE/COFF plugin."Zachary Turner2018-11-091-0/+3
| | | | | | | | | | The original commit was actually 2 unrelated bug fixes, but it turns out the second bug fix wasn't quite correct, so the entire patch was reverted. Resubmitting this half of the patch by itself, then will follow up with a new patch which fixes the rest of the issue in a more appropriate way. llvm-svn: 346505
* Revert "Fix bug in PE/COFF plugin and ValueObjectVariable."Davide Italiano2018-11-081-3/+0
| | | | | | It breaks some tests on MacOS. llvm-svn: 346444
* Fix bug in PE/COFF plugin and ValueObjectVariable.Zachary Turner2018-11-081-0/+3
| | | | | | | | | | | | | | | | | | There are two bugs here. The first is that MSVC and clang-cl emit their bss section under the name '.data' instead of '.bss' but with the size and file offset set to 0. ObjectFilePECOFF didn't handle this, and would only recognize a section as bss if it was actually called '.bss'. The effect of this is that if we tried to print the value of a variable that lived in BSS we would fail. The second bug is that ValueObjectVariable was only returning the forward type, which is insufficient to print the value of an enum. So we bump this up to the layout type. Differential Revision: https://reviews.llvm.org/D54241 llvm-svn: 346430
* [NativePDB] Higher fidelity reconstruction of AST from Debug Info.Zachary Turner2018-11-083-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | In order to accurately put a type into the correct location in the AST we construct from debug info, we need to be able to determine what DeclContext (namespace, global, nested class, etc) that it goes into. PDB doesn't contain this mapping. It does, however, contain the reverse mapping. That is, for a given class type T, you can determine all classes Q1, Q2, ..., Qn that are nested inside of T. We need to know, for a given class type Q, what type T is it nested inside of. This patch builds this map as a pre-processing step when we first load the PDB by scanning every type. Initial tests show that while this can be slow in debug builds of LLDB, it is quite fast in release builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen once). Furthermore, having this pre-processing step in place allows us to repurpose it for building up other kinds of indexing to it down the line. For the time being, this gives us very accurate reconstruction of the DeclContext hierarchy. Differential Revision: https://reviews.llvm.org/D54216 llvm-svn: 346429
* [NativePDB] Get LLDB types from PDB function types.Zachary Turner2018-11-013-0/+89
| | | | | | | | | | | | | | This adds basic support for getting function signature types into LLDB's type system, including into clang's AST. There are a few edge cases which are not correctly handled, mostly dealing with nested classes, but this isn't specific to functions and apply equally to variable types. Note that no attempt has been made yet to deal with member function types, which will happen in subsequent patches. Differential Revision: https://reviews.llvm.org/D53951 llvm-svn: 345848
* [NativePDB] Add support for dumping global variables of class type.Zachary Turner2018-10-301-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Previous patches added support for dumping global variables of primitive types, so we now do the same for class types. For the most part, everything just worked, there was only one minor bug needing fixed, which was that for variables of modified types (e.g. const, volatile, etc) we can't resolve the forward decl in CreateAndCacheType because the PdbSymUid must point to the LF_MODIFIER which must point to the forward decl. So when it comes time to call CompleteType, an assert was firing because we expected to get a class, struct, union, or enum, but we were getting an LF_MODIFIER instead. The other issue is that one the newly added tests is for an array member, which was not yet supported, so we add support for that now in this patch. There's probably room for other interesting layout test cases here, but this at least should test the basics. Differential Revision: https://reviews.llvm.org/D53822 llvm-svn: 345629
* [NativePDB] Add the ability to dump dump global variables.Zachary Turner2018-10-261-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | LLDB has the ability to display global variables, even without a running process, via the target variable command. This is because global variables are linker initialized, so their values are embedded directly into the executables. This gives us great power for testing native PDB functionality in a cross-platform manner, because we don't actually need a running process. We can just create a target using an EXE file, and display global variables. And global variables can have arbitrarily complex types, so in theory we can fully exercise the type system, record layout, and data formatters for native PDB files and PE/COFF executables on any host platform, as long as our type does not require a dynamic initializer. This patch adds basic support for finding variables by name, and adds an exhaustive test for fundamental data types and pointers / references to fundamental data types. Subsequent patches will extend this to typedefs, classes, pointers to functions, and other cases. Differential Revision: https://reviews.llvm.org/D53731 llvm-svn: 345373
* [NativePDB] Add basic support for tag types to the native pdb plugin.Zachary Turner2018-10-231-0/+8
| | | | | | | | | | | | | | | | | This adds support to LLDB for named types (class, struct, union, and enum). This is true cross platform support, and hits the PDB file directly without a dependency on Windows. Tests are added which compile a program with certain interesting types and then use load the target in LLDB and use "type lookup -- <TypeName>" to dump the layout of the type in LLDB without a running process. Currently only fields are parsed -- we do not parse methods. Also we don't deal with bitfields or virtual bases correctly. Those will make good followups. Differential Revision: https://reviews.llvm.org/D53511 llvm-svn: 345047
* Resubmit "Add SymbolFileNativePDB plugin."Zachary Turner2018-10-123-0/+11
| | | | | | | | | | This was originally reverted due to some test failures on Linux. Those problems turned out to require several additional patches to lld and clang in order to fix, which have since been submitted. This patch is resubmitted unchanged. All tests now pass on both Linux and Windows. llvm-svn: 344409
* Revert SymbolFileNativePDB plugin.Zachary Turner2018-10-113-11/+0
| | | | | | | | | This was originally causing some test failures on non-Windows platforms, which required fixes in the compiler and linker. After those fixes, however, other tests started failing. Reverting temporarily until I can address everything. llvm-svn: 344279
* Create a SymbolFile plugin for cross-platform PDB access.Zachary Turner2018-10-103-0/+11
The existing SymbolFilePDB only works on Windows, as it is written against a closed-source Microsoft SDK that ships with their debugging tools. There are several reasons we want to bypass this and go straight to the bits of the PDB, but just to list a few: More room for optimization. We can't see inside the implementation of the Microsoft SDK, so we don't always know if we're doing things in the most efficient way possible. For example, setting a breakpoint on main of a big program currently takes several seconds. With the implementation here, the time is unnoticeable. We want to be able to symbolize Windows minidumps even if not on Windows. Someone should be able to debug Windows minidumps as if they were on Windows, given that no running process is necessary. This patch is a very crude first attempt at filling out some of the basic pieces. I've implemented FindFunctions, ParseCompileUnitLineTable, and ResolveSymbolContext for a limited subset of possible parameter values, which is just enough to get it to display something nice for the breakpoint location. I've added several tests exercising this functionality which are limited enough to work on all platforms but still exercise this functionality. I'll try to add as many tests of this nature as I can, but at some point we'll need a live process. For now, this plugin is enabled always on non-Windows, and by setting the environment variable LLDB_USE_NATIVE_PDB_READER=1 on Windows. Eventually, once it's at parity with the Windows implementation, we'll delete the Windows DIA-based implementation. Differential Revision: https://reviews.llvm.org/D53002 llvm-svn: 344154
OpenPOWER on IntegriCloud