Skip to content
  1. Oct 29, 2011
    • Sean Callanan's avatar
      I moved the responsibility for interacting with the · 1ee44b74
      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
      1ee44b74
  2. Sep 22, 2011
    • Greg Clayton's avatar
      Converted the lldb_private::Process over to use the intrusive · c14ee32d
      Greg Clayton authored
      shared pointers.
      
      Changed the ExecutionContext over to use shared pointers for
      the target, process, thread and frame since these objects can
      easily go away at any time and any object that was holding onto
      an ExecutionContext was running the risk of using a bad object.
      
      Now that the shared pointers for target, process, thread and
      frame are just a single pointer (they all use the instrusive
      shared pointers) the execution context is much safer and still
      the same size. 
      
      Made the shared pointers in the the ExecutionContext class protected
      and made accessors for all of the various ways to get at the pointers,
      references, and shared pointers.
      
      llvm-svn: 140298
      c14ee32d
  3. Sep 20, 2011
  4. Sep 15, 2011
    • Sean Callanan's avatar
      This patch modifies the expression parser to allow it · 3bfdaa2a
      Sean Callanan authored
      to execute expressions even in the absence of a process.
      This allows expressions to run in situations where the
      target cannot run -- e.g., to perform calculations based
      on type information, or to inspect a binary's static
      data.
      
      This modification touches the following files:
      
      lldb-private-enumerations.h
        Introduce a new enum specifying the policy for
        processing an expression.  Some expressions should
        always be JITted, for example if they are functions
        that will be used over and over again.  Some
        expressions should always be interpreted, for
        example if the target is unsafe to run.  For most,
        it is acceptable to JIT them, but interpretation
        is preferable when possible.
      
      Target.[h,cpp]
        Have EvaluateExpression now accept the new enum.
      
      ClangExpressionDeclMap.[cpp,h]
        Add support for the IR interpreter and also make
        the ClangExpressionDeclMap more robust in the 
        absence of a process.
      
      ClangFunction.[cpp,h]
        Add support for the new enum.
      
      IRInterpreter.[cpp,h]
        New implementation.
      
      ClangUserExpression.[cpp,h]
        Add support for the new enum, and for running 
        expressions in the absence of a process.
      
      ClangExpression.h
        Remove references to the old DWARF-based method
        of evaluating expressions, because it has been
        superseded for now.
      
      ClangUtilityFunction.[cpp,h]
        Add support for the new enum.
      
      ClangExpressionParser.[cpp,h]
        Add support for the new enum, remove references
        to DWARF, and add support for checking whether
        the expression could be evaluated statically.
      
      IRForTarget.[h,cpp]
        Add support for the new enum, and add utility
        functions to support the interpreter.
      
      IRToDWARF.cpp
        Removed
      
      CommandObjectExpression.cpp
        Remove references to the obsolete -i option.
      
      Process.cpp 
        Modify calls to ClangUserExpression::Evaluate
        to pass the correct enum (for dlopen/dlclose)
      
      SBValue.cpp
        Add support for the new enum.
      
      SBFrame.cpp
        Add support for he new enum.
      
      BreakpointOptions.cpp
        Add support for the new enum.
      
      llvm-svn: 139772
      3bfdaa2a
  5. Aug 01, 2011
  6. May 23, 2011
    • Sean Callanan's avatar
      This commit integrates support for the LLVM MCJIT · 79763a42
      Sean Callanan authored
      into the mainline LLDB codebase.  MCJIT introduces
      API improvements and better architectural support.
      
      This commit adds a new subsystem, the
      ProcessDataAllocator, which is responsible for
      performing static data allocations on behalf of the
      IR transformer.  MCJIT currently does not support
      the relocations required to store the constant pool
      in the same allocation as the function body, so we
      allocate a heap region separately and redirect
      static data references from the expression to that
      heap region in a new IR modification pass.
      
      This patch also fixes bugs in the IR
      transformations that were exposed by the transition
      to the MCJIT.  Finally, the patch also pulls in a
      more recent revision of LLVM so that the MCJIT is
      available for use.
      
      llvm-svn: 131923
      79763a42
  7. May 17, 2011
  8. May 07, 2011
  9. Feb 15, 2011
  10. Jan 20, 2011
  11. Jan 18, 2011
    • Greg Clayton's avatar
      Thread safety changes in debugserver and also in the process GDB remote plugin. · c4e411ff
      Greg Clayton authored
      I added support for asking if the GDB remote server supports thread suffixes
      for packets that should be thread specific (register read/write packets) because
      the way the GDB remote protocol does it right now is to have a notion of a
      current thread for register and memory reads/writes (set via the "$Hg%x" packet)
      and a current thread for running ("$Hc%x"). Now we ask the remote GDB server
      if it supports adding the thread ID to the register packets and we enable
      that feature in LLDB if supported. This stops us from having to send a bunch
      of packets that update the current thread ID to some value which is prone to
      error, or extra packets.
      
      llvm-svn: 123762
      c4e411ff
    • Sean Callanan's avatar
      Added support for the fragile ivars provided by · c3a16006
      Sean Callanan authored
      Apple's Objective-C 2.0 runtime.  They are enabled
      if the Objective-C runtime has the proper version.
      
      llvm-svn: 123694
      c3a16006
  12. 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
  13. Dec 03, 2010
    • Sean Callanan's avatar
      Fixed object lifetimes in ClangExpressionDeclMap · 979f74d1
      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
      979f74d1
  14. Sep 25, 2010
    • Greg Clayton's avatar
      Cleaned a few build related things up: · 5573fde3
      Greg Clayton authored
      Added a virtual destructor to ClangUtilityFunction with a body to it cleans
      itself up.
      
      Moved our SharingPtr into the lldb_private namespace to keep it easy to make
      an exports file that exports only what is needed ("lldb::*").
      
      llvm-svn: 114771
      5573fde3
  15. 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
  16. Sep 01, 2010
    • Sean Callanan's avatar
      Added support for dynamic sanity checking in · 6961e878
      Sean Callanan authored
      expressions.  Values used by the expression are
      checked by validation functions which cause the
      program to crash if the values are unsafe.
      
      Major changes:
      
      - Added IRDynamicChecks.[ch], which contains the
        core code related to this feature
      
      - Modified CommandObjectExpression to install the
        validator functions into the target process.
      
      - Added an accessor to Process that gets/sets the
        helper functions
      
      llvm-svn: 112690
      6961e878
  17. Aug 28, 2010
    • Sean Callanan's avatar
      Added a ClangUtilityFunction class that allows the · e71d553c
      Sean Callanan authored
      debugger to insert self-contained functions for use by
      expressions (mainly for error-checking).
      
      In order to support detecting whether a crash occurred
      in one of these helpers -- currently our preferred way
      of reporting that an error-check failed -- added a bit
      of support for getting the extent of a JITted function
      in addition to just its base.
      
      llvm-svn: 112324
      e71d553c
Loading