summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] Remove some calls to GetASTContextRaphael Isemann2019-12-261-14/+7
| | | | | | | GetASTContext is really expensive to call as it makes use of the global mapping from ASTContext to ClangASTContext. This replaces all calls where we already have the ClangASTContext around and don't need to call GetASTContext again.
* [lldb][NFC] Make CompilerDeclContext construction type safeRaphael Isemann2019-12-231-1/+1
| | | | | | | | | | | | | | | The CompilerDeclContext constructor takes a void* pointer which means that all callers of this constructor need to first explicitly convert all pointers to clang::DeclContext*. This causes that we for example can't just pass a TranslationUnitDecl* to the constructor without first casting it to its parent class (as it inherits from both Decl and DeclContext so the void* pointer is actually a Decl*). This patch introduces a utility function in the ClangASTContext which gets rid of the requirement to cast all pointers to clang::DeclContext. Also moves all constructor calls to use this function instead which is NFC (beside the change in DWARFASTParserClangTests.cpp).
* [lldb][NFC] Return a reference from ClangASTContext::getASTContext and ↵Raphael Isemann2019-12-211-25/+23
| | | | | | | | | | | remove dead nullptr checks ClangASTContext::getASTContext() currently returns a ptr but we have an assert there since a while that the ASTContext is not a nullptr. This causes that we still have a lot of code that is doing nullptr checks on the result of getASTContext() which is all unreachable code. This patch changes the return value to a reference to make it clear this can't be a nullptr and deletes all the nullptr checks.
* [lldb][NFC] Use StringRef in CreateRecordType and CreateObjCClassRaphael Isemann2019-12-171-3/+3
|
* [lldb][NFC] Rename ClangASTImporter::InsertRecordDecl to SetRecordLayout and ↵Raphael Isemann2019-12-171-1/+1
| | | | | | | document it This function is just setting the layout for the given RecordDecl so the current name is not very descriptive. Also add some documentation for it.
* [lldb][NFC] Remove all unnecessary includes for ClangASTSourceCommon.hRaphael Isemann2019-12-171-1/+1
| | | | | These files only need the definition of ClangASTMetadata (which was previously in the ClangASTSourceCommon.h) or don't need the include at all.
* Replace bitfield in lldb::Type with byte-sized members. (NFC)Adrian Prantl2019-11-181-12/+12
| | | | | | Due to alginment and packing using separate members takes up the same amount of space, but makes it far less cumbersome to deal with it in constructors etc.
* [Symbol] Decouple clang from CompilerTypeAlex Langford2019-08-131-7/+14
| | | | | | | | | | Summary: Ideally CompilerType would have no knowledge of clang or any individual TypeSystem. Decoupling clang is relatively straightforward. Differential Revision: https://reviews.llvm.org/D66102 llvm-svn: 368741
* Fix ClangASTContext::CreateParameterDeclaration to not call addDeclShafik Yaghmour2019-08-021-1/+1
| | | | | | | | | Summary: The change https://reviews.llvm.org/D55575 modified ClangASTContext::CreateParameterDeclaration to call decl_ctx->addDecl(decl); this caused a regression since the existing code in DWARFASTParserClang::ParseChildParameters is called with the containing DeclContext. So when end up with cases where we are parsing a parameter for a member function and the parameter is added to the CXXRecordDecl as opposed to the CXXMethodDecl. This example is given in the regression test TestBreakpointInMemberFuncWNonPrimitiveParams.py which without this fix in a modules build leads to assert on setting a breakpoint in a member function with non primitive parameters. This scenario would be common when debugging LLDB or clang. Differential Revision: https://reviews.llvm.org/D65414 llvm-svn: 367726
* Make a blind attempt at fixing PDBASTParser nullability issuesAdrian Prantl2019-01-291-2/+6
| | | | llvm-svn: 352548
* Make Type::GetByteSize optional (NFC)Adrian Prantl2019-01-291-6/+10
| | | | | | | | | | | This is a continuation of my quest to make the size 0 a supported value. This reapplies r352394 with additional PDB parser fixes prepared by Pavel Labath! Differential Revision: https://reviews.llvm.org/D57273 llvm-svn: 352521
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Simplify Boolean expressionsJonas Devlieghere2018-12-151-1/+1
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* [ast] CreateParameterDeclaration should use an appropriate DeclContext.Zachary Turner2018-12-121-1/+2
| | | | | | | | | | | | | | | | | | Previously CreateParameterDeclaration was always using the translation unit DeclContext. We would later go and add parameters to the FunctionDecl, but internally clang makes a copy when you do this, and we'd end up with ParmVarDecl's at the global scope as well as in the function scope. This fixes the issue. It's hard to say whether this will introduce a behavioral change in name lookup, but I know there have been several hacks introduced in previous years to deal with collisions between various types of variables, so there's a chance that this patch could obviate one of those hacks. Differential Revision: https://reviews.llvm.org/D55571 llvm-svn: 348941
* [PDB] Support PDB-backed expressions evaluation (+ fix stuck test)Aleksandr Urakov2018-12-031-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "[PDB] Support PDB-backed expressions evaluation"Stella Stamenova2018-11-301-33/+7
| | | | | | | | | This reverts commit dec87759523b2f22fcff3325bc2cd543e4cda0e7. This commit caused the tests on Windows to run forever rather than complete. Reverting until the commit can be fixed to not stall. llvm-svn: 348009
* [PDB] Support PDB-backed expressions evaluationAleksandr Urakov2018-11-301-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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; - 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: 347962
* Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove ↵Shafik Yaghmour2018-11-081-2/+1
| | | | | | | | | | redundant parameter which can be calculated from other parameter. rdar://problem/43822994 Differential Revision: https://reviews.llvm.org/D54003 llvm-svn: 346428
* [PDB] Introduce `MSVCUndecoratedNameParser`Aleksandr Urakov2018-11-061-92/+134
| | | | | | | | | | | | This patch introduces the simple MSVCUndecoratedNameParser. It is needed for parsing names of PDB symbols corresponding to template instantiations. For example, for the name `operator<<A>'::`2'::B::operator> we can't just split the name with :: (as it is implemented for now) to retrieve its scopes. This parser processes such names in a more correct way. Differential Revision: https://reviews.llvm.org/D52461 llvm-svn: 346213
* Add a target modules dump ast command.Zachary Turner2018-11-051-1/+1
| | | | | | | | | | This is useful for investigating the clang ast as you reconstruct it via by parsing debug info. It can also be used to write tests against. Differential Revision: https://reviews.llvm.org/D54072 llvm-svn: 346149
* [FileSystem] Move path resolution logic out of FileSpecJonas Devlieghere2018-11-011-1/+1
| | | | | | | | | This patch removes the logic for resolving paths out of FileSpec and updates call sites to rely on the FileSystem class instead. Differential revision: https://reviews.llvm.org/D53915 llvm-svn: 345890
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 llvm-svn: 345882
* [NFC] Refactor SetBaseClasses and DeleteBaseClasses.Zachary Turner2018-10-251-14/+11
| | | | | | | | | | | | | | | | | | | | | | We currently had a 2-step process where we had to call SetBaseClassesForType and DeleteBaseClasses. Every single caller followed this exact 2-step process, and there was manual memory management going on with raw pointers. We can do better than this by storing a vector of unique_ptrs and passing this around. This makes for a cleaner API, and we only need to call one method so there is no possibility of a user forgetting to call DeleteBaseClassSpecifiers. In addition to this, it also makes for a *simpler* API. Part of why I wanted to do this is because when I was implementing the native PDB interface I had to spend some time understanding exactly what I was deleting and why. ClangAST has significant mental overhead associated with it, and reducing the API surface can go along way to making it simpler for people to understand. Differential Revision: https://reviews.llvm.org/D53590 llvm-svn: 345312
* [PDB] Handle `char` as a builtin typeAleksandr Urakov2018-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `char`, `signed char` and `unsigned char` are three different types, and they are mangled differently: ``` void __declspec(dllexport) /* ?foo@@YAXD@Z */ foo(char c) { } void __declspec(dllexport) /* ?foo@@YAXE@Z */ foo(unsigned char c) { } void __declspec(dllexport) /* ?foo@@YAXC@Z */ foo(signed char c) { } ``` This commit separates `char` from `signed char` and `unsigned char`. Reviewers: asmith, zturner, labath Reviewed By: asmith, zturner Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52468 llvm-svn: 343298
* [PDB] Restore the calling convention from PDBAleksandr Urakov2018-09-261-1/+22
| | | | | | | | | | | | | | | | | | | Summary: This patch implements restoring of the calling convention from PDB. It is necessary for expressions evaluation, if we want to call a function of the debuggee process with a calling convention other than ccall. Reviewers: clayborg, zturner, labath, asmith Reviewed By: clayborg Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52501 llvm-svn: 343084
* [PDB] Use the raw PDB symbol interface more accuratelyAleksandr Urakov2018-09-141-13/+39
| | | | | | | | | | | | | | | | | | Summary: This patch adds some symbol tag checks before using the `IPDBRawSymbol` interface to improve safety and readability. Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51967 llvm-svn: 342208
* Fix two issues in PDBASTParserPavel Labath2018-09-121-17/+16
| | | | | | | - gcc warning about using binary or for or-ing two comparisons (a == b | a == c) - llvm style prefers static functions to functions in an anonymous namespace llvm-svn: 342051
* [PDB] Fix problems after rL341782Aleksandr Urakov2018-09-111-1/+1
| | | | | | | | | | | | | Summary: This commit fixes following problems after rL341782: - Broken SymbolFilePDBTests - Warning on comparison of integers of different signs Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341942
* [PDB] Restore AST from PDB symbolsAleksandr Urakov2018-09-101-114/+475
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds an implementation of retrieving of declarations and declaration contexts based on PDB symbols. PDB has different type symbols for const-qualified types, and this implementation ensures that only one declaration was created for both const and non-const types, but creates different compiler types for them. The implementation also processes the case when there are two symbols corresponding to a variable. It's possible e.g. for class static variables, they has one global symbol and one symbol belonging to a class. PDB has no info about namespaces, so this implementation parses the full symbol name and tries to figure out if the symbol belongs to namespace or not, and then creates nested namespaces if necessary. Reviewers: asmith, zturner, labath Reviewed By: asmith Subscribers: aleksandr.urakov, teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341782
* Fix compiler warnings after rL339649.Aleksandr Urakov2018-08-171-6/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D49980 llvm-svn: 339994
* [PDB] Parse UDT symbols and pointers to members (combined patch)Aleksandr Urakov2018-08-141-10/+383
| | | | | | | | | | | | | | | | | | | | | | Summary: In this patch I've tried to combine the best ideas from D49368 and D49410, so it implements following: - Completion of UDTs from a PDB with a filling of a layout info; - Pointers to members; - Fixes the bug relating to a virtual base offset reading from `vbtable`. The offset was treated as an unsigned, but it can be a negative sometimes. - Support of MSInheritance attribute Reviewers: asmith, zturner, rnk, labath, clayborg, lldb-commits Reviewed By: zturner Subscribers: aleksandr.urakov, stella.stamenova, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D49980 llvm-svn: 339649
* [SymbolFilePDB] PDB_BuiltinType::Char16 and Char32 are unsigned in MSVC.Aaron Smith2018-05-231-2/+2
| | | | llvm-svn: 333055
* [SymbolFilePDB] Add a test for wchar_t type in PDB.Aaron Smith2018-05-231-0/+1
| | | | | | | | The wchar_t is unsigned. https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx llvm-svn: 333051
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* [SymbolFilePDB] Ignore compiler generated functions when creating the LLDB ↵Aaron Smith2018-03-221-0/+3
| | | | | | type from a PDB llvm-svn: 328230
* [SymbolFilePDB] Run clang-format; NFCAaron Smith2018-03-221-25/+29
| | | | llvm-svn: 328176
* [SymbolFilePDB] Simplify code with newer methodsAaron Smith2018-03-201-2/+2
| | | | llvm-svn: 327927
* [SymbolFilePDB] Remove a few null pointer checks by passing refAaron Smith2018-03-191-18/+11
| | | | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44455 llvm-svn: 327908
* [SymbolFilePDB] Add missing Char16 and Char32 types in a few placesAaron Smith2018-03-071-0/+10
| | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Subscribers: clayborg, llvm-commits Differential Revision: https://reviews.llvm.org/D44166 llvm-svn: 326875
* [SymbolFilePDB] Add support for CVR pointer type qualifierAaron Smith2018-03-071-20/+44
| | | | | | | | | | | | | | | | | Summary: - Complete element type of PDBSymbolTypeArray. - Add a test to check types of multi-dimensional array and pointers with CVR. Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44167 llvm-svn: 326859
* [SymbolFilePDB] Get line number for PDBSymbolTypeEnumAaron Smith2018-03-071-8/+12
| | | | | | | | | | | | Reviewers: zturner, lldb-commits, rnk Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44164 llvm-svn: 326858
* Supply missing break in case statement.Adrian McCarthy2018-02-141-3/+1
| | | | | | | | | | | | Summary: All the tests pass without hitting the situation mentioned in the FIXME, so, per Aaron Smith's suggestion, this case will now return unconditionally. Subscribers: sanjoy, mgorny, JDevlieghere Differential Revision: https://reviews.llvm.org/D43215 llvm-svn: 325188
* [SymbolFilePDB] Add support for function symbolsAaron Smith2018-02-091-8/+71
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is combination of following changes, - Resolve function symbols in PDB symbol file. `lldb-test symbols` will display information about function symbols. - Implement SymbolFilePDB::FindFunctions methods. On lldb console, searching function symbol by name and by regular expression are both available. - Create lldb type for PDBSymbolFunc. - Add tests to check whether functions with the same name but from different sources can be resolved correctly. Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: amccarth, labath, llvm-commits Differential Revision: https://reviews.llvm.org/D42443 llvm-svn: 324707
* [lldb] Silence signed <-> unsigned integer comparison warningKirill Bobyrev2018-01-291-1/+1
| | | | | | | | | | | | | | | | | | `num_args` is unsigned integer, declared as below: ``` uint32_t num_args = arg_enum->getChildCount(); ``` Comparison with the signed `arg_idx` produces a warning when compiled with -Wsign-compare flag, this patch addresses this simple issue without affecting any functionality. Reviewers: davide, asmith Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D42620 llvm-svn: 323645
* [SymbolFilePDB] Fix null array access when parsing the type of a function ↵Aaron Smith2018-01-231-15/+194
| | | | | | | | | | | | | | | | | | | | | | | | without any arguments, i.e. 'int main()' and add support to test it Summary: - Fix a null array access bug. This happens when creating the lldb type for a function that has no argument. - Implement SymbolFilePDB::ParseTypes method. Using `lldb-test symbols` will show all supported types in the target. - Create lldb types for variadic function, PDBSymbolTypePointer, PDBSymbolTypeBuiltin - The underlying builtin type for PDBSymbolTypeEnum is always `Int`, correct it with the very first enumerator's encoding if any. This is more accurate when the underlying type is not signed or another integer type. - Fix a bug when the compiler type is not created based on PDB_BuiltinType. For example, basic type `long` is of same width as `int` in a 32-bit target, and the compiler type of former one will be represented by the one generated for latter if using the default method. Introduce a static function GetBuiltinTypeForPDBEncodingAndBitSize to correct this issue. - Basic type `long double` and `double` have the same bit size in MSVC and there is no information in a PDB to distinguish them. The compiler type of the former one is represented by the latter's. - There is no line information about typedef, enum etc in a PDB and the source and line information for them are not shown. - There is no information about scoped enumeration. The compiler type is represented as an unscoped one. Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: majnemer, llvm-commits Differential Revision: https://reviews.llvm.org/D42434 llvm-svn: 323255
* Revert "[SymbolFilePDB] Fix null array access when parsing the type of a ↵Pavel Labath2018-01-221-194/+15
| | | | | | | | | | function without any arguments, i.e. 'int main()' and add support to test it" This reverts commit r322995, as it breaks lldb-Unit::SymbolFilePDBTests.TestTypedefs <http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/7715>. llvm-svn: 323102
* [SymbolFilePDB] Fix null array access when parsing the type of a function ↵Aaron Smith2018-01-191-15/+194
| | | | | | | | | | | | | | | | | | | | | | | | without any arguments, i.e. 'int main()' and add support to test it Summary: - Fix a null array access bug. This happens when creating the lldb type for a function that has no argument. - Implement SymbolFilePDB::ParseTypes method. Using `lldb-test symbols` will show all supported types in the target. - Create lldb types for variadic function, PDBSymbolTypePointer, PDBSymbolTypeBuiltin - The underlying builtin type for PDBSymbolTypeEnum is always `Int`, correct it with the very first enumerator's encoding if any. This is more accurate when the underlying type is not signed or another integer type. - Fix a bug when the compiler type is not created based on PDB_BuiltinType. For example, basic type `long` is of same width as `int` in a 32-bit target, and the compiler type of former one will be represented by the one generated for latter if using the default method. Introduce a static function GetBuiltinTypeForPDBEncodingAndBitSize to correct this issue. - Basic type `long double` and `double` have the same bit size in MSVC and there is no information in a PDB to distinguish them. The compiler type of the former one is represented by the latter's. - There is no line informaton about typedef, enum etc in a PDB and the source and line information for them are not shown. - There is no information about scoped enumeration. The compiler type is represented as an unscoped one. Reviewers: zturner, lldb-commits, davide, asmith Reviewed By: zturner, asmith Subscribers: llvm-commits, davide Differential Revision: https://reviews.llvm.org/D41427 llvm-svn: 322995
* [lldb] Add support to cache a PDB's global scope and fix a bug in getting ↵Aaron Smith2018-01-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the source file name for a compiland Summary: This commit is a combination of the following changes: - Cache PDB's global scope (executable) in SymbolFilePDB - Change naming of `cu` to `compiland` which is PDB specific - Change ParseCompileUnitForSymIndex to ParseCompileUnitForUID. Prefer using a common name `UID` instead of PDB's `System Index` Adding one more argument `index` to this method, which is used to specify the index of the compile unit in a cached compile unit array - Add GetPDBCompilandByUID method to simply code - Fix a bug in getting the source file name for a PDB compiland. For some reason, PDBSymbolCompiland::getSourceFileName() could return an empty name, so if that is true, we have to walk through all source files of this compiland and determine the right source file used to generate this compiland based on language indicated. The previous implementation called PDBSession::findOneSourceFile method to get its name for the compiland. This is not accurate since the `one source file` found could be a header other than source file. Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41428 llvm-svn: 322433
* [lldb] Stop searching for a symbol in a pdb by regexAaron Smith2017-12-221-0/+4
| | | | | | | | | | | | | | | | | Summary: It was possible when searching for a symbol by regex in a pdb that an invalid regex would cause an exception on Windows. This updates the code to avoid throwing an exception. When fixing the exception it was decided there is no reason to search for a symbol in a pdb by regex. To support this, SymbolFilePDB::FindTypes() now only searches for types by name and no longer calls FindTypesByRegEx(). Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41086 llvm-svn: 321344
* Support scoped enums in the DWARF AST parserTamas Berghammer2017-11-071-1/+1
| | | | | | | | Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D39545 llvm-svn: 317563
OpenPOWER on IntegriCloud