Skip to content
  1. 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
  2. Jan 09, 2011
    • Greg Clayton's avatar
      Put more smarts into the RegisterContext base class. Now the base class has · 3e06bd90
      Greg Clayton authored
      a method:
      
          void RegisterContext::InvalidateIfNeeded (bool force);
      
      Each time this function is called, when "force" is false, it will only call
      the pure virtual "virtual void RegisterContext::InvalideAllRegisters()" if
      the register context's stop ID doesn't match that of the process. When the
      stop ID doesn't match, or "force" is true, the base class will clear its
      cached registers and the RegisterContext will update its stop ID to match
      that of the process. This helps make it easier to correctly flush the register
      context (possibly from multiple locations depending on when and where new
      registers are availabe) without inadvertently clearing the register cache 
      when it doesn't need to be.
      
      Modified the ProcessGDBRemote plug-in to be much more efficient when it comes
      to:
      - caching the expedited registers in the stop reply packets (we were ignoring
        these before and it was causing us to read at least three registers every
        time we stopped that were already supplied in the stop reply packet).
      - When a thread has no stop reason, don't keep asking for the thread stopped
        info. Prior to this fix we would continually send a qThreadStopInfo packet
        over and over when any thread stop info was requested. We now note the stop
        ID that the stop info was requested for and avoid multiple requests.
      
      Cleaned up some of the expression code to not look for ClangExpressionVariable
      objects up by name since they are now shared pointers and we can just look for
      the exact pointer match and avoid possible errors.
      
      Fixed an bug in the ValueObject code that would cause children to not be 
      displayed.
      
      llvm-svn: 123127
      3e06bd90
  3. Jan 06, 2011
    • Greg Clayton's avatar
      Fixed issues with RegisterContext classes and the subclasses. There was · 5ccbd294
      Greg Clayton authored
      an issue with the way the UnwindLLDB was handing out RegisterContexts: it
      was making shared pointers to register contexts and then handing out just
      the pointers (which would get put into shared pointers in the thread and
      stack frame classes) and cause double free issues. MallocScribble helped to
      find these issues after I did some other cleanup. To help avoid any
      RegisterContext issue in the future, all code that deals with them now
      returns shared pointers to the register contexts so we don't end up with
      multiple deletions. Also now that the RegisterContext class doesn't require
      a stack frame, we patched a memory leak where a StackFrame object was being
      created and leaked.
      
      Made the RegisterContext class not have a pointer to a StackFrame object as
      one register context class can be used for N inlined stack frames so there is
      not a 1 - 1 mapping. Updates the ExecutionContextScope part of the 
      RegisterContext class to never return a stack frame to indicate this when it
      is asked to recreate the execution context. Now register contexts point to the
      concrete frame using a concrete frame index. Concrete frames are all of the
      frames that are actually formed on the stack of a thread. These concrete frames
      can be turned into one or more user visible frames due to inlining. Each 
      inlined stack frame has the exact same register context (shared via shared
      pointers) as any parent inlined stack frames all the way up to the concrete 
      frame itself.
      
      So now the stack frames and the register contexts should behave much better.
      
      llvm-svn: 122976
      5ccbd294
  4. Jan 04, 2011
  5. Dec 20, 2010
  6. Dec 17, 2010
    • Greg Clayton's avatar
      Added access to set the current stack frame within a thread so any command · f028a1fb
      Greg Clayton authored
      line commands can use the current thread/frame.
      
      Fixed an issue with expressions that get sandboxed in an objective C method
      where unichar wasn't being passed down.
      
      Added a "static size_t Scalar::GetMaxByteSize();" function in case we need
      to know the max supported by size of something within a Scalar object.
      
      llvm-svn: 122027
      f028a1fb
  7. Dec 16, 2010
  8. Dec 14, 2010
    • Greg Clayton's avatar
      Modified LLDB expressions to not have to JIT and run code just to see variable · 8b2fe6dc
      Greg Clayton authored
      values or persistent expression variables. Now if an expression consists of
      a value that is a child of a variable, or of a persistent variable only, we
      will create a value object for it and make a ValueObjectConstResult from it to
      freeze the value (for program variables only, not persistent variables) and
      avoid running JITed code. For everything else we still parse up and JIT code
      and run it in the inferior. 
      
      There was also a lot of clean up in the expression code. I made the 
      ClangExpressionVariables be stored in collections of shared pointers instead
      of in collections of objects. This will help stop a lot of copy constructors on
      these large objects and also cleans up the code considerably. The persistent
      clang expression variables were moved over to the Target to ensure they persist
      across process executions.
      
      Added the ability for lldb_private::Target objects to evaluate expressions.
      We want to evaluate expressions at the target level in case we aren't running
      yet, or we have just completed running. We still want to be able to access the
      persistent expression variables between runs, and also evaluate constant 
      expressions. 
      
      Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects
      can now dump their contents with the UUID, arch and full paths being logged with
      appropriate prefix values.
      
      Thread hardened the Communication class a bit by making the connection auto_ptr
      member into a shared pointer member and then making a local copy of the shared
      pointer in each method that uses it to make sure another thread can't nuke the
      connection object while it is being used by another thread.
      
      Added a new file to the lldb/test/load_unload test that causes the test a.out file
      to link to the libd.dylib file all the time. This will allow us to test using
      the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else.
      
      llvm-svn: 121745
      8b2fe6dc
    • Sean Callanan's avatar
      Bugfixes for the new "self" pointer handling. Specifically, · 9d48e804
      Sean Callanan authored
      the code to pass the _cmd pointer has been improved, and _cmd
      is now set to the value of _cmd for the current context, as
      opposed to being simply NULL.
      
      llvm-svn: 121739
      9d48e804
  9. 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
  10. Dec 07, 2010
  11. Dec 06, 2010
  12. Dec 03, 2010
    • Sean Callanan's avatar
      Eliminated a redundant code path. · d6e04ae5
      Sean Callanan authored
      llvm-svn: 120834
      d6e04ae5
    • Sean Callanan's avatar
      Removed a compiler warning. · 4a5fcbb9
      Sean Callanan authored
      llvm-svn: 120788
      4a5fcbb9
    • 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
    • Greg Clayton's avatar
      Updated to latest LLVM/Clang for external AST source changes that allow · 38a61403
      Greg Clayton authored
      TagDecl subclasses and Objective C interfaces to complete themselves through
      the ExternalASTSource class.
      
      llvm-svn: 120749
      38a61403
  13. Dec 02, 2010
  14. Dec 01, 2010
  15. Nov 30, 2010
    • Sean Callanan's avatar
      Fixed a problem where m_register_info was not being · f5a99864
      Sean Callanan authored
      copied by the copy constructor for ClangExpressionVariable.
      This meant that a NULL m_register_info wouldn't be
      copied, and instead the field was uninitialized, potentially
      confusing the materializer.
      
      llvm-svn: 120472
      f5a99864
    • Jim Ingham's avatar
      Moved the code in ClangUserExpression that set up & ran the thread plan with... · f48169bb
      Jim Ingham authored
      Moved the code in ClangUserExpression that set up & ran the thread plan with timeouts, and restarting with all threads into a utility function in Process.  This required a bunch of renaming. 
      
      Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it.
      
      Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened.
      
      llvm-svn: 120386
      f48169bb
    • Sean Callanan's avatar
      Added a feature where registers can be referred to · 348b5897
      Sean Callanan authored
      using special $-variables from expressions.
      
      (lldb) expr $rip
      
      These variables are available for reading and
      writing.
      
      llvm-svn: 120367
      348b5897
  16. Nov 29, 2010
  17. Nov 20, 2010
  18. Nov 19, 2010
  19. Nov 18, 2010
Loading