summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a SIGSEGV caused by dereferencing a pointer without a null checkBryan Chan2016-05-041-2/+2
| | | | llvm-svn: 268520
* Import block pointers from DWARF as Clang block pointers, not as structs.Sean Callanan2016-05-021-0/+38
| | | | | | | | | Also added a data formatter that presents them as structs if you use frame variable to look at their contents. Now the blocks testcase works. <rdar://problem/15984431> llvm-svn: 268307
* Watch out for compilers that generate bad bitfield info. If the bit size of ↵Greg Clayton2016-04-291-1/+18
| | | | | | | | | a bitfield member doesn't lie within the bit bounds of the type itself, just leave it out so we don't get clang asserting and killing our IDE when it gets unhappy with the information. https://llvm.org/bugs/show_bug.cgi?id=27515 <rdar://problem/21082998> llvm-svn: 268110
* Make sure LLDB can deal with forward declarations to enums without crashing ↵Greg Clayton2016-04-291-3/+12
| | | | | | | | or asserting. <rdar://problem/23776428> llvm-svn: 268098
* Make sure that the following SymbolFileDWARF functions can handle getting a ↵Greg Clayton2016-04-252-9/+57
| | | | | | | | | | | | | | | | | | | | lldb::user_id_t for another SymbolFileDWARF: CompilerDecl SymbolFileDWARF::GetDeclForUID (lldb::user_id_t type_uid); CompilerDeclContext SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid) CompilerDeclContext SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid) Type* SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid) <rdar://problem/25592223> llvm-svn: 267494
* DWARF layout for bitfields is wrong when the bit offset is negative. Greg Clayton2016-04-221-3/+3
| | | | | | | | Some older versions of clang emitted bit offsets that were negative and these bitfields would have their bitfield-ness stripped off and it would cause a clang assertion in clang assertions were enabled. I updated the bitfield C test to make sure we don't regress. <rdar://problem/21082998> llvm-svn: 267248
* Fixed in issue with ObjectFileMachO where it would add empty sections to the ↵Greg Clayton2016-04-222-3/+14
| | | | | | | | section list that was used to try and cap symbols to the max address of the section in which it is contained. The empty sections would make cap the symbols and make their sizes zero. Also fixed a few other things that could cause problems in the SymbolFileDWARFDebugMap when zero sized symbols were found and used to make OSO range map entries. <rdar://problem/25886773> llvm-svn: 267237
* When making an array or stuct/union/class elements, make sure the type is ↵Greg Clayton2016-04-201-1/+28
| | | | | | | | complete. If the type isn't complete, complete the type so that clang won't assert and kill your program. Since the DWARF assists in doing layout, it won't show the array or struct/unions/class elements correctly, but it will stop you from crashing if you have a struct/union/class that contains one of these arrays. <rdar://problem/25057391> llvm-svn: 266922
* Fixed an issue where if we have DWARF in an executable that has multiple ↵Greg Clayton2016-04-013-3/+27
| | | | | | | | | | | | | | languages where these languages use different type systems, you can end up trying to find the actualy definition for a forward declaration for a type, you will call: TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &dwarf_decl_ctx); The problem was we might be looking for a type "Foo", and find one from another langauge. Then the DWARFASTParserClang would try to make an AST type using a CompilerType that might return an empty. This fix makes sure that when we create a DWARFDeclContext from a DWARFDIE that the DWARFDeclContext we set the language of the DIE. Then when we go to find matches for DWARFDeclContext, we end up with bunch of DIEs. We check each DWARFDIE that we found by asking it for its language and making sure the language is compatible with the type system that we want to use. This keeps us from using the wrong types to resolve forward declarations. <rdar://problem/25276165> llvm-svn: 265196
* Change a recently added assert into lldbassertPavel Labath2016-04-011-1/+2
| | | | llvm-svn: 265124
* Fix DWO breakage in r264909Pavel Labath2016-03-314-3/+13
| | | | | | | | | | | | | | | | | | | Summary: In case of Dwo, DIERef stores a compile unit offset in the main object file, and not in the dwo. The implementation of SymbolFileDWARFDwo::GetDIE inherited from SymbolFileDWARF tried to lookup the compilation unit in the DWO based on the main object file offset (and failed). I change the implementation to verify the DIERef indeed references compile unit belonging to this dwo and then lookup the die based on the die offset alone. Includes a couple of fixes for mismatched struct/class tags. Reviewers: tberghammer, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18646 llvm-svn: 265011
* When support for DWO files was added, there were two ways to pass ↵Greg Clayton2016-03-3018-333/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb::user_id_t out to the rest of LLDB: 1 - DWARF in .o files with debug map in executable: we would place the compile unit index in the upper 32 bits of the 64 bit value and the lower 32 bits would be the DIE offset 2 - DWO: we would place the compile unit offset in the upper 32 bits of the 64 bit value and the lower 32 bits would be the DIE offset There was a mixing and matching of this and it wasn't done consistently. Major changes include: The DIERef constructor that takes a lldb::user_id_t now requires a SymbolFileDWARF: DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf) It is needed so that it can be decoded correctly. If it is DWARF in .o files with debug map in executable, then we get the right compile unit from the SymbolFileDWARFDebugMap, otherwise, we use the compile unit offset and DIE offset for DWO or normal DWARF. The function: lldb::user_id_t DIERef::GetUID() const; Now becomes lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf) const; Again, we need the DWARF file to encode it correctly. This removes the need for "lldb::user_id_t SymbolFileDWARF::MakeUserID() const" and for bool SymbolFileDWARF::UserIDMatches (lldb::user_id_t uid) const". There were also many places were doing things inneficiently like: 1 - encode a dw_offset_t into a lldb::user_id_t 2 - call the public SymbolFile interface to resolve types using the lldb::user_id_t 3 - This would then decode the lldb::user_id_t into a DIERef, and then try to find that type. There are many places that are now doing this more efficiently by storing DW_AT_type form values as DWARFFormValue objects and then making a DIERef from them and directly calling the underlying function to resolve the lldb_private::Type, lldb_private::CompilerType, lldb_private::CompilerDecl, lldb_private::CompilerDeclContext. If there are any regressions in DWARF with DWO, we will need to fix any issues that arise since the original patch wasn't functional for the much more widely used DWARF in .o files with debug map. <rdar://problem/25200976> llvm-svn: 264909
* Fix infinite recursion in DWO file parsingPavel Labath2016-03-294-37/+45
| | | | | | | | | | | | | | | | | | Summary: Since r264316, clang started adding DW_AT_GNU_dwo_name attribute to dwo files (previously, this attribute was only present in main object files), breaking pretty much every dwo test. The problem was that we were treating the presence of said attribute as a signal that we should look for information in an external object file, and caused us to enter an infinite loop. I fix this by making sure we do not go looking for an external dwo file if we already *are* parsing a dwo file. Reviewers: tberghammer, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18547 llvm-svn: 264729
* Move some functions from DWARFASTParserClang to ClangASTImporter.Zachary Turner2016-03-284-170/+61
| | | | | | | | | | | | | | | | | | This allows these functions to be re-used by a forthcoming PDBASTParser. The functions in question are CanCompleteType, CompleteType, and CanImport. Conceptually, these functions belong on ClangASTImporter anyway, and previously they were just ping ponging around through a few levels of indirection to end up there as well, so this patch actually makes the code somewhat simpler. A few methods were moved to a new file called ClangUtil, so that they can be shared between ClangASTImporter and ClangASTContext without creating a circular dependency between those two cpp files. Differential Revision: http://reviews.llvm.org/D18381 llvm-svn: 264685
* Fixed an case fall through that wasn't meant to happen. Caught by clang's ↵Greg Clayton2016-03-181-7/+8
| | | | | | unannotated case fall through warning. llvm-svn: 263826
* Fixed a bug where DW_AT_start_scope would fall through to DW_AT_artificial ↵Greg Clayton2016-03-181-32/+33
| | | | | | in SymbolFileDWARF::ParseVariableDIE(). This was caught by the clang warning that catches unannotated case fall throughs. llvm-svn: 263824
* [DWARFASTParserClang] Start with member offset of 0 for members of union types.Siva Chandra2016-03-101-1/+1
| | | | | | | | | | | | | | | Summary: GCC does not emit DW_AT_data_member_location for members of a union. Starting with a 0 value for member locations helps is reading union types in such cases. Reviewers: clayborg Subscribers: ldrumm, lldb-commits Differential Revision: http://reviews.llvm.org/D18008 llvm-svn: 263085
* SymbolFileDWARFDebugMap::FindTypes didn't obey the max_matches flag, Jim Ingham2016-02-261-1/+4
| | | | | | | but kept looking through .o files even after it had found as many matches as were requested. llvm-svn: 262051
* Add a set of new plugins to handle Java debuggingTamas Berghammer2016-02-266-3/+656
| | | | | | | | | The purpose of these plugins is to make LLDB capable of debugging java code JIT-ed by the android runtime. Differential revision: http://reviews.llvm.org/D17616 llvm-svn: 262015
* Add support for DW_OP_push_object_address in dwarf expressionsTamas Berghammer2016-02-263-13/+14
| | | | | | | | | Additionally fix the type of some dwarf expression where we had a confusion between scalar and load address types after a dereference. Differential revision: http://reviews.llvm.org/D17604 llvm-svn: 262014
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-262-1/+3
| | | | | | the right thing and break. llvm-svn: 261950
* Handle the case when a variable is only valid in part of the enclosing scopeTamas Berghammer2016-02-251-9/+42
| | | | | | | | | | | DWARF stores this information in the DW_AT_start_scope attribute. This CL add support for this attribute and also changes the functions displaying frame variables to only display the variables currently in scope. Differential revision: http://reviews.llvm.org/D17449 llvm-svn: 261858
* Fixed a problem where the DWARF for inline functions was mis-parsed.Sean Callanan2016-02-231-34/+63
| | | | | | | | | | | | | | | | | | | Inline functions in DWARF have AT_abstract_origin set, but we only handled that if the functions were C++ methods. Inline functions -- C or C++ -- have this also, and as a result they got one FunctionDecl for each inlined instance. When going to construct the locals, this meant that the arguments (which did properly have their abstract origins handled) would get associated with the master FunctionDecl, and the inlined FunctionDecls would all appear to have no locals. This manifested as not being able to look up local variables when stopped in an inline fuunction. We should have had a test for this, but somewhere along the line the relevant test case lost its .py file (or it never had one). This patch fixes this problem and restores the .py file. <rdar://problem/24712434> llvm-svn: 261598
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-163-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* Don't crash if we have a DIE that has a DW_AT_ranges attribute and yet the ↵Greg Clayton2016-02-121-5/+13
| | | | | | | | SymbolFileDWARF doesn't have a DebugRanges. If this happens print a nice error message to prompt the user to file a bug and attach the offending DWARF file so we can get the correct compiler fixed. <rdar://problem/24458016> llvm-svn: 260626
* Removed a bad assertion:Greg Clayton2016-02-111-2/+4
| | | | | | | | | | | assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) && "Adding incorrect type to forward declaration map"); The problem is that "m_ast.GetSymbolFile()" can return a SymbolFileDWARFDebugMap. The code is doing the right thing if the assertion is ignored. <rdar://problem/24437972> llvm-svn: 260618
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-104-9/+19
| | | | | | | | | | | | | | file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. <rdar://problem/24581488> llvm-svn: 260434
* Added code that was commented out during testing to stops template member ↵Greg Clayton2016-02-091-5/+5
| | | | | | | | | functions from being added to class definitions (see revision 260308 for details). <rdar://problem/24483905> <rdar://problem/24508374> llvm-svn: 260322
* Fixed many issues that were causing differing type definition issues to show ↵Greg Clayton2016-02-093-32/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | up when parsing expressions. 1) Turns out we weren't correctly uniquing types for C++. We would search our repository for "lldb_private::Process", but yet store just "Process" in the unique type map. Now we store things correctly and correctly unique types. 2) SymbolFileDWARF::CompleteType() can be called at any time in order to complete a C++ or Objective C class. All public inquiries into the SymbolFile go through SymbolVendor, and SymbolVendor correctly takes the module lock before it call the SymbolFile API call, but when we let CompilerType objects out in the wild, they can complete themselves at any time from the expression parser, so the ValueObjects or (SBValue objects in the public API), and many more places. So we now take the module lock when completing a type to avoid two threads being in the SymbolFileDWARF at the same time. 3) If a class has a template member function like: class A { <template T> void Foo(T t); }; The DWARF will _only_ contain a DW_TAG_subprogram for "Foo" if anyone specialized it. This would cause a class definition for A inside a.cpp that used a "int" and "float" overload to look like: class A { void Foo(int t); void Foo(double t); }; And a version from b.cpp that used a "float" overload to look like: class A { void Foo(float t); }; And a version from c.cpp that use no overloads to look like: class A { }; Then in an expression if you have two variables, one name "a" from a.cpp in liba.dylib, and one named "b" from b.cpp in libb.dylib, you will get conflicting definitions for "A" and your expression will fail. This all stems from the fact that DWARF _only_ emits template specializations, not generic definitions, and they are only emitted if they are used. There are two solutions to this: a) When ever you run into ANY class, you must say "just because this class doesn't have templatized member functions, it doesn't mean that any other instances might not have any, so when ever I run into ANY class, I must parse all compile units and parse all instances of class "A" just in case it has member functions that are templatized.". That is really bad because it means you always pull in ALL DWARF that contains most likely exact duplicate definitions of the class "A" and you bloat the memory that the SymbolFileDWARF plug-in uses in LLDB (since you pull in all DIEs from all compile units that contain a "A" definition) uses for little value most of the time. b) Modify DWARF to emit generic template member function definitions so that you know from looking at any instance of class "A" wether it has template member functions or not. In order to do this, we would have to have the ability to correctly parse a member function template, but there is a compiler bug: <rdar://problem/24515533> [PR 26553] C++ Debug info should reference DW_TAG_template_type_parameter This bugs means that not all of the info needed to correctly make a template member function is in the DWARF. The main source of the problem is if we have DWARF for a template instantiation for "int" like: "void A::Foo<int>(T)" the DWARF comes out as "void A::Foo<int>(int)" (it doesn't mention type "T", it resolves the type to the specialized type to "int"). But if you actually have your function defined as "<template T> void Foo(int t)" and you only use T for local variables inside the function call, we can't correctly make the function prototype up in the clang::ASTContext. So the best we can do for now we just omit all member functions that are templatized from the class definition so that "A" never has any template member functions. This means all defintions of "A" look like: class A { }; And our expressions will work. You won't be able to call template member fucntions in expressions (not a regression, we weren't able to do this before) and if you are stopped in a templatized member function, we won't know that are are in a method of class "A". All things we should fix, but we need <rdar://problem/24515533> fixed first, followed by: <rdar://problem/24515624> Classes should always include a template subprogram definition, even when no template member functions are used before we can do anything about it in LLDB. This bug mainly fixed the following Apple radar: <rdar://problem/24483905> llvm-svn: 260308
* [RenderScript] Use LLVM DWARF language enumEwan Crawford2016-02-031-1/+1
| | | | | | | | | | | | | A DWARF language vender extension for RenderScript was added to LLVM in r259348(http://reviews.llvm.org/D16409) We should use this generated enum instead of the hardcoded value. RenderScript is also based on C99 with some extensions, so we want to use ClangASTContext when RS is detected. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16766 llvm-svn: 259634
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Always try to read DW_TAG_typedef types from DWO files first if we can. Greg Clayton2016-01-211-1/+24
| | | | | | | | | | | | | | | A lot of C code uses code like: typedef struct { int a; } FooType; This creates debug info with an anonymous struct (a DW_TAG_structure_type with no DW_AT_name) and then a DW_TAG_typedef that points to the anonymous structure type. When a typedef is from a module and clang uses -gmodules and -fmodules, then we can end up trying to resolve an anonymous structure type in a DWO symbol file. This doesn't work very well when the structuture has no name, so we now check if a typedef comes from a module, and we directly resolve the typedef type in the module and copy it over. The version we copy from the module of course is correctly able to find the structure in the DWO symbol file, so this fixes the issues we run into. <rdar://problem/24092915> llvm-svn: 258443
* Removed a redundant function call after review.Sean Callanan2016-01-141-2/+0
| | | | llvm-svn: 257818
* Enable the use of modules in the expression parser by default.Sean Callanan2016-01-141-2/+35
| | | | | | | | | | If your program refers to modules (as indicated in DWARF) we will now try to load these modules and give you access to their types in expressions. This used to be gated by a setting ("settings set target.auto-import-clang-modules true") but that setting defaulted to false. Now it defaults to true -- but you can disable it by toggling the setting to false. llvm-svn: 257812
* Fixed a crasher when dealing with table entries that have blank names.Sean Callanan2016-01-142-0/+9
| | | | | | This can happen with -gmodules tables when an anonymous struct is referred to. llvm-svn: 257786
* Silence an incorrect dwarf parsing warningTamas Berghammer2016-01-131-1/+1
| | | | | | | | | | | | We have a check what warns if the offset of a class member is greater then or equal to the size of the class. The warning is valid in most case but it is invalid when the last data member is a 0 size array because in this case the member offset can be equal to the class size (subject to alignment limitations). This CL fixis LLDB to not print out a warning in this special case. llvm-svn: 257603
* Don't try to parse the line table when it isn't specifiedTamas Berghammer2016-01-111-6/+11
| | | | | | | | | Previously we tried to parse the line table even if a compile unit had no DW_AT_stmt_list atribute. The problem happens when a compiler generates debug info for a compile unit but doesn't generate any line info. llvm-svn: 257335
* Better scheme to lookup alternate mangled name when looking up function address.Siva Chandra2016-01-073-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change is relevant for inferiors compiled with GCC. GCC does not emit complete debug info for std::basic_string<...>, and consequently, Clang (the LLDB compiler) does not generate correct mangled names for certain functions. This change removes the hard-coded alternate names in ItaniumABILanguageRuntime.cpp. Before the hard-coded names were put in ItaniumABILanguageRuntime.cpp, one could not evaluate std::string methods (ex. std::string::length). After putting in the hard-coded names, one could evaluate them. However, it did not still enable one to call methods on, say for example, std::vector<string>. This change makes that possible. There is some amount of incompleteness in this change. Consider the following example: std::string hello("hello"), world("world"); std::map<std::string, std::string> m; m[hello] = world; One can still not evaluate the expression "m[hello]" in LLDB. Will address this issue in another pass. Reviewers: jingham, vharron, evgeny777, spyffe, dawn Subscribers: clayborg, dawn, lldb-commits Differential Revision: http://reviews.llvm.org/D12809 llvm-svn: 257113
* Revert r256769Ewan Crawford2016-01-051-1/+1
| | | | | | | | | Reverts "Use correct format identifiers to print something meaningful." Original format specifiers were correct. Instead use void* casts to remove warnings, since this is what the %p specifier expects. llvm-svn: 256833
* Use correct format identifiers to print something meaningful.Davide Italiano2016-01-041-1/+1
| | | | llvm-svn: 256769
* Inspect DW_AT_const_value global static const variablesEwan Crawford2015-12-172-4/+8
| | | | | | | | | | | | This patch adds support for printing global static const variables which are given a DW_AT_const_value DWARF tag by clang. Fix for bug https://llvm.org/bugs/show_bug.cgi?id=25653 Reviewers: clayborg, tberghammer Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D15576 llvm-svn: 255887
* Read macro info from .debug_macro section and use it for expression evaluation.Siva Chandra2015-12-167-0/+275
| | | | | | | | | | | | | | | | | Summary: DWARF 5 proposes a reinvented .debug_macro section. This change follows that spec. Currently, only GCC produces the .debug_macro section and hence the added test is annottated with expectedFailureClang. Reviewers: spyffe, clayborg, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15437 llvm-svn: 255729
* 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
OpenPOWER on IntegriCloud