[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://r
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://reviews.llvm.org/D128077
show more ...
[lldb] Skip TestLimitDebugInfo for Clang<7Without DW_CC_pass_by_* attributes that Clang 7 started to emit in this testwe don't properly read back the return value of the `get_*` functions and just
[lldb] Skip TestLimitDebugInfo for Clang<7Without DW_CC_pass_by_* attributes that Clang 7 started to emit in this testwe don't properly read back the return value of the `get_*` functions and justread bogus memory.See also the TestReturnValue.py test.
[lldb] Check Decl kind when completing -flimit-debug-info typesThe search for the complete class definition can also produce entrieswhich are not of the expected type. This can happen for instance
[lldb] Check Decl kind when completing -flimit-debug-info typesThe search for the complete class definition can also produce entrieswhich are not of the expected type. This can happen for instance whenthere is a function with the same name as the class we're looking up(which means that the class needs to be disambiguated with thestruct/class tag in most contexts).Previously we were just picking the first Decl that the lookup returned,which later caused crashes or assertion failures if it was not of thecorrect type. This patch changes that to search for an entry of thecorrect type.Differential Revision: https://reviews.llvm.org/D85904
[lldb/DWARF] Don't treat class declarations with children as definitionsSummary:This effectively reverts r188124, which added code to handle(DW_AT_)declarations of structures with some kinds of c
[lldb/DWARF] Don't treat class declarations with children as definitionsSummary:This effectively reverts r188124, which added code to handle(DW_AT_)declarations of structures with some kinds of children asdefinitions. The commit message claims this is a workaround for somekind of debug info produced by gcc. However, it does not go intospecifics, so it's hard to reproduce or verify that this is indeed still aproblem.Having this code is definitely a problem though, because it mistakenlydeclares incomplete dwarf declarations to be complete. Both clang (with-flimit-debug-info) and gcc (by default) generate DW_AT_declarations ofstructs with children. This happens when full debug info for a class isnot emitted in a given compile unit (e.g. because of vtable homing), butthe class has inline methods which are used in the given compile unit.In that case, the compilers emit a DW_AT_declaration of a class, butadd a DW_TAG_subprogram child to it to describe the inlined instance ofthe method.Even though the class tag has some children, it definitely does notcontain enough information to construct a full class definition (mostnotably, it lacks any members). Keeping the class as incomplete allowsus to search for a real definition in other modules, helping the-flimit-debug-info flow. And in case the definition is not found we candisplay a error message saying that, instead of just showing an emptystruct.Reviewers: clayborg, aprantl, JDevlieghere, shafikSubscribers: lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D83302
[lldb/DWARF] Look for complete array element definitions in other modulesThis applies the same logic we have for incomplete class bases andmembers to array element types.
[lldb/DWARF] Look for complete member definitions in other modulesWith -flimit-debug-info, we can have a definition of a class, but nodefinition for some of its members. This extends the same logi
[lldb/DWARF] Look for complete member definitions in other modulesWith -flimit-debug-info, we can have a definition of a class, but nodefinition for some of its members. This extends the same logic we wereusing for incomplete base classes to cover incomplete members too.Test forward-declarations.s is removed as it is no longer applicable --we don't warn anymore when encountering incomplete members as they couldbe completed elsewhere. New checks added to TestLimitDebugInfo cover thehandling of incomplete members more thoroughly.
[lldb] Skip TestLimitDebugInfo on windowsThe test does not work on windows, because clang will emit full typeinformation for __declspec(dllexport) types even under-flimit-debug-info. __declspec(d
[lldb] Skip TestLimitDebugInfo on windowsThe test does not work on windows, because clang will emit full typeinformation for __declspec(dllexport) types even under-flimit-debug-info. __declspec(dllexport) is needed to be able to usethe type across shared library boundaries on windows, which makes this apretty good heuristic, but defeats the purpose of this test.I am going to create (in another patch) an basic assembly test, so thatthe relevant code gets at least some coverage on windows hosts.This also reverts commit 1276855f2b4485ec312b379c1b8eaf5510d9b157, whichadded the __declspec annotations -- they are not necessary anymore, andthey needlessly complicate the test.
[lldb] Attempt to fix TestLimitDebugInfo on windowsThe test fails due to link errors. I believe this change should fixthat.
[lldb] Add basic -flimit-debug-info support to expression evaluatorSummary:This patch adds support for evaluation of expressions referring to typeswhich were compiled in -flimit-debug-info (a.k.a
[lldb] Add basic -flimit-debug-info support to expression evaluatorSummary:This patch adds support for evaluation of expressions referring to typeswhich were compiled in -flimit-debug-info (a.k.a -fno-standalone-debug)in clang. In this mode it's possible that the debug information neededto fully describe a c++ type is not present in a single shared library-- for example debug info for a base class or a member of a type canonly be found in another shared library. This situation is notcurrently handled well within lldb as we are limited to searching withina single shared library (lldb_private::Module) when searching for thedefinition of these types.The way that this patch gets around this limitation is by doing thesearch at a later stage -- during the construction of the expression astcontext. This works by having the parser (currently SymbolFileDWARF, buta similar approach is probably needed for PDBs too) mark a type as"forcefully completed". What this means is that the parser has markedthe type as "complete" in the module ast context (as this is necessaryto e.g. derive classes from it), but its definition is not really there.This is done via a new field on the ClangASTMetadata struct.Later, when we are importing such a type into the expression ast, wecheck this flag. If the flag is set, we try to find a better definitionfor the type in other shared libraries. We do this by initiating anew lookup for the "forcefully completed" classes, which then imports thetype from a module with a full definition.This patch only implements this handling for base classes, but othercases (members, array element types, etc.). The changes for that shouldbe fairly simple and mostly revolve around marking these types as"forcefully completed" at an approriate time -- the importing logic isgeneric already.Another aspect, which is also not handled by this patch is viewing thesetypes via the "frame variable" command. This does not use the ASTimporter and so it will need to handle these types on its own -- thatwill be the subject of another patch.Differential Revision: https://reviews.llvm.org/D81561