Skip to content
  1. Jan 26, 2011
  2. Jan 25, 2011
  3. Jan 24, 2011
  4. Jan 23, 2011
    • Jim Ingham's avatar
      Add some more logging of broadcaster and Process. Also, protect the event... · 1e7a9ee7
      Jim Ingham authored
      Add some more logging of broadcaster and Process.  Also, protect the event broadcasting against hijacking in mid-event delivery.
      
      llvm-svn: 124084
      1e7a9ee7
    • Greg Clayton's avatar
      b2daec9b
    • Greg Clayton's avatar
      Added a new variant of SBTarget::Launch() that deprectates the old one that · bd82a5d2
      Greg Clayton authored
      takes separate file handles for stdin, stdout, and stder and also allows for
      the working directory to be specified.
      
      Added support to "process launch" to a new option: --working-dir=PATH. We
      can now set the working directory. If this is not set, it defaults to that
      of the process that has LLDB loaded. Added the working directory to the
      host LaunchInNewTerminal function to allows the current working directory 
      to be set in processes that are spawned in their own terminal. Also hooked this
      up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its
      API changed, but nothing is making use of it yet. Modfied "debugserver" and
      "darwin-debug" to also handle the current working directory options and modified
      the code in LLDB that spawns these tools to pass the info along.
      
      Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout
      and stderr. 
      
      After clearing the default values for the stdin/out/err file handles for
      process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable
      which is now fixed. Also fixed the setting of boolean values to be able to
      be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no",
      "off", or "0" for false.
      
      Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not
      already opened. Previous to this fix debugserver would only correctly open and dupe
      file handles for the slave side of a pseudo terminal. It now correctly handles
      getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to
      files. Also made sure the file handles were correctly opened with the NOCTTY flag
      for terminals.
      
      llvm-svn: 124060
      bd82a5d2
    • Greg Clayton's avatar
      Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properly · 6779606a
      Greg Clayton authored
      checking the validity of the shared pointer prior to using it.
      
      Fixed the GDB remote plug-in to once again watch for a reply from the "k" 
      packet, and fixed the logic to make sure the thread requesting the kill
      and the async thread play nice (and very quickly) by synchronizing the
      packet sending and reply. I also tweaked some of the shut down packet
      ("k" kill, "D" detach, and the halt packet) to make sure they do the right
      thing.
      
      Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass
      the timeout along to WaitForStateChangedEventsPrivate() and made the function
      behave correctly with respect to timing out.
      
      Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added
      the start of being able to set the working directory for the inferior process.
      
      llvm-svn: 124049
      6779606a
  5. Jan 22, 2011
    • Greg Clayton's avatar
      Avoid the race condition Stephen Wilson was worried about in revision 123465... · 7ecb3a04
      Greg Clayton authored
      Avoid the race condition Stephen Wilson was worried about in revision 123465 by making a local copy. We need to be able to have the private state thread let the lldb_private::Process class that it has exited, otherwise we end up with a timeout when the process destructor or DoDestroy is called where the private state thread has already exited and then StopPrivateStateThread() will wait for the thread which has already existed to respond to it. 
      
      llvm-svn: 124038
      7ecb3a04
    • Greg Clayton's avatar
      Sped up the shutdown time on MacOSX by quite a bit by making sure any · 6ed95945
      Greg Clayton authored
      threads that we spawn let us know when they are going away and that we
      don't timeout waiting for a message from threads that have gone away.
      We also now don't expect the "k" packet (kill) to send a response. This
      greatly speeds up debugger shutdown performance. The test suite now runs
      quite a bit faster.
      
      Added a fix to the variable display code that fixes the display of
      base classes. We were assuming the virtual or normal base class offsets
      were being given in bit sizes, but they were being given as character
      sizes, so we needed to multiply the offset by 8. This wasn't affecting
      the expression parser, but it was affecting the correct display of C++
      class base classes and all of their children.
      
      llvm-svn: 124024
      6ed95945
    • Jim Ingham's avatar
      Added an interface for noticing new thread creation. At this point, I only turn it on when · 1c823b43
      Jim Ingham authored
      we are requesting a single thread to run.  May seem like a silly thing to do, but the kernel 
      on MacOS X will inject new threads into a program willy-nilly, and I would like to keep them
      from running if I can.
      
      llvm-svn: 124018
      1c823b43
    • Jim Ingham's avatar
      Add more logging. Try to handle the case where "Halt" fails. This is kind of... · e22e88b8
      Jim Ingham authored
      Add more logging.  Try to handle the case where "Halt" fails.  This is kind of a losing game in the end, if we can't halt the target, it is not clear what we can do but keep trying...
      
      llvm-svn: 124017
      e22e88b8
    • Jim Ingham's avatar
      Centralize the register reporting (might want to move this function to Thread). · 9da3683c
      Jim Ingham authored
      Make sure DoTakedown gets called only once by adding a dedicated m_takedown_done bool. 
      Add a little more useful logging.
      
      llvm-svn: 124015
      9da3683c
  6. Jan 21, 2011
  7. Jan 20, 2011
    • Greg Clayton's avatar
      Added the ability to StackFrame::GetValueForVariableExpressionPath(...) to avoid · 6d5e68ea
      Greg Clayton authored
      fragile ivars if requested. This was done by changing the previous second parameter
      to an options bitfield that can be populated by logical OR'ing the new 
      StackFrame::ExpressionPathOption enum values together:
      
          typedef enum ExpressionPathOption
          {
              eExpressionPathOptionCheckPtrVsMember   = (1u << 0),
              eExpressionPathOptionsNoFragileObjcIvar = (1u << 1),
          };
      
      So the old function was:
           lldb::ValueObjectSP
           StackFrame::GetValueForVariableExpressionPath (const char *var_expr, bool check_ptr_vs_member, Error &error);
      
      But it is now:
      
          lldb::ValueObjectSP
          StackFrame::GetValueForVariableExpressionPath (const char *var_expr, uint32_t options, Error &error);
      
      This allows the expression parser in Target::EvaluateExpression(...) to avoid
      using simple frame variable expression paths when evaluating something that might
      be a fragile ivar.
      
      llvm-svn: 123938
      6d5e68ea
    • Jim Ingham's avatar
      Back up both the register AND the stop state when calling functions. · 77787033
      Jim Ingham authored
      Set the thread state to "bland" before calling functions so they don't 
        inherit the pending signals and die.
      
      llvm-svn: 123869
      77787033
  8. Jan 18, 2011
    • Greg Clayton's avatar
      Fixed incorrect logging printf (patch from Stephen Wilson). · 411c0ce8
      Greg Clayton authored
      llvm-svn: 123780
      411c0ce8
    • 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
    • Jim Ingham's avatar
      In ThreadPlanCallFunction, do the Takedown right when the thread plan gets... · bda4e5eb
      Jim Ingham authored
      In ThreadPlanCallFunction, do the Takedown right when the thread plan gets popped.  When the function call is discarded (e.g. when it crashes and discard_on_error is true) the plan gets discarded.  You need to make sure that the stack gets restored right then, and not wait till you start again and the thread plan stack is cleared.
      
      llvm-svn: 123716
      bda4e5eb
  9. Jan 17, 2011
    • Greg Clayton's avatar
      A few of the issue I have been trying to track down and fix have been due to · 6beaaa68
      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
      6beaaa68
  10. Jan 14, 2011
  11. 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
  12. Jan 12, 2011
  13. Jan 10, 2011
    • Greg Clayton's avatar
      Change the default signal setting for SIBABRT to SUPPRESS the signal. Why? · 1bf55f2a
      Greg Clayton authored
      When debugging, if an expression hits a SIGABRT, it the expression ends up
      completing and stopping due the the "SIGABRT". Then the next thing that runs
      (another expression, or continuing the program) ends up progating the SIGABRT
      and causing the parent processes to die.
      
      We should probably think of a different solution where we suppress any signal
      that resulted due to an expression, or we modifyin the UnixSignals class to
      contain a row for "suppress for expression".
      
      So the settings for SIGABRT are: suppress = true, stop = true, and 
      notify = true.
      
      llvm-svn: 123157
      1bf55f2a
  14. 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
  15. Jan 07, 2011
    • Greg Clayton's avatar
      Added memory caching to lldb_private::Process. All lldb_private::Process · 58be07b2
      Greg Clayton authored
      subclasses will automatically be able to take advantage of caching. The
      cache line size is set to 512 by default.
      
      This greatly speeds up stack backtraces on MacOSX when using the 
      ProcessGDBRemote process plug-in since only about 6300 packets per second
      can be sent.
      
      Initial speedups show:
      
      Prior to caching: 10,000 stack frames took 5.2 seconds
      After caching: 10,000 stack frames in 240 ms!
      
      About a 20x speedup!
      
      llvm-svn: 122996
      58be07b2
    • Greg Clayton's avatar
      Added the ability for Target::ReadMemory to prefer to read from the file · db598230
      Greg Clayton authored
      cache even when a valid process exists. Previously, Target::ReadMemory would
      read from the process if there was a valid one and then fallback to the
      object file cache.
      
      llvm-svn: 122989
      db598230
  16. 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
  17. Dec 22, 2010
    • Jason Molenda's avatar
      RegisterContextLLDB.cpp (InitializeNonZerothFrame): If we get a · f830e481
      Jason Molenda authored
      0 mid-stack, stop backtracing.
      
      SectionLoadList.cpp (ResolveLoadAddress): Don't assert on an
      out-of-range address, just return an invalid Address object.
      The unwinder may be passing in invalid addresses on the final
      stack frame and the assert is a problem.
      
      llvm-svn: 122386
      f830e481
  18. Dec 20, 2010
  19. Dec 16, 2010
Loading