- Nov 29, 2011
-
-
Sean Callanan authored
management of what allocations remain after an expression finishes executing. This saves around 2.5KiB per expression for simple expressions. llvm-svn: 145342
-
- Nov 18, 2011
-
-
Sean Callanan authored
to allow variables in the persistent variable store to know how to complete themselves from debug information. That fixes a variety of bugs during dematerialization of expression results and also makes persistent variable and result variables ($foo, $4, ...) more useful. I have also added logging improvements that make it much easier to figure out how types are moving from place to place, and made some checking a little more aggressive. The commit includes patches to Clang which are currently being integrated into Clang proper; once these fixes are in Clang top-of-tree, these patches will be removed. The patches don't fix API; rather, they fix some internal bugs in Clang's ASTImporter that were exposed when LLDB was moving types from place to place multiple times. llvm-svn: 144969
-
- Nov 16, 2011
-
-
Sean Callanan authored
rather than individually on behalf of each ASTContext. This allows the ASTImporter to know about all containers of types, which will let it be smarter about forwarding information about type origins. That means that the following sequence of steps will be possible (after a few more changes): - Import a type from a Module's ASTContext into an expression parser ASTContext, tracking its origin information -- this works now. - Because the result of the expression uses that type, import it from the expression parser ASTContext into the Target's scratch AST context, forwarding the origin information -- this needs to be added. - For a later expression that uses the result, import the type from the Target's scratch AST context, still forwarding origin information -- this also needs to be added. - Use the intact origin information to complete the type as needed -- this works now if the origin information is present. To this end, I made the following changes: - ASTImporter top-level copy functions now require both a source and a destination AST context parameter. - The ASTImporter now knows how to purge records related to an ASTContext that is going away. - The Target now owns and creates the ASTImporter whenever the main executable changes or (in the absence of a main executable) on demand. llvm-svn: 144802
-
- Nov 15, 2011
-
-
Sean Callanan authored
where isa is good enough. llvm-svn: 144704
-
Sean Callanan authored
of problems with Objective-C object completion. To go along with the LLVM/Clang-side fixes, we have a variety of Objective-C improvements. Fixes include: - It is now possible to run expressions when stopped in an Objective-C class method and have "self" act just like "self" would act in the class method itself (i.e., [self classMethod] works without casting the return type if debug info is present). To accomplish this, the expression masquerades as a class method added by a category. - Objective-C objects can now provide methods and properties and methods to Clang on demand (i.e., the ASTImporter sets hasExternalVisibleDecls on Objective-C interface objects). - Objective-C built-in types, which had long been a bone of contention (should we be using "id"? "id*"?), are now fetched correctly using accessor functions on ClangASTContext. We inhibit searches for them in the debug information. There are also a variety of logging fixes, and I made two changes to the test suite: - Enabled a test case for Objective-C properties in the current translation unit. - Added a test case for calling Objective-C class methods when stopped in a class method. llvm-svn: 144607
-
- Nov 14, 2011
-
-
Sean Callanan authored
a single argument. We assumed that the : was omitted from the selector name, but actually Clang adds the : in the one-argument case. llvm-svn: 144544
-
- Nov 11, 2011
-
-
Sean Callanan authored
interfaces. This allows us to pull in Objective-C method types on demand, which is also now implemented. Also added a minor fix to prevent multiple-definition errors for "Class" and "id". llvm-svn: 144405
-
- Nov 09, 2011
-
-
Sean Callanan authored
lookups for Objective-C methods by selector. Right now all it does is print log information. Also improved the logging for imported TagDecls to indicate whether or not the definition for the imported TagDecl is complete. llvm-svn: 144203
-
- Oct 29, 2011
-
-
Sean Callanan authored
ClangExpressionDeclMap to ClangASTSource, and moved all general type and namespace lookups into ClangASTSource. Now ClangASTSource is ready to complete types given nothing more than a target and an AST context. llvm-svn: 143292
-
Sean Callanan authored
functions from ClangExpressionDeclMap to ClangASTSource. llvm-svn: 143276
-
Sean Callanan authored
AST importer on completing namespace mappings from ClangExpressionDeclMap to ClangASTSource. ClangASTSource now contains a TargetSP which it uses to lookup namespaces in all of a target's modules. I will use the TargetSP in the future to look up globals. llvm-svn: 143275
-
Sean Callanan authored
allow it to complete types on behalf of any AST context (including the "scratch" AST context associated with the target), I scrapped its role as intermediary between the Clang parser and ClangExpressionDeclMap, and instead made ClangExpressionDeclMap inherit from ClangASTSource. After this, I will migrate the functions that complete types and perform namespace lookups from ClangExpressionDeclMap to ClangASTSource. Ultimately ClangExpressionDeclMap's only responsiblity will be to look up variables and ensure that they are materialized and dematerialized correctly. llvm-svn: 143253
-
- Oct 12, 2011
-
-
Sean Callanan authored
of namespaces (only in the modules where they've been found) for entities inside those namespaces. For each NamespaceDecl that has been imported into the parser, we maintain a map containing [ModuleSP, ClangNamespaceDecl] pairs in the ASTImporter. This map has one entry for each module in which the namespace has been found. When we later scan for an entity inside a namespace, we search only the modules in which that namespace was found. Also made a small whitespace fix in ClangExpressionParser.cpp. llvm-svn: 141748
-
- Oct 08, 2011
-
-
Sean Callanan authored
This involved minor changes to the way we report Objective-C methods, as well as cosmetic changes and added parameters for a variety of Clang APIs. llvm-svn: 141437
-
- Sep 17, 2011
-
-
Greg Clayton authored
We had some cases where getting the shared pointer for a module from the global module list was causing a performance issue when debugging with DWARF in .o files. Now that the module uses intrusive ref counts, we can easily convert any pointer to a shared pointer. llvm-svn: 139983
-
- Jul 30, 2011
-
-
Sean Callanan authored
completes the support in the LLDB expression parser for incomplete types. Clang now imports types lazily, and we complete those types as necessary. Changes include: - ClangASTSource now supports three APIs which it passes to ClangExpressionDeclMap. CompleteType completes a TagDecl or an ObjCInterfaceDecl when needed; FindExternalVisibleDecls finds named entities that are visible in the expression's scope; and FindExternalLexicalDecls performs a (potentially restricted) search for entities inside a lexical scope like a namespace. These changes mean that entities in namespaces should work normally. - The SymbolFileDWARF code for searching a context for a specific name is now more general, and can search arbitrary contexts. - We are continuing to adapt our calls into LLVM from interfaces that take start and end iterators when accepting multiple items to interfaces that use ArrayRef. - I have cleaned up some code, especially our use of namespaces. This change is neutral for our testsuite and greatly improves correctness for large programs (like Clang) with complicated type systems. It should also lay the groundwork for improving the expression parser's performance as we are lazier and lazier about providing type information. llvm-svn: 136555
-
- Jun 25, 2011
-
-
Greg Clayton authored
inspection of namespaces in the expression parser. ClangExpressionDeclMap hitherto reported that namespaces had been completely imported, even though the namespaces are returned empty. To deal with this situation, ClangASTSource was recently extended with an API to complete incomplete type definitions, and, for greater efficiency, to complete these definitions partially, returning only those objects that have a given name. This commit supports these APIs on LLDB's side, and uses it to provide information on types resident in namespaces. Namespaces are now imported as they were -- that is to say, empty -- but with minimal import mode on. This means that Clang will come back and request their contents by name as needed. We now respond with information on the contained types; this will be followed soon by information on functions and variables. llvm-svn: 133852
-
- May 13, 2011
-
-
Sean Callanan authored
representing variables whose type must be inferred from the way they are used. Functions without debug information now return UnknownAnyTy and must be cast. Variables with no debug information are not yet using UnknownAnyTy; instead they are assumed to be void*. Support for variables of unknown type is coming (and, in fact, some relevant support functions are included in this commit) but will take a bit of extra effort. The testsuite has also been updated to reflect the new requirement that the result of printf be cast, i.e. expr (int) printf("Hello world!") llvm-svn: 131263
-
- Mar 15, 2011
-
-
Sean Callanan authored
llvm-svn: 127634
-
- Jan 27, 2011
-
-
Sean Callanan authored
the "virtual" flag when importing a C++ function declaration. Made changes to LLDB to support other changes in Clang. llvm-svn: 124355
-
- Jan 23, 2011
-
-
Greg Clayton authored
llvm-svn: 124051
-
- Jan 19, 2011
-
-
Sean Callanan authored
support for minimal type import functionality. llvm-svn: 123787
-
- Jan 17, 2011
-
-
Greg Clayton authored
the way LLDB lazily gets complete definitions for types within the debug info. When we run across a class/struct/union definition in the DWARF, we will only parse the full definition if we need to. This works fine for top level types that are assigned directly to variables and arguments, but when we have a variable with a class, lets say "A" for this example, that has a member: "B *m_b". Initially we don't need to hunt down a definition for this class unless we are ever asked to do something with it ("expr m_b->getDecl()" for example). With my previous approach to lazy type completion, we would be able to take a "A *a" and get a complete type for it, but we wouldn't be able to then do an "a->m_b->getDecl()" unless we always expanded all types within a class prior to handing out the type. Expanding everything is very costly and it would be great if there were a better way. A few months ago I worked with the llvm/clang folks to have the ExternalASTSource class be able to complete classes if there weren't completed yet: class ExternalASTSource { .... virtual void CompleteType (clang::TagDecl *Tag); virtual void CompleteType (clang::ObjCInterfaceDecl *Class); }; This was great, because we can now have the class that is producing the AST (SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources and the object that creates the forward declaration types can now also complete them anywhere within the clang type system. This patch makes a few major changes: - lldb_private::Module classes now own the AST context. Previously the TypeList objects did. - The DWARF parsers now sign up as an external AST sources so they can complete types. - All of the pure clang type system wrapper code we have in LLDB (ClangASTContext, ClangASTType, and more) can now be iterating through children of any type, and if a class/union/struct type (clang::RecordType or ObjC interface) is found that is incomplete, we can ask the AST to get the definition. - The SymbolFileDWARFDebugMap class now will create and use a single AST that all child SymbolFileDWARF classes will share (much like what happens when we have a complete linked DWARF for an executable). We will need to modify some of the ClangUserExpression code to take more advantage of this completion ability in the near future. Meanwhile we should be better off now that we can be accessing any children of variables through pointers and always be able to resolve the clang type if needed. llvm-svn: 123613
-
- Dec 13, 2010
-
-
Sean Callanan authored
access to the members of the Objective-C self object. The approach we take is to generate the method as a @category on top of the self object, and to pass the "self" pointer to it. (_cmd is currently NULL.) Most changes are in ClangExpressionDeclMap, but the change that adds support to the ABIs to pass _cmd touches a fair amount of code. llvm-svn: 121722
-
- Dec 03, 2010
-
-
Sean Callanan authored
so that it is not referring to potentially stale state during IR execution. This was done by introducing modular state (like ClangExpressionVariable) where groups of state variables have well-defined lifetimes: - m_parser_vars are specific to parsing, and only exist between calls to WillParse() and DidParse(). - m_struct_vars survive for the entire execution of the ClangExpressionDeclMap because they provide the template for a materialized set of expression variables. - m_material_vars are specific to a single instance of materialization, and only exist between calls to Materialize() and Dematerialize(). I also removed unnecessary references to long- lived state that really didn't need to be referred to at all, and also introduced several assert()s that helped me diagnose a few bugs (fixed too). llvm-svn: 120778
-
- Nov 30, 2010
-
-
Sean Callanan authored
using special $-variables from expressions. (lldb) expr $rip These variables are available for reading and writing. llvm-svn: 120367
-
- Nov 18, 2010
-
-
Sean Callanan authored
llvm-svn: 119677
-
- Nov 15, 2010
-
-
Greg Clayton authored
Added recursive name lookup logging with depth which is commented out and is currently only enabled when we blow the stack. llvm-svn: 119101
-
- Nov 13, 2010
-
-
Greg Clayton authored
expression. This currently takes waaaayyyyy too much time to evaluate. We will need to look at the expression parser and find ways to optimize the info we provide and get this to evaluate quicker. I believe the performance issue is currently related to us always providing a complete C++ class type when asked about a C++ class which can cause a lot of information to be pulled since all classes will be fully created (methods, base classes, members, all their types). We will need to give the classes back the parser and mark them as having external sources and get parser (Sema) to query us when it needs more info. This should bring things up to an acceptable level. llvm-svn: 118979
-
- Oct 29, 2010
-
-
Sean Callanan authored
7pm, and made minor integration fixes. llvm-svn: 117680
-
- Oct 16, 2010
-
-
Greg Clayton authored
Changed all of our synthesized "___clang" functions, types and variables that get used in expressions over to have a prefix of "$_lldb". Now when we do name lookups we can easily switch off of the first '$' character to know if we should look through only our internal (when first char is '$') stuff, or when we should look through program variables, functions and types. Converted all of the clang expression code over to using "const ConstString&" values for names instead of "const char *" since there were many places that were converting the "const char *" names into ConstString names and them throwing them away. We now avoid making a lot of ConstString conversions and benefit from the quick comparisons in a few extra spots. Converted a lot of code from LLVM coding conventions into LLDB coding conventions. llvm-svn: 116634
-
- Oct 15, 2010
-
-
Greg Clayton authored
llvm-svn: 116565
-
- Oct 13, 2010
-
-
Greg Clayton authored
artifical members (like the vtable pointer member that shows up in the DWARF). We were adding this to each class which was making all member variables be off by a pointer size. Added a test case so we can track this with "test/forward". Fixed the type name index in DWARF to include all the types after finding some types were being omitted due to the DW_AT_specification having the DW_AT_declaration attribute which was being read into the real type instances when there were forward declarations in the DWARF, causing the type to be omitted. We now check to make sure any DW_AT_declaration values are only respected when parsing types if the attribute is from the current DIE. After fixing the missing types, we ran into some issues with the expression parser finding duplicate entries for __va_list_tag since they are built in types and would result in a "duplicate __va_list_tag definition" error. We are now just ignoring this name during lookup, but we will need to see if we can get the name lookup function to not get called in these cases. Fixed an issue that would cause an assertion where DW_TAG_subroutine_types that had no children, would not properly make a clang function type of: "void (*) (void)". llvm-svn: 116392
-
- Sep 23, 2010
-
-
Sean Callanan authored
- Sema is now exported (and there was much rejoicing.) - Storage classes are now centrally defined. Also fixed some bugs that the new LLVM picked up. llvm-svn: 114622
-
- Sep 21, 2010
-
-
Sean Callanan authored
for C++ classes. Replaced it with a less hacky approach: - If an expression is defined in the context of a method of class A, then that expression is wrapped as ___clang_class::___clang_expr(void*) { ... } instead of ___clang_expr(void*) { ... }. - ___clang_class is resolved as the type of the target of the "this" pointer in the method the expression is defined in. - When reporting the type of ___clang_class, a method with the signature ___clang_expr(void*) is added to that class, so that Clang doesn't complain about a method being defined without a corresponding declaration. - Whenever the expression gets called, "this" gets looked up, type-checked, and then passed in as the first argument. This required the following changes: - The ABIs were changed to support passing of the "this" pointer as part of trivial calls. - ThreadPlanCallFunction and ClangFunction were changed to support passing of an optional "this" pointer. - ClangUserExpression was extended to perform the wrapping described above. - ClangASTSource was changed to revert the changes required by the hack. - ClangExpressionParser, IRForTarget, and ClangExpressionDeclMap were changed to handle different manglings of ___clang_expr flexibly. This meant no longer searching for a function called ___clang_expr, but rather looking for a function whose name *contains* ___clang_expr. - ClangExpressionParser and ClangExpressionDeclMap now remember whether "this" is required, and know how to look it up as necessary. A few inheritance bugs remain, and I'm trying to resolve these. But it is now possible to use "this" as well as refer implicitly to member variables, when in the proper context. llvm-svn: 114384
-
- Sep 14, 2010
-
-
Sean Callanan authored
expressions. This involved three main changes: - In ClangUserExpression::ClangUserExpression(), we now insert the following lines into the expression: #define this ___clang_this #define self ___clang_self - In ClangExpressionDeclMap::GetDecls(), we special-case ___clang_(this|self) and instead look up "this" or "self" - In ClangASTSource, we introduce the capability to generate Decls with a different, overridden, name from the one that was requested, e.g. this for ___clang_this. llvm-svn: 113866
-
- Aug 13, 2010
-
-
Sean Callanan authored
NameSearchContext. llvm-svn: 110980
-
- Aug 04, 2010
-
-
Sean Callanan authored
including superclass members. This involved ensuring that access control was ignored, and ensuring that the operands of BitCasts were properly scanned for variables that needed importing. Also laid the groundwork for declaring objects of custom types; however, this functionality is disabled for now because of a potential loop in ASTImporter. llvm-svn: 110174
-
- Jul 27, 2010
-
-
Sean Callanan authored
it returns a list of functions as a SymbolContextList. Rewrote the clients of SymbolContext to use this SymbolContextList. Rewrote some of the providers of the data to SymbolContext to make them respect preferences as to whether the list should be cleared first; propagated that change out. ClangExpressionDeclMap and ClangASTSource use this new function list to properly generate function definitions - even for functions that don't have a prototype in the debug information. llvm-svn: 109476
-
- Jul 16, 2010
-
-
Greg Clayton authored
llvm-svn: 108544
-