summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* [SymbolFilePDB] Run clang-format; NFCAaron Smith2018-03-224-120/+107
| | | | llvm-svn: 328176
* [SymbolFilePDB] Simplify code with newer methodsAaron Smith2018-03-202-16/+4
| | | | llvm-svn: 327927
* [SymbolFilePDB] Simplify getting the source file pathAaron Smith2018-03-202-66/+2
| | | | | | | | | | | | Summary: Replace SymbolFilePDB::GetSourceFileNameForPDBCompiland() with PDBSymbolCompiland::getSourceFileFullPath(). Reviewers: zturner, rnk, lldb-commits Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44456 llvm-svn: 327925
* [SymbolFilePDB] Remove a few null pointer checks by passing refAaron Smith2018-03-193-63/+46
| | | | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44455 llvm-svn: 327908
* Move the codebase to use: DWARFCompileUnit -> DWARFUnitJan Kratochvil2018-03-1825-204/+204
| | | | | | | | | | | | Now the codebase can use the DWARFUnit superclass. It will make it later seamlessly work also with DWARFPartialUnit for DWZ. This patch is only a search-and-replace easily undone, nothing interesting in it. Differential revision: https://reviews.llvm.org/D42892 llvm-svn: 327810
* DWARFUnit split out of DWARFCompileUnitJan Kratochvil2018-03-185-561/+796
| | | | | | | | | DW_TAG_partial_unit for DWZ can be then presented by DWARFPartialUnit also inherited from DWARFUnit. Differential revision: https://reviews.llvm.org/D40466 llvm-svn: 327809
* Fix the Windows build after r327750Frederic Riss2018-03-161-1/+1
| | | | llvm-svn: 327753
* [DWARFASTParserClang] Complete external record types before using them as a ↵Frederic Riss2018-03-161-0/+37
| | | | | | | | | | | | | | | | | | decl context. Summary: When in a gmodules-like debugging scenario, you can have a parent decl context that gets imported from an external AST. When this happens, we must be careful to complete this type before adding children to it, otherwise it sometimes results in a crash. Reviewers: clayborg, jingham Subscribers: aprantl, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43592 llvm-svn: 327750
* [SymbolFilePDB] Rewrite ParseTypes methodAaron Smith2018-03-141-19/+48
| | | | | | | | | | | | | | | | | | | | | Summary: The types for the compiland's children are parsed when parsing types for a PDB compiland. Global types also need to be parsed but unfortunately PDBs do not have compiland information about each global type. So we parse them all on the first call to ParseTypes. If a sc.function is provided then parse the types for that function. Otherwise parse the types for the overall sc.comp_unit. The ParseTypes method can be very slow if a program has a long list of compile units containing needed modules. Debugging clang-cl with lldb will show the problem. Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44253 llvm-svn: 327473
* [SymbolFilePDB] Keep searching until the file name is found for the pdb ↵Aaron Smith2018-03-091-2/+3
| | | | | | | | | | | | | | compiland Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44182 llvm-svn: 327162
* [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] Minor cleanupAaron Smith2018-03-071-22/+23
| | | | | | | | | | | | | | | | | | | Summary: - Remove unused code - Adding `break` statement conditionally - Ignore empty strings in FindTypeByName Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44165 llvm-svn: 326870
* [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
* Replace HashStringUsingDJB with llvm::djbHashPavel Labath2018-02-233-43/+42
| | | | | | | | | | | | | | | | | | | | | | Summary: The llvm function is equivalent to this one. Where possible I tried to replace const char* with llvm::StringRef to avoid extra strlen computations. In most places, I was able to track the c string back to the ConstString it was created from. I also create a test that verifies we are able to lookup names with unicode characters, as a bug in the llvm compiler (it accidentally used a different hash function) meant this was not working until recently. This also removes the unused ExportTable class. Reviewers: aprantl, davide Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43596 llvm-svn: 325927
* 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
* Remove dead code for handling DWARF pubnamesAdrian McCarthy2018-02-127-540/+0
| | | | | | | | | | | | Summary: LLDB doesn't use this code, the code has no tests, and the code does suspicious things like hashing pointers to strings instead of the strings themselves. Subscribers: sanjoy, mgorny, JDevlieghere Differential Revision: https://reviews.llvm.org/D43202 llvm-svn: 324925
* Fix some warnings in SymbolFilePDB.cppPavel Labath2018-02-091-7/+6
| | | | llvm-svn: 324730
* [SymbolFilePDB] Add support for function symbolsAaron Smith2018-02-093-20/+749
| | | | | | | | | | | | | | | | | | | | | | | 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
* Remove function DW_DSC_value_to_namePavel Labath2018-02-072-12/+0
| | | | | | It is unused, and the underlying llvm function has been removed as well. llvm-svn: 324472
* refactor: DWARFCompileUnit::Producer -> DWARFProducerJan Kratochvil2018-02-053-18/+14
| | | | | | Differential revision: https://reviews.llvm.org/D42891 llvm-svn: 324275
* Remove unused Args variable, and #include of Args.h. NFC.Jim Ingham2018-02-011-2/+0
| | | | llvm-svn: 324008
* [lldb] Enable debugging of binaries with mixed (splitted/regular) dwarfDavide Italiano2018-01-311-3/+4
| | | | | | | This recommits the patch, now that I verified that the bot instability is due to something else. Sorry for the noise. llvm-svn: 323879
* Revert "[lldb] Enable debugging of binaries with mixed (splitted/regular) dwarf"Davide Italiano2018-01-311-4/+3
| | | | | | It might have caused some instability on the bots. llvm-svn: 323845
* [lldb] Enable debugging of binaries with mixed (splitted/regular) dwarfAlexander Shaposhnikov2018-01-301-3/+4
| | | | | | | | | | | | | | Initialize the default value of SymbolFileDWARF uuid with the appropriately shifted DW_INVALID_OFFSET constant. This change fixes the collision in the computation of DIE uid (inside DIERef::GetUID) and incorrect CompileUnit lookup (because of the misleading cu_offset value). Test plan: make check-lldb Differential revision: https://reviews.llvm.org/D42563 llvm-svn: 323832
* [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
* Remove unused class declarationsJan Kratochvil2018-01-272-6/+0
| | | | | | | | Simplification by removing excessive DWARFCompileUnit references for D40466 . Differential revision: https://reviews.llvm.org/D42613 llvm-svn: 323586
* [SymbolFilePDB] Fix null array access when parsing the type of a function ↵Aaron Smith2018-01-232-19/+229
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [lldb] Fix some C++ virtual method call bugs in LLDB expression evaluation byLang Hames2018-01-221-0/+88
| | | | | | | | | | | | | | | | | | | building method override tables for CXXMethodDecls in DWARFASTParserClang::CompleteTypeFromDWARF. C++ virtual method calls in LLDB expressions may fail if the override table for the method being called is not correct as IRGen will produce references to the wrong (or a missing) vtable entry. This patch does not fix calls to virtual methods with covariant return types as it mistakenly treats these as overloads, rather than overrides. This will be addressed in a future patch. Review: https://reviews.llvm.org/D41997 Partially fixes <rdar://problem/14205774> llvm-svn: 323163
* Revert "[SymbolFilePDB] Fix null array access when parsing the type of a ↵Pavel Labath2018-01-222-229/+19
| | | | | | | | | | 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
* Make loop counter unsigned in SymbolFilePDB::GetCompileUnitIndexRaphael Isemann2018-01-221-1/+1
| | | | | | | | | | | | | | Summary: This fixes a clang warning. Reviewers: zturner Reviewed By: zturner Subscribers: zturner, lldb-commits Differential Revision: https://reviews.llvm.org/D42345 llvm-svn: 323075
* Clean up #include "DWARFCompileUnit.h"Jan Kratochvil2018-01-214-3/+1
| | | | | | | | | Clean up needless+missing #include "DWARFCompileUnit.h" for split of DWARFCompileUnit to DWARFUnit as discussed in D40466. Differential revision: https://reviews.llvm.org/D42355 llvm-svn: 323069
* [SymbolFilePDB] Fix null array access when parsing the type of a function ↵Aaron Smith2018-01-192-19/+229
| | | | | | | | | | | | | | | | | | | | | | | | 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-133-72/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Look for external types in all clang modules imported by the current symbol ↵Adrian Prantl2018-01-043-51/+86
| | | | | | | | | | | | | file. This fixes a bug in -gmodules DWARF handling when debugging without a .dSYM bundle that was particularly noticable when debugging LLVM itself. Debugging without clang modules and DWO handling should be unaffected by this patch. <rdar://problem/32436209> llvm-svn: 321802
* Remove duplicate declaration from D41550; NFC Aaron Smith2017-12-281-4/+0
| | | | llvm-svn: 321514
* Update failing PDB unit tests that are searching for symbols by regexAaron Smith2017-12-281-0/+4
| | | | | | | | | | | | Summary: D41086 fixed an exception in FindTypes()/FindTypesByRegex() and caused two lldb unit test to fail. This change updates the unit tests to pass again. Reviewers: zturner, lldb-commits, labath, clayborg, asmith Reviewed By: asmith Differential Revision: https://reviews.llvm.org/D41550 llvm-svn: 321511
* [lldb] Stop searching for a symbol in a pdb by regexAaron Smith2017-12-223-15/+17
| | | | | | | | | | | | | | | | | 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
* Enable more abilities in SymbolFilePDBAaron Smith2017-12-221-2/+45
| | | | | | | | | | | | | | | | Summary: 1) Finding symbols through --symfile 2) More abilities: Functions, Blocks, GlobalVariables, LocalVariables, VariableTypes Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41092 llvm-svn: 321327
* Bring clang options in error messages up to date.Adrian Prantl2017-12-211-4/+4
| | | | llvm-svn: 321322
* ObjectFile: remove ReadSectionData/MemoryMapSectionData mutual recursionPavel Labath2017-12-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: These two functions were calling each other, while handling different branches of the if(IsInMemory()). This had a reason at some point in the past, but right now it's just confusing. I resolve this by removing the MemoryMapSectionData function and inlining the !IsInMemory branch into ReadSectionData. There isn't anything mmap-related in this function anyway, as the decision whether to mmap is handled at a higher level. This is a preparatory step to make ObjectFileELF be able to decompress compressed sections (I want to make sure that all calls reading section data are routed through a single piece of code). Reviewers: clayborg Subscribers: emaste, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D41169 llvm-svn: 320705
* Prevent vain lldb::user_id_t 0xffffffff lookupsJan Kratochvil2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I have found LLDB commonly looks up lldb::user_id_t 0xffffffff failing to find its DIE. One would rather expect LLDB_INVALID_UID == 0xffffffffffffffff in such case. DWARFASTParserClang.cpp:495 492 type_sp.reset( 493 new Type(die.GetID(), dwarf, type_name_const_str, byte_size, NULL, 494 DIERef(encoding_uid).GetUID(dwarf), encoding_data_type, 495 &decl, clang_type, resolve_state)); encoding_uid = (DWARFFormValue) {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}} -> DIERef::DIERef(const DWARFFormValue &form_value = {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}}) -> (DIERef) {cu_offset = 0xffffffff, die_offset = 0xffffffff} -> lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf = 0x61d00000b480) const -> Type::Type(lldb::user_id_t encoding_uid = 0xffffffff) But 0xffffffff != #define LLDB_INVALID_UID UINT64_MAX Differential revision: https://reviews.llvm.org/D37492 llvm-svn: 319580
* ClangASTContext::ParseClassTemplateDecl doesn't always succeed.Jim Ingham2017-12-011-1/+11
| | | | | | | | | When it does, it returns a NULL ClassTemplateDecl. Don't use it if it is NULL... <rdar://problem/35672107> llvm-svn: 319516
* refactor: Simplify loop with DWARFCompileUnit::ExtractJan Kratochvil2017-11-301-6/+2
| | | | | | | | Forgotten small simplification in D40212. Differential revision: https://reviews.llvm.org/D40635 llvm-svn: 319402
* refactor: Unify+simplify DWARFCompileUnit ctor+Clear() into in-class ↵Jan Kratochvil2017-11-294-80/+47
| | | | | | | | | | | | | | initializers + Extract() It has no functionality effect. I was concerned about the worse performance of DWARFDebugInfo::Parse this way of allocating+destroying a CU for each iteration but I see it is now used only by DWARFDebugInfo::Dump so that is no longer a problem. Differential revision: https://reviews.llvm.org/D40212 llvm-svn: 319359
* Due to changes for DWZ I would need to update those such as renaming it toJan Kratochvil2017-11-252-27/+0
| | | | | | | | SetFileOffset. Differential revision: https://reviews.llvm.org/D40458 llvm-svn: 318981
* Remove 2 unused methods DWARFDebugInfo::Find and their FindCallbackStringJan Kratochvil2017-11-192-81/+0
| | | | | | Differential revision: https://reviews.llvm.org/D40216 llvm-svn: 318631
* Add comments to DWARFCompileUnit length fields/methodsJan Kratochvil2017-11-191-9/+8
| | | | | | Differential revision: https://reviews.llvm.org/D40211 llvm-svn: 318626
* [lldb] Ensure that dwo/dwp are not double-indexedAlexander Shaposhnikov2017-11-175-3/+42
| | | | | | | | | | | | | DWO/DWP should not be indexed directly. Instead, the corresponding base file should be used. This diff adds an assert to DWARFCompileUnit::Index and adjusts the methods SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE, SymbolFileDWARF::GetObjCMethodDIEOffsets accordingly. Differential revision: https://reviews.llvm.org/D39825 llvm-svn: 318554
* Move ArchSpec to the Utility modulePavel Labath2017-11-131-1/+1
| | | | | | | | | | | | | The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module. This commit touches many files, but most of it is just renaming of #include lines. In a couple of cases, I removed the #include ArchSpec line altogether, as the file was not using it. In one or two places, this necessitated adding other #includes like lldb-private-defines.h. llvm-svn: 318048
OpenPOWER on IntegriCloud