Skip to content
  1. Feb 15, 2012
  2. Feb 10, 2012
    • Sean Callanan's avatar
      Extended function lookup to allow the user to · 9df05fbb
      Sean Callanan authored
      indicate whether inline functions are desired.
      This allows the expression parser, for instance,
      to filter out inlined functions when looking for
      functions it can call.
      
      llvm-svn: 150279
      9df05fbb
    • Sean Callanan's avatar
      Fixed a bunch of ownership problems with the expression · 933693b6
      Sean Callanan authored
      parser.  Specifically:
      
      - ClangUserExpression now keeps weak pointers to the
        structures it needs and then locks them when needed.
        This ensures that they continue to be valid without
        leaking memory if the ClangUserExpression is long
        lived.
      
      - ClangExpressionDeclMap, instead of keeping a pointer
        to an ExecutionContext, now contains an
        ExecutionContext.  This prevents bugs if the pointer
        or its contents somehow become stale.  It also no
        longer requires that ExecutionContexts be passed
        into any function except its initialization function,
        since it can count on the ExecutionContext still
        being around.
      
      There's a lot of room for improvement (specifically,
      ClangExpressionDeclMap should also use weak pointers
      insetad of shared pointers) but this is an important
      first step that codifies assumptions that already
      existed in the code.
      
      llvm-svn: 150217
      933693b6
  3. Feb 09, 2012
  4. Feb 08, 2012
  5. Feb 06, 2012
  6. Feb 04, 2012
    • Sean Callanan's avatar
      I have brought LLDB up-to-date with top of tree · 5b26f27f
      Sean Callanan authored
      LLVM/Clang.  This brings in several fixes, including:
      
      - Improvements in the Just-In-Time compiler's
        allocation of memory: the JIT now allocates
        memory in chunks of sections, improving its
        ability to generate relocations.  I have
        revamped the RecordingMemoryManager to reflect
        these changes, as well as to get the memory
        allocation and data copying out fo the
        ClangExpressionParser code.  Jim Grosbach wrote
        the updates to the JIT on the LLVM side.
      
      - A new ExternalASTSource interface to allow LLDB to
        report accurate structure layout information to
        Clang.  Previously we could only report the sizes
        of fields, not their offsets.  This meant that if
        data structures included field alignment
        directives, we could not communicate the necessary
        alignment to Clang and accesses to the data would
        fail.  Now we can (and I have update the relevant
        test case).  Thanks to Doug Gregor for implementing
        the Clang side of this fix.
      
      - The way Objective-C interfaces are completed by
        Clang has been made consistent with RecordDecls;
        with help from Doug Gregor and Greg Clayton I have
        ensured that this still works.
      
      - I have eliminated all local LLVM and Clang patches,
        committing the ones that are still relevant to LLVM
        and Clang as needed.
      
      I have tested the changes extensively locally, but
      please let me know if they cause any trouble for you.
      
      llvm-svn: 149775
      5b26f27f
  7. Jan 29, 2012
    • Greg Clayton's avatar
      Switching back to using std::tr1::shared_ptr. We originally switched away · e1cd1be6
      Greg Clayton authored
      due to RTTI worries since llvm and clang don't use RTTI, but I was able to 
      switch back with no issues as far as I can tell. Once the RTTI issue wasn't
      an issue, we were looking for a way to properly track weak pointers to objects
      to solve some of the threading issues we have been running into which naturally
      led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared 
      pointer from just a pointer, which is also easily solved using the 
      std::tr1::enable_shared_from_this class. 
      
      The main reason for this move back is so we can start properly having weak
      references to objects. Currently a lldb_private::Thread class has a refrence
      to its parent lldb_private::Process. This doesn't work well when we now hand
      out a SBThread object that contains a shared pointer to a lldb_private::Thread
      as this SBThread can be held onto by external clients and if they end up
      using one of these objects we can easily crash.
      
      So the next task is to start adopting std::tr1::weak_ptr where ever it makes
      sense which we can do with lldb_private::Debugger, lldb_private::Target,
      lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and
      many more objects now that they are no longer using intrusive ref counted
      pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive
      pointers).
      
      llvm-svn: 149207
      e1cd1be6
  8. Jan 24, 2012
  9. Jan 19, 2012
    • Sean Callanan's avatar
      Fixed a problem where maintaining the ObjCInterfaceMap · a9bc0656
      Sean Callanan authored
      for each ObjCInterfaceDecl was imposing performance
      penalties for Objective-C apps.  Instead, we now use
      the normal function query mechanisms, which use the
      relevant accelerator tables.
      
      This fix also includes some modifications to the
      SymbolFile which allow us to find Objective-C methods
      and report their Clang Decls correctly.
      
      llvm-svn: 148457
      a9bc0656
  10. Jan 13, 2012
  11. Jan 11, 2012
  12. Jan 06, 2012
    • Sean Callanan's avatar
      Fixed a bug where the DWARF location expression · d1a5e01f
      Sean Callanan authored
      parser was creating malformed resuls.  When the
      location of a variable is computed by reading a
      register and adding an offset, we shouldn't say
      that the variable's value is located in that
      register.  This was confusing the expression
      parser when trying to read a variable captured
      by a block.
      
      llvm-svn: 147668
      d1a5e01f
    • Johnny Chen's avatar
      http://llvm.org/bugs/show_bug.cgi?id=11618 · b49440fa
      Johnny Chen authored
      lldb::SBValue::AddressOf does not work on dereferenced registers in synthetic children provider
      
      Patch submitted by Enrico Granata.
      
      llvm-svn: 147637
      b49440fa
  13. Jan 04, 2012
  14. Dec 22, 2011
  15. Dec 21, 2011
    • Sean Callanan's avatar
      The "desired result type" code in the expression · 20bb3aa5
      Sean Callanan authored
      parser has hitherto been an implementation waiting
      for a use.  I have now tied the '-o' option for
      the expression command -- which indicates that the
      result is an Objective-C object and needs to be
      printed -- to the ExpressionParser, which
      communicates the desired type to Clang.
      
      Now, if the result of an expression is determined
      by an Objective-C method call for which there is
      no type information, that result is implicitly
      cast to id if and only if the -o option is passed
      to the expression command.  (Otherwise if there
      is no explicit cast Clang will issue an error.
      This behavior is identical to what happened before
      r146756.)
      
      Also added a testcase for -o enabled and disabled.
      
      llvm-svn: 147099
      20bb3aa5
  16. Dec 19, 2011
    • Sean Callanan's avatar
      Added some strength to the checks that prevent · bfb7c68b
      Sean Callanan authored
      "id" from being found by the parser as an
      externally-defined type.  Before, "id" would
      sometimes make it through if it was defined in
      a namespace, but this sometimes caused
      confusion, for example when it conflicted with
      std::locale::id.
      
      llvm-svn: 146891
      bfb7c68b
  17. Dec 17, 2011
    • Jim Ingham's avatar
      Remove an unnecessary #include. · 105d7234
      Jim Ingham authored
      llvm-svn: 146798
      105d7234
    • Johnny Chen's avatar
      http://llvm.org/bugs/show_bug.cgi?id=11588 · b456b792
      Johnny Chen authored
      valobj.AddressOf() returns None when an address is expected in a SyntheticChildrenProvider
      
      Patch from Enrico Granata:
      
      The problem was that the frozen object created by the expression parser was a copy of the contents of the StgClosure, rather than a pointer to it. Thus, the expression parser was correctly computing the result of the arithmetic&cast operation along with its address, but only saving it in the live object. This meant that the frozen copy acted as an address-less variable, hence the problem.
      
      The fix attached to this email lets the expression parser store the "live address" in the frozen copy of the address when the object is built without a valid address of its own.
      Doing so, along with delegating ValueObjectConstResult to calculate its own address when necessary, solves the issue. I have also added a new test case to check for regressions in this area, and checked that existing test cases pass correctly.
      
      llvm-svn: 146768
      b456b792
  18. Dec 16, 2011
    • Sean Callanan's avatar
      Updated Clang to take an enhancement to the way · bb12004c
      Sean Callanan authored
      we handle Objective-C method calls.  Currently,
      LLDB treats the result of an Objective-C method
      as unknown if the type information doesn't have
      the method's signature.  Now Clang can cast the
      result to id if it isn't explicitly cast.
      
      I also added a test case for this, as well as a
      fix for a type import problem that this feature
      exposed.
      
      llvm-svn: 146756
      bb12004c
  19. Dec 14, 2011
    • Sean Callanan's avatar
      This commit is the result of a general audit of · fc4f2fb0
      Sean Callanan authored
      the expression parser to locate instances where
      dyn_cast<>() and isa<>() are used on types, and
      replace them with getAs<>() as appropriate.
      
      The difference is that dyn_cast<>() and isa<>()
      are essentially LLVM/Clang's equivalent of RTTI
      -- that is, they try to downcast the object and
      return NULL if they cannot -- but getAs<>() can
      traverse typedefs to perform a semantic cast.
      
      llvm-svn: 146537
      fc4f2fb0
  20. Dec 13, 2011
    • Sean Callanan's avatar
      I have modified the part of the code that finds and · d5cc132b
      Sean Callanan authored
      validates the "self," "this," and "_cmd" pointers
      that get passed into expressions.  It used to check
      them aggressively for validity before allowing the
      expression to run as an object method; now, this
      functionality is gated by a bool and off by default.
      
      Now the default is that when LLDB is stopped in a
      method of a class, code entered using "expr" will
      always masquerade as an instance method.  If for
      some reason "self," "this," or "_cmd" is unavailable
      it will be reported as NULL.  This may cause the
      expression to crash if it relies on those pointers,
      but for example getting the addresses of ivars will
      now work as the user would expect.
      
      llvm-svn: 146465
      d5cc132b
  21. Dec 10, 2011
    • Sean Callanan's avatar
      Fixed a problem where if a frame was present the · fd1ba911
      Sean Callanan authored
      expression parser would never try getting typed
      variables from the target.
      
      llvm-svn: 146317
      fd1ba911
    • Sean Callanan's avatar
      Two fixes for file variables: · 9b3569ba
      Sean Callanan authored
      - Even if a frame isn't present, we always try
        to use FindGlobalVariable to find variables.
        Instead of using frame->TrackGlobalVariable()
        to promote the VariableSP into a ValueObject,
        we now simply use ValueObjectVariable.
      
      - When requesting the value of a variable, we
        allow returning of the "live version" of the
        variable -- that is, the variable in the
        target instead of a pointer to its freeze
        dried version in LLDB -- even if there is no
        process present.
      
      llvm-svn: 146315
      9b3569ba
  22. Dec 09, 2011
    • Sean Callanan's avatar
      If the expression parser is unable to complete a TagDecl · 12014a04
      Sean Callanan authored
      in the context in which it was originally found, the
      expression parser now goes hunting for it in all modules
      (in the appropriate namespace, if applicable).  This means
      that forward-declared types that exist in another shared
      library will now be resolved correctly.
      
      Added a test case to cover this.  The test case also tests
      "frame variable," which does not have this functionality
      yet.
      
      llvm-svn: 146204
      12014a04
  23. Dec 08, 2011
  24. Dec 07, 2011
    • Sean Callanan's avatar
      Fixed a few details of method lookup in Objective-C · 610baf42
      Sean Callanan authored
      symbols.  Now we find the correct method.
      
      Unfortunately we don't get the superclass from the
      runtime yet so the method doesn't import correctly
      (and I added a check to make sure that doesn't hurt
      us) but once we get that information right we will
      report methods correctly to the parser as well.
      
      Getting superclass information requires a common AST
      context for all Objective-C runtime information,
      meaning that the superclass and the subclass are in
      the same AST context in all cases.  That is the next
      thing that needs to be done here.
      
      llvm-svn: 146089
      610baf42
    • Sean Callanan's avatar
      Fixed a potential crasher if the frame is not · ae6d6141
      Sean Callanan authored
      avalable when a global variable is looked up.
      In ClangExpressionDeclMap, a frame should usually
      be available.
      
      llvm-svn: 146066
      ae6d6141
    • Jim Ingham's avatar
      Fix assert string to be more informative. · b3527409
      Jim Ingham authored
      llvm-svn: 146061
      b3527409
  25. Dec 06, 2011
    • Sean Callanan's avatar
      As part of the work to make Objective-C type information · 0eed0d42
      Sean Callanan authored
      from symbols more accessible, I have added a second
      map to the ClangASTImporter: the ObjCInterfaceMetaMap.
      This map keeps track of all type definitions found for
      a particular Objective-C interface, allowing the
      ClangASTSource to refer to all possible sources when
      looking for method definitions.
      
      There is a bug in lookup that I still need to figure out,
      but after that we should be able to report full method
      information for Objective-C classes shown in symbols.
      
      Also fixed some errors I ran into when enabling the maps
      for the persistent type store.  The persistent type store
      previously did not use the ClangASTImporter to import
      types, instead using ASTImporters that got allocated each
      time a type needed copying.  To support the requirements
      of the persistent type store -- namely, that types must be
      copied, completed, and then completely severed from their
      origin in the parser's AST context (which will go away) --
      I added a new function called DeportType which severs all
      these connections.
      
      llvm-svn: 145914
      0eed0d42
  26. Dec 03, 2011
    • Greg Clayton's avatar
      Added the ability for clients to grab a set of symbol table indexes and then · 1075acaf
      Greg Clayton authored
      add them to a fast lookup map. lldb_private::Symtab now export the following
      public typedefs:
      
      namespace lldb_private {
      
      	class Symtab {
      		typedef std::vector<uint32_t> IndexCollection;
      		typedef UniqueCStringMap<uint32_t> NameToIndexMap;
      	};
      }
      
      Clients can then find symbols by name and or type and end up with a 
      Symtab::IndexCollection that is filled with indexes. These indexes can then
      be put into a name to index lookup map and control if the mangled and 
      demangled names get added to the map:
      
      bool add_demangled = true;
      bool add_mangled = true;
      Symtab::NameToIndexMap name_to_index;
      symtab->AppendSymbolNamesToMap (indexes, add_demangled, add_mangled, name_to_index).
      
      This can be repeated as many times as needed to get a lookup table that
      you are happy with, and then this can be sorted:
      
      name_to_index.Sort();
      
      Now name lookups can be done using a subset of the symbols you extracted from
      the symbol table. This is currently being used to extract objective C types
      from object files when there is no debug info in SymbolFileSymtab.
      
      Cleaned up how the objective C types were being vended to be more efficient
      and fixed some errors in the regular expression that was being used.
      
      llvm-svn: 145777
      1075acaf
Loading