Skip to content
  1. Apr 03, 2013
    • Rafael Espindola's avatar
      Fix build. · f24933f6
      Rafael Espindola authored
      This should fix the build breakage caused by the api change in 178663.
      
      llvm-svn: 178700
      f24933f6
  2. Mar 28, 2013
    • Greg Clayton's avatar
      <rdar://problem/13521159> · 5160ce5c
      Greg Clayton authored
      LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.
      
      All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.
      
      llvm-svn: 178191
      5160ce5c
  3. Dec 18, 2012
  4. Oct 31, 2012
  5. May 16, 2012
    • Sean Callanan's avatar
      Enabled C++11 in the expression parser. auto and · 8d825786
      Sean Callanan authored
      various other syntactic sugar work.  Lambdas do
      not due to some problems relocating code containing
      lambdas.  Rvalue references work when returned from
      expressions, but need more testing.
      
      llvm-svn: 156948
      8d825786
  6. Mar 15, 2012
    • Sean Callanan's avatar
      Strengthened LLDB's completion of object types. · cf12862a
      Sean Callanan authored
      Now when LLDB reports a variable, it has a
      complete type.  Similarly, when it reports
      members of a struct, it completes their types.
      Also, when it creates the result variable for
      an expression, it ensures that variable's type
      is complete.
      
      This ensures compliance with Clang's
      expectations, preventing potential crashes.
      
      llvm-svn: 152771
      cf12862a
  7. 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
  8. 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
  9. Dec 08, 2011
    • Sean Callanan's avatar
      Added the ability to dereference an Objective-C object · 5780f9df
      Sean Callanan authored
      pointer to make the result of an expression.  LLDB now
      dumps the ivars of the Objective-C object and all of
      its parents.  This just required fixing a bug where we
      didn't distinguish between Objective-C object pointers
      and regular C-style pointers.
      
      Also added a testcase to verify that this continues to
      work.
      
      llvm-svn: 146164
      5780f9df
  10. 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
  11. Nov 19, 2011
    • Sean Callanan's avatar
      Pulled in a new revision of LLVM/Clang and added · 7f27d604
      Sean Callanan authored
      several patches.  These patches fix a problem
      where templated types were not being completed the
      first time they were used, and fix a variety of
      minor issues I discovered while fixing that problem.
      
      One of the previous local patches was resolved in
      the most recent Clang, so I removed it.  The others
      will be removed in due course.
      
      llvm-svn: 144984
      7f27d604
  12. Oct 31, 2011
  13. Oct 14, 2011
    • Sean Callanan's avatar
      Improved expression logging. Now all calls to · 7dd98126
      Sean Callanan authored
      FindExternalVisibleDecls and FindExternalLexicalDecls
      are marked and given unique IDs, so that all logging
      done as part of their execution can be traced back to
      the proper call.
      
      Also there was some logging that really wasn't helpful
      in most cases so I disabled it unless verbose logging
      (log enable -v lldb expr) is enabled.
      
      llvm-svn: 141987
      7dd98126
  14. Oct 08, 2011
  15. Aug 23, 2011
    • Sean Callanan's avatar
      Added support for persistent types to the · bccce813
      Sean Callanan authored
      expression parser.  You can use a persistent
      type like this:
      
      (lldb) expr struct $foo { int a; int b; };
      (lldb) struct $foo i; i.a = 2; i.b = 3; i
      ($foo) $0 = {
        (int) a = 2
        (int) b = 3
      }
      
      typedefs work similarly.
      
      This patch affects the following files:
      
      test/expression_command/persistent_types/*
        A test case for persistent types,
        in particular structs and typedefs.
      
      ClangForward.h
        Added TypeDecl, needed to declare some
        functions in ASTResultSynthesizer.h
      
      ClangPersistentVariables.[h,cpp]
        Added a list of persistent types to the
        persistent variable store.
      
      ASTResultSynthesizer.[h,cpp]
        Made the AST result synthesizer iterate
        across TypeDecls in the expression, and
        record any persistent types found.  Also
        made a minor documentation fix.
      
      ClangUserExpression.[h,cpp]
        Extended the user expression class to
        keep the state needed to report the
        persistent variable store for the target
        to the AST result synthesizers. 
      
        Also introduced a new error code for
        expressions that executed normally but
        did not return a result.
      
      CommandObjectExpression.cpp
        Improved output for expressions (like 
        declarations of new persistent types) that
        don't return a result.  This is no longer
        treated as an error.
      
      llvm-svn: 138383
      bccce813
  16. Aug 04, 2011
    • Sean Callanan's avatar
      Fixed a problem that caused LLDB to fail to execute · 0c4d8d25
      Sean Callanan authored
      expressions that used function pointers.  The problem
      was that IRForTarget previously only scanned the IR
      for the expression for call instructions; if a function
      was used in another context, it was ignored.
      
      Now LLDB scans the Module for functions that are only
      declared (not also defined -- so these are externals);
      it then constructs function pointers for these
      functions and substitutes them wherever the function
      is used.
      
      Also made some changes so that "expr main" works just
      as well as "expr &main"; they end up being the same
      code, but LLDB was generating the result variable in
      different ways.
      
      llvm-svn: 136928
      0c4d8d25
  17. Jul 18, 2011
  18. Jul 08, 2011
  19. Mar 15, 2011
  20. Feb 22, 2011
  21. Jan 27, 2011
  22. Jan 22, 2011
  23. Jan 13, 2011
    • Sean Callanan's avatar
      Implemented a major overhaul of the way variables are handled · 92adcac9
      Sean Callanan authored
      by LLDB.  Instead of being materialized into the input structure
      passed to the expression, variables are left in place and pointers
      to them are materialzied into the structure.  Variables not resident
      in memory (notably, registers) get temporary memory regions allocated
      for them.
      
      Persistent variables are the most complex part of this, because they
      are made in various ways and there are different expectations about
      their lifetime.  Persistent variables now have flags indicating their
      status and what the expectations for longevity are.  They can be
      marked as residing in target memory permanently -- this is the
      default for result variables from expressions entered on the command
      line and for explicitly declared persistent variables (but more on
      that below).  Other result variables have their memory freed.
      
      Some major improvements resulting from this include being able to
      properly take the address of variables, better and cleaner support
      for functions that return references, and cleaner C++ support in
      general.  One problem that remains is the problem of explicitly
      declared persistent variables; I have not yet implemented the code
      that makes references to them into indirect references, so currently
      materialization and dematerialization of these variables is broken.
      
      llvm-svn: 123371
      92adcac9
  24. Dec 13, 2010
    • Sean Callanan's avatar
      Added support for generating expressions that have · 17827830
      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
      17827830
  25. Nov 19, 2010
  26. Nov 06, 2010
    • Greg Clayton's avatar
      Modified all logging calls to hand out shared pointers to make sure we · 2d4edfbc
      Greg Clayton authored
      don't crash if we disable logging when some code already has a copy of the
      logger. Prior to this fix, logs were handed out as pointers and if they were
      held onto while a log got disabled, then it could cause a crash. Now all logs
      are handed out as shared pointers so this problem shouldn't happen anymore.
      We are also using our new shared pointers that put the shared pointer count
      and the object into the same allocation for a tad better performance.
      
      llvm-svn: 118319
      2d4edfbc
  27. Oct 16, 2010
    • Greg Clayton's avatar
      Made many ConstString functions inlined in the header file. · 7b462cc1
      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
      7b462cc1
  28. Sep 23, 2010
  29. Sep 22, 2010
  30. Sep 13, 2010
    • Sean Callanan's avatar
      Bugfixes to the expression parser. Fixes include: · 9e6ed53e
      Sean Callanan authored
       - If you put a semicolon at the end of an expression,
         this no longer causes the expression parser to
         error out.  This was a two-part fix: first,
         ClangExpressionDeclMap::Materialize now handles
         an empty struct (such as when there is no return
         value); second, ASTResultSynthesizer walks backward
         from the end of the ASTs until it reaches something
         that's not a NullStmt.
      
       - ClangExpressionVariable now properly byte-swaps when
         printing itself.
      
       - ClangUtilityFunction now cleans up after itself when
         it's done compiling itself.
      
       - Utility functions can now use external functions just
         like user expressions.
      
       - If you end your expression with a statement that does
         not return a value, the expression now runs correctly
         anyway.
      
      Also, added the beginnings of an Objective-C object
      validator function, which is neither installed nor used
      as yet.
      
      llvm-svn: 113789
      9e6ed53e
  31. Aug 27, 2010
    • Sean Callanan's avatar
      This is a major refactoring of the expression parser. · 1a8d4093
      Sean Callanan authored
      The goal is to separate the parser's data from the data
      belonging to the parser's clients.  This allows clients
      to use the parser to obtain (for example) a JIT compiled
      function or some DWARF code, and then discard the parser
      state.
      
      Previously, parser state was held in ClangExpression and
      used liberally by ClangFunction, which inherited from
      ClangExpression.  The main effects of this refactoring 
      are:
      
      - reducing ClangExpression to an abstract class that
        declares methods that any client must expose to the
        expression parser,
      
      - moving the code specific to implementing the "expr"
        command from ClangExpression and
        CommandObjectExpression into ClangUserExpression,
        a new class,
      
      - moving the common parser interaction code from
        ClangExpression into ClangExpressionParser, a new
        class, and
      
      - making ClangFunction rely only on
        ClangExpressionParser and not depend on the
        internal implementation of ClangExpression.
      
      Side effects include:
      
      - the compiler interaction code has been factored
        out of ClangFunction and is now in an AST pass
        (ASTStructExtractor),
      
      - the header file for ClangFunction is now fully
        documented,
      
      - several bugs that only popped up when Clang was
        deallocated (which never happened, since the
        lifetime of the compiler was essentially infinite)
        are now fixed, and
      
      - the developer-only "call" command has been
        disabled.
      
      I have tested the expr command and the Objective-C
      step-into code, which use ClangUserExpression and
      ClangFunction, respectively, and verified that they
      work.  Please let me know if you encounter bugs or
      poor documentation.
      
      llvm-svn: 112249
      1a8d4093
  32. Aug 17, 2010
  33. Jul 24, 2010
    • Sean Callanan's avatar
      Updated the IR converter for the target to eliminate · ddb46efc
      Sean Callanan authored
      spurious guard variables on expression statics.
      
      Updated the AST result synthesizer to eliminate the
      unneeded result pointer.
      
      Very rudimentary expressions now evaluate correctly
      in the target using the new JIT-based mechanism.
      
      llvm-svn: 109317
      ddb46efc
  34. Jul 13, 2010
    • Greg Clayton's avatar
      Patch from Jean-Daniel Dupas: · c8e11e17
      Greg Clayton authored
              Makefile patch to explicitly use PROJ_SRC_DIR when required. It fixes 
              build when obj dir is not source dir. 
      
      I also fixed a build warning in ClangResultSynthesizer.cpp.
      
      llvm-svn: 108210
      c8e11e17
  35. Jul 01, 2010
Loading