summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* Trying to submit 254476 one more time. This implement -gmodule debugging ↵Greg Clayton2015-12-087-68/+490
| | | | | | | | | | | | | | support. It was previously reverted due to issues that showed up only on linux. I was able to reproduce these issues and fix the underlying cause. So this is the same patch as 254476 with the following two fixes: - Fix not trying to complete classes that don't have external sources - Fix ClangASTSource::CompleteType() to check the decl context of types that it finds by basename to ensure we don't complete a type "S" with a type like "std::S". Before this fix ClangASTSource::CompleteType() would accept _any_ type that had a matching basename and copy it into the other type. <rdar://problem/22992457> llvm-svn: 254980
* Revert "Added support for -gmodule debugging when debug info is left in the ↵Tamas Berghammer2015-12-027-491/+68
| | | | | | | | | .o files on Darwin." The commit caused a test failure on the linux buildbot in TestDataFormatterSynthVal. llvm-svn: 254502
* Added support for -gmodule debugging when debug info is left in the .o files ↵Greg Clayton2015-12-027-68/+491
| | | | | | | | | | | | | | | | | | | | on Darwin. This is done by finding the types that are forward declarations that come from a module, and loading that module's debug info in a separate lldb_private::Module, and copying the type over into the current module using a ClangASTImporter object. ClangASTImporter objects are already used to copy types from on clang::ASTContext to another for expressions so the type copying code has been around for a while. A new FindTypes variant was added to SymbolVendor and SymbolFile: size_t SymbolVendor::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types); size_t SymbolVendor::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types); The CompilerContext is a way to represent the exact context of a type and pass it through an agnostic API boundary so that we can find that exact context elsewhere in another file. This was required here because we can have a module that has submodules, both of which have a "foo" type. I am not able to add tests for this yet as we currently don't build our C/C++/ObjC binaries with the clang binary that we build. There are some driver issues where it can't find the header files for the C and C++ standard library which makes compiling these tests hard. We can't also guarantee that if we are building with clang that it supporst the exact format of -gmodule debugging that we are trying to test. We have had other versions of clang that had a different implementation of -gmodule debugging that we are no longer supporting, so we can't enable tests if we are building with clang without compiling something and looking at the structure of the DWARF that was generated to ensure that it is the format we can actually use. llvm-svn: 254476
* Use uniqueness of C++ fully-qualified names to resolve conflictsRamkumar Ramachandra2015-11-121-55/+67
| | | | | | | | | | | | | | | | | | A very expected layout: source tree is in ~/src/llvm, the build directory is in ~/src/llvm-build, and the install location is in /usr/local/{lib,include}. The DWARF information in /usr/local/lib/libLLVM.a for ilist.h points to ~/src/llvm-build/include/llvm/ADT/ilist.h. Now, when someone includes "llvm/ADT/ilist.h" and links against /usr/local/lib/libLLVM.a. Disaster. The DWARF information in libUser.so for ilist.h points to two locations: the one in /usr/include, and the one in ~/src/llvm-build/include. LLDB gets confused. Let's uniquify fully-qualified names and never trip on such a thing. Differential Revision: http://reviews.llvm.org/D14549 llvm-svn: 252898
* Differential Revision: http://reviews.llvm.org/D14538Aidan Dodds2015-11-101-1/+1
| | | | llvm-svn: 252605
* Revert r252001 as it brake TestCppIncompleteTypes on all platformsTamas Berghammer2015-11-041-17/+0
| | | | llvm-svn: 252067
* With the new modules debugging, we have seen cases where clang is not ↵Greg Clayton2015-11-031-0/+17
| | | | | | emitting full definitions for types that are member variables of classes. If we try to make a class with a member where the type of the class in a forward declaration, clang will assert and crash and bring down the IDE. This is not acceptable so we need to work around it. We work around it by making sure that if we have a member that is an instance (not a pointer or reference) of a class/struct/union, that it is a complete type. If it isn't then we emit an error to let the user know to file a bug against the compiler, and then we make the class complete, but empty. We also do this for base classes elsewhere. We use the DWARF to help layout the type, so we will get all instance variables correct, but we just won't have visibility into this instance variable. llvm-svn: 252001
* Changes for Bug 25251Ravitheja Addepally2015-11-032-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The solution to bug 24074,rL249673 needed to parse the function information from the Dwarf in order to set the SymbolContext. For that, GetFunction was called for the parent in GetTypeForDIE, which parses the ChildParameters and in the flow, GetTypeForDIE was called for one of the sibling die and so an infinite loop was triggered by calling GetFunction repeatedly for the same function. The changes in this revision modify the GetTypeForDIE to only resolve the function context in the Type Lookup flow and so prevent the infinite loop. A testcase has also been added to check for regression in the future and a test vector had been added to the testcase of 24074. Reviewers: jingham, tberghammer, clayborg Differential Revision: http://reviews.llvm.org/D14202 llvm-svn: 251917
* Fix an API missues in ParseTypeFromDWARFTamas Berghammer2015-10-261-1/+1
| | | | | | | The arguments for ClangASTContext::CreateMemberPointerType was passed in in the wrong order. llvm-svn: 251319
* Re-use prologue parsing code that was already written instead of having two ↵Greg Clayton2015-10-262-66/+37
| | | | | | | | copies of code that parse line table prologues. Also since we always read in the DWARF data or mmap it, we don't need to make a copy of the strings for the directories and file names, we can just store "cosnt char *" values. Every place that uses the prologues use them temporarily and then throw them away so no one is expecting the directory and filename strings to live longer than the parse functions. llvm-svn: 251310
* Fix a fission expression evaluation issueTamas Berghammer2015-10-263-1/+10
| | | | | | | This fix should eliminate the duplicate definition errors when debug info is available in multiple dwo symbol file for the same type. llvm-svn: 251282
* Re-commit "Make dwarf parsing multi-threaded"Tamas Berghammer2015-10-233-22/+78
| | | | | | | | | | | | | | | Re-commit the change after fixing a lot of race condition in LLDB exposed by this change Loading the debug info from a large application is the slowest task LLDB do. This CL makes most of the dwarf parsing code multi-threaded. As a result the speed of "attach; backtrace; exit;" when the inferior is an LLDB with full debug info increased by a factor of 2. Differential revision: http://reviews.llvm.org/D13662 llvm-svn: 251106
* Make SymbolFileDWARF::GetCachedSectionData thread safeTamas Berghammer2015-10-224-151/+94
| | | | | | Differential revision: http://reviews.llvm.org/D13942 llvm-svn: 251007
* Revert "Make dwarf parsing multi-threaded"Tamas Berghammer2015-10-203-71/+23
| | | | | | | | | Revert it bacuse it introduces several race condition detected by the build bots. This reverts commit 5107a5ebdb7c4571a30a7098b40bf8098b678447. llvm-svn: 250832
* Make dwarf parsing multi-threadedTamas Berghammer2015-10-203-23/+71
| | | | | | | | | | | | Loading the debug info from a large application is the slowest task LLDB do. This CL makes most of the dwarf parsing code multi-threaded. As a result the speed of "attach; backtrace; exit;" when the inferior is an LLDB with full debug info increased by a factor of 2 (on my machine). Differential revision: http://reviews.llvm.org/D13662 llvm-svn: 250821
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-196-136/+117
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13840 llvm-svn: 250721
* Silence -Wqual-cast warnings from GCC 5.2Saleem Abdulrasool2015-10-181-1/+1
| | | | | | | | There were a number of const qualifiers being cast away which caused warnings. This cluttered the output hiding real errors. Silence them by explicit casting. NFC. llvm-svn: 250662
* Silence some -Wunused-but-set-variable with gcc 5.2.0Saleem Abdulrasool2015-10-181-4/+2
| | | | | | Cleanup some unused variables. NFC. llvm-svn: 250661
* Fix broken assert in DWARFDIE.cpp on OS XTodd Fiala2015-10-151-1/+1
| | | | | | | See: http://reviews.llvm.org/D13777 llvm-svn: 250426
* Fix a crash, an UB and add some assert to dwo symbol file handlingTamas Berghammer2015-10-094-0/+15
| | | | llvm-svn: 249827
* Testcase and fix for bug 24074Ravitheja Addepally2015-10-084-4/+17
| | | | | | | | | | | | | | | | | | | | Summary: In bug 24074, the type information is not shown correctly. This commit includes the following - -> Changes for displaying correct type based on current lexical scope for the command "image lookup -t" -> The corresponding testcase. -> This patch was reverted due to segfaults in FreeBSD and Mac, I fixed the problems for both now. Reviewers: emaste, granata.enrico, jingham, clayborg Differential Revision: http://reviews.llvm.org/D13290 llvm-svn: 249673
* [DWARFASTParserClang] Strengthen incomplete type handling.Siva Chandra2015-10-071-47/+84
| | | | | | | | | | | | Summary: This change fixes pr24916. As associated test has been added. Reviewers: clayborg Subscribers: zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D13224 llvm-svn: 249629
* Fix the TestCppNsImport test case for DWARF. It was failing for DWARF in .o ↵Greg Clayton2015-10-072-0/+11
| | | | | | | | | | | files because SymbolFileDWARFDebugMap didn't implement the following function: void ParseDeclsForContext (lldb_private::CompilerDeclContext decl_ctx) override; Now it does and the test works. llvm-svn: 249626
* Remove instance reference of static member function.Zachary Turner2015-10-021-9/+8
| | | | llvm-svn: 249207
* Moved more Clang-specific parts of the expression parser into the Clang plugin.Sean Callanan2015-09-251-1/+1
| | | | | | | | | There are still a bunch of dependencies on the plug-in, but this helps to identify them. There are also a few more bits we need to move (and abstract, for example the ClangPersistentVariables). llvm-svn: 248612
* Rename clang_type -> compiler_type for variables.Bruce Mitchener2015-09-2410-57/+57
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13102 llvm-svn: 248461
* Revert 248366 "Testcase and fix for bug 24074"Enrico Granata2015-09-234-17/+4
| | | | | | This commit introduced regressions in several test cases on FreeBSD and Mac OS X llvm-svn: 248421
* DWARFASTParserClang::CompleteTypeFromDWARF: Handle incomplete baseclass or childSiva Chandra2015-09-232-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this change DWARFASTParserClang::CompleteTypeFromDWARF returns false if DWARFASTParserClang::ParseChildMembers returns false. Similarly, it returns false if any base class is of an incomplete type. This helps in cases like these: class Foo { public: std::string str; }; ... Foo f; If a file with the above code is compiled with a modern clang but without the -fno-limit-debug-info (or similar) option, then the DWARF has only a forward declration for std::string. In which case, the type for "class Foo" cannot be completed. If LLDB does not detect that a child member has incomplete type, then it wrongly conveys to clang (the LLDB compiler) that "class Foo" is complete, and consequently crashes due to an assertion failure in clang when running commands like "p f" or "frame var f". Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13066 llvm-svn: 248401
* Testcase and fix for bug 24074Ravitheja Addepally2015-09-234-4/+17
| | | | | | | | | | | | | | | | Summary: In bug 24074, the type information is not shown correctly. This commit includes the following - -> Changes for displaying correct type based on current lexical scope for the command "image lookup -t" -> The corresponding testcase. Reviewers: jingham, ovyalov, spyffe, richard.mitton, clayborg Differential Revision: http://reviews.llvm.org/D12404 llvm-svn: 248366
* Rename clang_type_t to opaque_compiler_type_t.Bruce Mitchener2015-09-221-2/+2
| | | | | | | | | | | | | | Summary: This is no longer related to Clang and is just an opaque pointer to data for a compiler type. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13039 llvm-svn: 248288
* [LLDB][MIPS] microMIPS breakpoints, disassembly and compressed addressesJaydeep Patil2015-09-221-1/+24
| | | | | | | | | | | | SUMMARY: This patch detects microMIPS symbols, sets breakpoints using un-compressed address and display disassembly in mixed mode for microMIPS applications (running on bare-iron targets). Reviewers: clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D12079 llvm-svn: 248248
* Further reduction of Clang-related header inclusion.Bruce Mitchener2015-09-215-3/+5
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13018 llvm-svn: 248176
* Reduce inclusion of clang headers.Bruce Mitchener2015-09-183-18/+0
| | | | | | | | | | | | | | Summary: With the recent changes to separate clang from the core structures of LLDB, many inclusions of clang headers can be removed. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12954 llvm-svn: 248004
* TypeSystem is now a plugin interface and removed any "ClangASTContext ↵Greg Clayton2015-09-176-34/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | &Class::GetClangASTContext()" functions. This cleans up type systems to be more pluggable. Prior to this we had issues: - Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()" - Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem - Cleaned up Module so that it no longer has dedicated type system member variables: lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module. lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module. Now we have a type system map: typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap; TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module - Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract: class CompilerType { ... //---------------------------------------------------------------------- // Return a new CompilerType that is a L value reference to this type if // this type is valid and the type system supports L value references, // else return an invalid type. //---------------------------------------------------------------------- CompilerType GetLValueReferenceType () const; //---------------------------------------------------------------------- // Return a new CompilerType that is a R value reference to this type if // this type is valid and the type system supports R value references, // else return an invalid type. //---------------------------------------------------------------------- CompilerType GetRValueReferenceType () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a const modifier to this type if // this type is valid and the type system supports const modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddConstModifier () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a volatile modifier to this type if // this type is valid and the type system supports volatile modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddVolatileModifier () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a restrict modifier to this type if // this type is valid and the type system supports restrict modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddRestrictModifier () const; //---------------------------------------------------------------------- // Create a typedef to this type using "name" as the name of the typedef // this type is valid and the type system supports typedefs, else return // an invalid type. //---------------------------------------------------------------------- CompilerType CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const; }; Other changes include: - Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);" - Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed llvm-svn: 247953
* Fix caching for clang::Decl in DWARFASTParserClangPaul Herman2015-09-171-4/+22
| | | | | | | | | | Reviewers: sivachandra, chaoren, clayborg, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12942 llvm-svn: 247923
* Add using directives to the clang::DeclContext and fix decls for variables ↵Paul Herman2015-09-166-4/+50
| | | | | | | | | | | | | | inside namespaces Summary: Supports the parsing of the "using namespace XXX" and "using XXX::XXX" directives. Added ambiguity errors when it two decls with the same name are encountered (see comments in TestCppNsImport). Fixes using directives being duplicated for anonymous namespaces. Fixes GetDeclForUID for specification DIEs. Reviewers: sivachandra, chaoren, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12897 llvm-svn: 247836
* Add newline at end of file to avoid compiler warning.Greg Clayton2015-09-161-1/+1
| | | | llvm-svn: 247823
* Add support for the DWARFLocationList used by split-dwarfTamas Berghammer2015-09-1611-339/+32
| | | | | | | | | Split-dwarf uses a different header format to specify the address range for the elements of the location lists. Differential revision: http://reviews.llvm.org/D12880 llvm-svn: 247789
* Search variables based on clang::DeclContext and clang::Decl treePaul Herman2015-09-156-10/+197
| | | | | | | | | | | | Summary: SymbolFileDWARF now creates VarDecl and BlockDecl and adds them to the Decl tree. Then, in ClangExpressionDeclMap it uses the Decl tree to search for a variable. This fixes lots of variable scoping problems. Reviewers: sivachandra, chaoren, spyffe, clayborg Subscribers: tberghammer, jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D12658 llvm-svn: 247746
* Add support for DW_OP_GNU_const_index to dwarf expressionTamas Berghammer2015-09-151-0/+1
| | | | | | | | DW_OP_GNU_const_index is a new opcode used when split dwarf is enabled Differential revision: http://reviews.llvm.org/D12849 llvm-svn: 247672
* Fix several issues arount dwo symbol file handlingTamas Berghammer2015-09-154-8/+30
| | | | | | Differential revision: http://reviews.llvm.org/D12804 llvm-svn: 247671
* Darwin has a debug info format that stores module types in stand alone files ↵Greg Clayton2015-09-141-2/+5
| | | | | | and it uses some of the DWO attributes. Don't assert in SymbolFileDWARFDwo, just return null so everything works. llvm-svn: 247638
* Remove include that isn't needed.Greg Clayton2015-09-141-1/+0
| | | | llvm-svn: 247630
* Add a TypeSystem for GoRyan Brown2015-09-145-2/+907
| | | | | | | | Add GoASTContext and DWARFASTParserGo to support go. Differential Revision: http://reviews.llvm.org/D12585 llvm-svn: 247629
* Remove a debugging printf that got left in SymbolFileDWARFDebugMap.Jim Ingham2015-09-141-1/+0
| | | | llvm-svn: 247589
* Fix a possible SEGV in SymbolFileDWARFTamas Berghammer2015-09-141-4/+5
| | | | | | | | The iterator pointing to an element of a dense map was used after the element from was removed from the map what isn't guaranteed to be valid at that time. llvm-svn: 247571
* Add basic fission support to SymbolFileDWARFTamas Berghammer2015-09-0921-512/+989
| | | | | | | | | | | | | * Create new dwo symbol file class * Add handling for .dwo sections * Change indexes in SymbolFileDWARF to store compile unit offset next to DIE offset * Propagate queries from dwarf compile unit to the dwo compile unit where applicable Differential revision: http://reviews.llvm.org/D12291 llvm-svn: 247132
* Code cleanup in preparation of adding split dwarf supportTamas Berghammer2015-09-098-859/+865
| | | | | | | | | | | | * Remove some unused code * Remove usage of DWARFDebugInfoEntry::Attributes where usage isn't reasonable * Cleanup DWARFMappedHash with separating it to header and implementation file and fixing the visibility of the functions Differential revision: http://reviews.llvm.org/D12374 llvm-svn: 247131
* Use LLVM casting for TypeSystem so you can cast it to subclasses.Greg Clayton2015-09-081-3/+2
| | | | | | | | | | | | | | This will keep our code cleaner and it removes the need for intrusive additions to TypeSystem like: class TypeSystem { virtual ClangASTContext * AsClangASTContext() = 0; } As you can now just use the llvm::dyn_cast and other casts. llvm-svn: 247041
* Check for null compile unit so we don't crash.Greg Clayton2015-09-041-0/+3
| | | | llvm-svn: 246887
OpenPOWER on IntegriCloud