summaryrefslogtreecommitdiffstats
path: root/lldb/lit/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* [NativePDB] Add anonymous namespaces supportAleksandr Urakov2019-04-224-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix symtab-macho.test broken by r358500Pavel Labath2019-04-162-2/+2
| | | | | | Put the correct UUID string into the breakpad file. llvm-svn: 358508
* [lldb] [lit/SymbolFile] Avoid -nostdlib in target-symbols-add-unwind.testMichal Gorny2019-04-132-6/+6
| | | | | | | | | | | | | Do not use -nostdlib in target-symbols-add-unwind.test. NetBSD uses startup files to provide obligatory ELF notes in executables, and therefore using -nostdlib requires providing specially tailored input. Otherwise, kernel rejects the result as invalid executable. The replacement was suggested by Pavel Labath. Differential Revision: https://reviews.llvm.org/D60648 llvm-svn: 358329
* Reinitialize UnwindTable when the SymbolFile changesPavel Labath2019-03-182-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a preparatory step to enable adding of unwind plans by symbol file plugins. Although at the surface it seems that currently symbol files have nothing to do with unwinding, this isn't entirely correct even now. The mere act of adding a symbol file can have the effect of making more sections (typically .debug_frame) available to the unwinding machinery, so that it can have more unwind strategies to choose from. Up until now, we've had a bug, which went largely unnoticed, where unwind info in the manually added symbols files (target symbols add) was being ignored during unwinding. Reinitializing the UnwindTable fixes that bug too. Reviewers: clayborg, jasonmolenda, alexshap Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58347 llvm-svn: 356361
* [lldb] [test] Adjust XFAIL list to match buildbot resultsMichal Gorny2019-03-096-6/+0
| | | | | | | | Adjust the XFAIL-ing tests to match consistent results from buildbot. I'm going to work on differences between them and my local results following this. llvm-svn: 355774
* [lldb] Fix DW_OP_addrx uses.Ali Tamur2019-03-071-0/+66
| | | | | | | | | | | | | | | | Summary: DW_OP_GNU_addr_index has been renamed as DW_OP_addrx in the standard. clang produces DW_OP_addrx tags and with this change lldb starts to process them. Reviewers: aprantl, jingham, davide, clayborg, serge-sans-paille Reviewed By: aprantl Subscribers: jdoerfert, dblaikie, labath, shafik, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D59004 llvm-svn: 355629
* [lldb] [test] Mark failing tests XFAIL on NetBSDMichal Gorny2019-03-046-0/+6
| | | | | | | | | | | | | | | | Add a convenience 'expectedFailureNetBSD' decorator and mark all tests currently failing on NetBSD with it. Also skip a few tests that hang the test suite. This should establish a baseline for the test suite and get us closer to enabling tests on buildbot. This will help us catch regressions while we still have a lot of work to do to get tests working. It seems that there are also some flaky tests. I am going to address them later on. Differential Revision: https://reviews.llvm.org/D58527 llvm-svn: 355320
* [NativePDB] Process virtual bases in the correct orderAleksandr Urakov2019-02-122-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Breakpad: auto-detect path style of file entriesPavel Labath2019-02-116-8/+18
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds support for auto-detection of path style to SymbolFileBreakpad (similar to how r351328 did the same for DWARF). We guess each file entry separately, as we have no idea which file came from which compile units (and different compile units can have different path styles). The breakpad generates should have already converted the paths to absolute ones, so this guess should be reasonable accurate, but as always with these kinds of things, it is hard to give guarantees about anything. In an attempt to bring some unity to the path guessing logic, I move the guessing logic from inside SymbolFileDWARF into the FileSpec class and have both symbol files use it to implent their desired behavior. Reviewers: clayborg, lemo, JDevlieghere Subscribers: aprantl, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D57895 llvm-svn: 353702
* Breakpad: temporarily XFAIL line-table testsPavel Labath2019-02-074-0/+8
| | | | | | | | | | | | The tests are failing on windows because the paths in the symbol file are parsed using the host path style. I'm working on a patch to have SymbolFileBreakpad auto-detect the correct path style (similar to dwarf r351328). I originally wanted to make this a part of the initial line-table patch, but then I simply forgot. llvm-svn: 353410
* SymbolFileBreakpad: Add line table supportPavel Labath2019-02-078-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch teaches SymbolFileBreakpad to parse the line information in breakpad files and present it to lldb. The trickiest question here was what kind of "compile units" to present to lldb, as there really isn't enough information in breakpad files to correctly reconstruct those. A couple of options were considered - have the entire file be one compile unit - have one compile unit for each FILE record - have one compile unit for each FUNC record The main drawback of the first approach is that all of the files would be considered "headers" by lldb, and so they wouldn't be searched if target.inline-breakpoint-strategy=never. The single compile unit would also be huge, and there isn't a good way to name it. The second approach will create mostly correct compile units for cpp files, but it will still be wrong for headers. However, the biggest drawback here seemed to be the fact that this can cause a compile unit to change mid-function (for example when a function from another file is inlined or another file is #included into a function). While I don't know of any specific thing that would break in this case, it does sound like a thing that we should avoid. In the end, we chose the third option, as it didn't seem to have any major disadvantages, though it was not ideal either. One disadvantage here is that this generates a large number of compile units, and there is still a question on how to name it. We chose to simply name it after the first line record in that function. This should be correct 99.99% of the time, though it can produce somewhat strange results if the very first line record comes from an #included file. Reviewers: clayborg, zturner, lemo, markmentovai Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D56595 llvm-svn: 353404
* [PDB] Fix location retrieval for function local variables and arguments that areAleksandr Urakov2019-02-013-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | stored relative to VFRAME Summary: This patch makes LLDB able to retrieve proper values for function arguments and local variables stored in PDB relative to VFRAME register. Patch contains retrieval of corresponding FPO table entries from PDB and a generic translator from FPO programs to DWARF expressions to get correct VFRAME value. Patch also improves variables-locations.test and makes this test passable on x86. Patch By: leonid.mashinsky Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov Reviewed By: zturner Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D55122 llvm-svn: 352845
* [NativePDB] Fix lldb-x64-windows-ninja after r352464Aleksandr Urakov2019-01-292-8/+24
| | | | llvm-svn: 352478
* [NativePDB] Add basic support of methods recostruction in ASTAleksandr Urakov2019-01-292-0/+41
| | | | | | | | | | | | | | | | | | 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
* Define the _fltused symbol in one lldb test as well, post-r352076.James Y Knight2019-01-251-0/+4
| | | | llvm-svn: 352159
* breakpad: Add FUNC records to the symtabPavel Labath2019-01-222-5/+8
| | | | | | | | | | | | | | | | | | | | This patch extends SymbolFileBreakpad::AddSymbols to include the symbols from the FUNC records too. These symbols come from the debug info and have a size associated with them, so they are given preference in case there is a PUBLIC record for the same address. To achieve this, I first pre-process the symbols into a temporary DenseMap, and then insert the uniqued symbols into the module's symtab. Reviewers: clayborg, lemo, zturner Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D56590 llvm-svn: 351781
* Fix test after AST dump output changeStephen Kelly2019-01-211-1/+1
| | | | llvm-svn: 351760
* Fix test after AST dump output changeStephen Kelly2019-01-211-1/+1
| | | | llvm-svn: 351733
* Fix test after AST dump output changeStephen Kelly2019-01-201-1/+1
| | | | llvm-svn: 351707
* Try to port tests to AST dump changesStephen Kelly2019-01-205-13/+10
| | | | llvm-svn: 351703
* Recommit "Teach the default symbol vendor to respect ↵Pavel Labath2019-01-173-0/+73
| | | | | | | | | | | | | | module.GetSymbolFileFileSpec()" This reapplies commit r351330, which was reverted due to a failing test on macos. The failure was because the SymbolVendor used on MacOS was stricter than the default (or ELF) symbol vendor, and rejected the symbol file because it's UUID did not match the object file. This version of the patch adds a uuid load command to the test macho file to make sure the UUIDs match. llvm-svn: 351447
* Recommit "Add a verbose mode to "image dump line-table" and use it to write ↵Pavel Labath2019-01-171-0/+75
| | | | | | | | | | | a .debug_line test" This reapplies r350802, which was reverted because of issues with parsing posix-style paths on windows hosts (and vice-versa). These have since been fixed in r351328, and lldb should now recognise the path style used in a dwarf compile unit correctly. llvm-svn: 351435
* Change TypeSystem::GetBitSize() to return an optional result.Adrian Prantl2019-01-161-4/+4
| | | | | | | | | | | | This patch changes the behavior when printing C++ function references: where we previously would get a <could not determine size>, there is now a <no summary available>. It's not clear to me whether this is a bug or an omission, but it's one step further than LLDB previously got. Differential Revision: https://reviews.llvm.org/D56798 llvm-svn: 351376
* Fix dir-separator-no-comp-dir-relative-name.s test added in r351328Pavel Labath2019-01-161-6/+7
| | | | | | | | | In this test we have deliberately removed all information which may hint at the correct path style, so we cannot assert that lldb uses a particular style. Instead, we should just check that it does something vaguely reasonable. llvm-svn: 351359
* Revert "Teach the default symbol vendor to respect ↵Pavel Labath2019-01-163-70/+0
| | | | | | | | module.GetSymbolFileFileSpec()" This reverts commit r351330 due to failures on MacOS bots. llvm-svn: 351353
* Teach the default symbol vendor to respect module.GetSymbolFileFileSpec()Pavel Labath2019-01-163-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adding a breakpad symbol file to an existing MachO module with "target symbols add" currently works only if one's host platform is a mac. This is because SymbolVendorMacOSX (which is the one responsible for loading symbols for MachO files) is conditionally compiled for the mac platform. While we will sooner or later have a special symbol vendor for breakpad files (to enable more advanced searching), and so this flow could be made to work through that, it's not clear to me whether this should be a requirement for the "target symbols add" flow to work. After all, since the user has explicitly specified the symbol file to use, the symbol vendor plugin's job is pretty much done. This patch teaches the default symbol vendor to respect module's symbol file spec, and load the symbol from that file if it is specified (and no plugin requests any special handling). Reviewers: clayborg, zturner, lemo Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D56589 llvm-svn: 351330
* DWARF: Add some support for non-native directory separatorsPavel Labath2019-01-167-0/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If we opened a file which was produced on system with different path syntax, we would parse the paths from the debug info incorrectly. The reason for that is that we would parse the paths as they were native. For example this meant that on linux we would treat the entire windows path as a single file name with no directory component, and then we would concatenate that with the single directory component from the DW_AT_comp_dir attribute. When parsing posix paths on windows, we would at least get the directory separators right, but we still would treat the posix paths as relative, and concatenate them where we shouldn't. This patch attempts to remedy this by guessing the path syntax used in each compile unit. (Unfortunately, there is no info in DWARF which would give the definitive path style used by the produces, so guessing is all we can do.) Currently, this guessing is based on the DW_AT_comp_dir attribute of the compile unit, but this can be refined later if needed (for example, the DW_AT_name of the compile unit may also contain some useful info). This style is then used when parsing the line table of that compile unit. This patch is sufficient to make the line tables come out right, and enable breakpoint setting by file name work correctly. Setting a breakpoint by full path still has some kinks (specifically, using a windows-style full path will not work on linux because the path will be parsed as a linux path), but this will require larger changes in how breakpoint setting works. Reviewers: clayborg, zturner, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D56543 llvm-svn: 351328
* Attempt to fix PDB tests broken by r350924Pavel Labath2019-01-116-6/+6
| | | | | | | The patch added the symbol plugin name to the lldb-test output. Update the tests to account for that. llvm-svn: 350947
* Introduce SymbolFileBreakpad and use it to fill symtabPavel Labath2019-01-113-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adds the glue code necessary to integrate the SymbolFileBreakpad into the plugin system. Most of the methods are stubbed out. The only method implemented method is AddSymbols, which parses the PUBLIC "section" of the breakpad "object file", and fills out the Module's symtab. To enable testing this, I've made two additional changes: - dump Symtab from the SymbolVendor class. The symtab was already being dumped as a part of the object file dump, but that happened before symbol vendor kicked in, so it did not reflect any symbols added there. - add ability to explicitly specify the external symbol file in lldb-test (so that the object file could be linked with the breakpad symbol file). To make things simpler, I've changed lldb-test from consuming multiple inputs (and dumping their symbols) to having it just process a single file per invocation. This was not a problem since everyone was using it that way already. Reviewers: clayborg, zturner, lemo, markmentovai, amccarth Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D56173 llvm-svn: 350924
* [NativePDB] Add support for parsing typedef records.Zachary Turner2019-01-101-0/+71
| | | | | | | | | | | | | | | | | | | | Typedefs are represented as S_UDT records in the globals stream. This creates a strange situation where "types" are actually represented as "symbols", so they need special handling. In order to test this, we don't just use lldb and print out some variables causing the AST to get created, because variables whose type is a typedef will have debug info referencing the original type, not the typedef. So we use lldb-test instead which will parse all debug info in the entire file. This exposed some problems with lldb-test and the native reader, mainly that certain types of obscure symbols which we can find when iterating every single record would trigger crashes. These have been fixed as well so that lldb-test can be used to test this functionality. Differential Revision: https://reviews.llvm.org/D56461 llvm-svn: 350888
* Revert "Add a verbose mode to "image dump line-table" and use it to write a ↵Pavel Labath2019-01-101-75/+0
| | | | | | | | | | | | | .debug_line test" This reverts commit r350802 because the test fails on windows. This happens because we treat the paths as windows paths even though they have linux path separators in the asm file. That results in wrong paths being computed (\tmp\tmp\a.c instead of /tmp/a.c). Reverting until I can figure out what to do with this. llvm-svn: 350810
* Add a verbose mode to "image dump line-table" and use it to write a ↵Pavel Labath2019-01-101-0/+75
| | | | | | | | | | | | | | | | | | | | | | .debug_line test Summary: The motivation for this is being able to write tests for the upcoming breakpad line table parser, but this could be useful for testing the low-level workings of any line table format. Or simply for viewing the line table information with more detail (the brief format doesn't include any of the flags for end_of_prologue and similar). I've also removed the load_addresses argument from the DumpCompileUnitLineTable function, as it wasn't being used anywhere. Reviewers: clayborg, zturner Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D56315 llvm-svn: 350802
* Write PDB/variables.test to be more robust.Zachary Turner2019-01-091-50/+58
| | | | | | | | | | | | | | | | | | | CHECK-DAG can't really be mixed with CHECK-NEXT statements because each non DAG check sets a new search-origin for following CHECK-DAG statements. This was passing by coincidence before, but a benign change in the way we process symbols caused the order of the output to be different, which triggered this test to fail. This change makes the test resilient against ordering problems by running a separate invocation of FileCheck for each function that we want to test. Note that with the Native PDB reader, we have full control over the ordering that symbols are processed in, so we don't have to worry about different machines returning things in different orders due to different DIA SDK versions. llvm-svn: 350773
* Change lldb-test to use ParseAllDebugSymbols.Zachary Turner2019-01-092-57/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ParseDeclsForContext was originally created to serve the very specific case where the context is a function block. It was never intended to be used for arbitrary DeclContexts, however due to the generic name, the DWARF and PDB plugins implemented it in this way "just in case". Then, lldb-test came along and decided to use it in that way. Related to this, there are a set of functions in the SymbolFile class interface whose requirements and expectations are not documented. For example, if you call ParseCompileUnitFunctions, there's an inherent requirement that you create entries in the underlying clang AST for these functions as well as their signature types, because in order to create an lldb_private::Function object, you have to pass it a CompilerType for the parameter representing the signature. On the other hand, there is no similar requirement (either inherent or documented) if one were to call ParseDeclsForContext. Specifically, if one calls ParseDeclsForContext, and some variable declarations, types, and other things are added to the clang AST, is it necessary to create lldb::Variable, lldb::Type, etc objects representing them? Nobody knows. There is, however, an accidental requirement, because since all of the plugins implemented this just in case, lldb-test came along and used ParsedDeclsForContext, and then wrote check lines that depended on this. When I went to try and implemented the NativePDB reader, I did not adhere to this (in fact, from a layering perspective I went out of my way to avoid it), and as a result the existing DIA PDB tests don't work when the native PDB reader is enabled, because they expect that calling ParseDeclsForContext will modify the *module's* view of symbols, and not just the internal AST. All of this confusion, however, can be avoided if we simply stick to using ParseDeclsForContext for its original intended use case (blocks), and use a different function (ParseAllDebugSymbols) for its intended use case which is, unsuprisingly, to parse all the debug symbols (which is all lldb-test really wanted to do anyway). In the future, I would like to change ParseDeclsForContext to ParseDeclsForFunctionBlock, then delete all of the dead code inside that handles other types of DeclContexts (and probably even assert if the DeclContext is anything other than a block). A few PDB tests needed to be fixed up as a result of this, and this also exposed a couple of bugs in the DIA PDB reader (doesn't matter much since it should be going away soon, but worth mentioning) where the appropriate AST entries weren't being created always. Differential Revision: https://reviews.llvm.org/D56418 llvm-svn: 350764
* [NativePDB] Implement ParseDeclsForContext.Zachary Turner2019-01-021-1/+1
| | | | | | | | | | | This is a first step towards getting lldb-test symbols working with the native plugin. There is a remaining issue, which is that the plugin expects that ParseDeclsForContext will also create lldb symbols rather than just the decls, but the native pdb plugin doesn't currently do this. This will be addressed in a followup patch. llvm-svn: 350243
* [NativePDB] Update function-types-classes test to check VarDecls.Zachary Turner2019-01-021-3/+13
| | | | | | | | A Previous patch added support for creating VarDecls for global variables. This patch updates this test to be more strict and actually check these, not just the types. llvm-svn: 350242
* [NativePDB] Fix setting breakpoint by file and line.Zachary Turner2019-01-024-17/+40
| | | | | | | | | | | | | | | | | | | 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
* DWARF: Fix a bug in array size computationPavel Labath2018-12-271-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r346165 introduced a bug, where we would fail to parse the size of an array if that size happened to match an existing die offset. The logic was: if (DWARFDIE count = die.GetReferencedDie(DW_AT_count)) num_elements = compute_vla_size(count); else num_elements = die.GetUsigned(DW_AT_count); // a fixed-size array The problem with this logic was that GetReferencedDie did not take the form class of the attribute into account, and would happily return a die reference for any form, if its value happened to match some die. As this behavior is inconsistent with how llvm's DWARFFormValue class operates, I chose to fix the problem by making our version of this class match the llvm behavior. For this to work, I had to add an explicit form class check to the .apple_XXX tables parsing code, because they do (incorrectly?) use data forms as die references. Reviewers: aprantl, clayborg Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D55991 llvm-svn: 350086
* [NativePDB] Create VarDecls for global variables.Zachary Turner2018-12-203-0/+223
| | | | | | | | | | 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
* Fix line endings.Zachary Turner2018-12-191-2/+2
| | | | llvm-svn: 349692
* [NativePDB] Enable function-level-linking.test in native mode.Zachary Turner2018-12-191-1/+2
| | | | | | This test passes with the native reader, so run it in both modes. llvm-svn: 349675
* [NativePDB] Fix a use after free and enable corresponding native test.Zachary Turner2018-12-191-1/+2
| | | | | | | | | | | We had a use after free where we were assigning the result of a function that returned a string to a StringRef. After fixing this use after free, one of the DIA PDB tests now passes with the native PDB reader, so we enable the test under native mode as well. The goal is to eventually make all the tests pass under both, at which point we can disable them all under DIA mode. llvm-svn: 349673
* [NativePDB] Correctly reconstruct DeclContext for nested enums.Zachary Turner2018-12-182-3/+15
| | | | | | | | | | | | 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] Decouple AST reconstruction from lldb Symbol creation.Zachary Turner2018-12-171-8/+8
| | | | | | | | | | | | Previously the code that parsed debug info to create lldb's Symbol objects such as Variable, Type, Function, etc was tightly coupled to the AST reconstruction code. This made it difficult / impossible to implement functions such as ParseDeclsForContext() that were only supposed to be operating on clang AST's. By splitting these apart, the logic becomes much cleaner and we have a clear separation of responsibilities. llvm-svn: 349383
* [NativePDB] Fix local-variables.cpp test.Zachary Turner2018-12-141-1/+1
| | | | | | | | Since we're actually running an executable on the host now, different versions of Windows could load different system libraries, so we need to regex out the number of loaded modules. llvm-svn: 349175
* [NativePDB] Add support for local variables.Zachary Turner2018-12-132-0/+193
| | | | | | | | | 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-075-1/+45
| | | | | | | | | | | | 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
* [PDB] Make PDB lit tests use the new builderAleksandr Urakov2018-12-0515-44/+33
| | | | | | | | | | | | Reviewers: zturner, stella.stamenova Reviewed By: zturner Tags: #lldb Differential Revision: https://reviews.llvm.org/D54942 llvm-svn: 348386
* [PDB] Support PDB-backed expressions evaluation (+ fix stuck test)Aleksandr Urakov2018-12-035-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch contains several small fixes, which makes it possible to evaluate expressions on Windows using information from PDB. The changes are: - several sanitize checks; - make IRExecutionUnit::MemoryManager::getSymbolAddress to not return a magic value on a failure, because callers wait 0 in this case; - entry point required to be a file address, not RVA, in the ObjectFilePECOFF; - do not crash on a debuggee second chance exception - it may be an expression evaluation crash. Also fix detection of "crushed" threads in tests; - create parameter declarations for functions in AST to make it possible to call debugee functions from expressions; - relax name searching rules for variables, functions, namespaces and types. Now it works just like in the DWARF plugin; - fix endless recursion in SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc. Reviewers: zturner, asmith, stella.stamenova Reviewed By: stella.stamenova, asmith Tags: #lldb Differential Revision: https://reviews.llvm.org/D53759 llvm-svn: 348136
* [lit] Add a generic build script with a lit substitution.Zachary Turner2018-12-0114-55/+42
| | | | | | | | | | | | | | | | | | | This adds a script called build.py as well as a lit substitution called %build that we can use to invoke it. The idea is that this allows a lit test to build test inferiors without having to worry about architecture / platform specific differences, command line syntax, finding / configurationg a proper toolchain, and other issues. They can simply write something like: %build --arch=32 -o %t.exe %p/Inputs/foo.cpp and it will just work. This paves the way for being able to run lit tests with multiple configurations, platforms, and compilers with a single test. Differential Revision: https://reviews.llvm.org/D54914 llvm-svn: 348058
OpenPOWER on IntegriCloud