Skip to content
  1. Jun 24, 2013
  2. Jun 06, 2013
  3. May 29, 2013
  4. May 10, 2013
  5. Apr 19, 2013
    • Sean Callanan's avatar
      Optimized the way breakpoint conditions are evaluated. · 3dbf346e
      Sean Callanan authored
      Previously, the options for a breakopint or its
      locations stored only the text of the breakpoint
      condition (ironically, they used ClangUserExpression
      as a glorified std::string) and, each time the condition
      had to be evaluated in the StopInfo code, the expression
      parser would be invoked via a static method to parse and
      then execute the expression.
      
      I made several changes here:
      
        - Each breakpoint location now has its own
          ClangUserExpressionSP containing a version of
          the breakpoint expression compiled for that exact
          location.
      
        - Whenever the breakpoint is hit, the breakpoint
          condition expression is simply re-run to determine
          whether to stop.
      
        - If the process changes (e.g., it's re-run) or
          the source code of the expression changes (we use
          a hash so as to avoid doing string comparisons)
          the ClangUserExpressionSP is re-generated.
      
      This should improve performance of breakpoint
      conditions significantly, and takes advantage of
      the recent expression re-use work.
      
      llvm-svn: 179838
      3dbf346e
  6. 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
  7. Dec 05, 2012
  8. Nov 29, 2012
  9. Sep 22, 2012
  10. Aug 29, 2012
    • Greg Clayton's avatar
      <rdar://problem/11757916> · 1f746071
      Greg Clayton authored
      Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
      - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". 
      - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
      - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
      - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
      
      Cleaned up header includes a bit as well.
      
      llvm-svn: 162860
      1f746071
  11. Jun 27, 2012
  12. May 02, 2012
  13. Feb 08, 2012
  14. Feb 01, 2012
  15. Jan 30, 2012
  16. 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
  17. Jan 26, 2012
  18. Jan 24, 2012
  19. Dec 02, 2011
  20. Sep 17, 2011
    • Greg Clayton's avatar
      Adopt the intrusive pointers in: · 4d122c40
      Greg Clayton authored
      lldb_private::Breakpoint
      lldb_private::BreakpointLocations
      lldb_private::BreakpointSite
      lldb_private::Debugger
      lldb_private::StackFrame
      lldb_private::Thread
      lldb_private::Target
      
      llvm-svn: 139985
      4d122c40
  21. Aug 09, 2011
    • Jim Ingham's avatar
      Move the handling of breakpoint conditions from the Private event loop to the... · 4b536182
      Jim Ingham authored
      Move the handling of breakpoint conditions from the Private event loop to the StopInfoBreakpoint::DoActions, which happens as the 
      event is removed.  Also use the return value of asynchronous breakpoint callbacks, they get checked before, and override the 
      breakpoint conditions.
      
      Added ProcessModInfo class, to unify "stop_id generation" and "memory modification generation", and use where needed.
      
      llvm-svn: 137102
      4b536182
  22. Jun 15, 2011
  23. Jun 03, 2011
  24. May 23, 2011
    • Greg Clayton's avatar
      Added new lldb_private::Process memory read/write functions to stop a bunch · f3ef3d2a
      Greg Clayton authored
      of duplicated code from appearing all over LLDB:
      
      lldb::addr_t
      Process::ReadPointerFromMemory (lldb::addr_t vm_addr, Error &error);
      
      bool
      Process::WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Error &error);
      
      size_t
      Process::ReadScalarIntegerFromMemory (lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Error &error);
      
      size_t
      Process::WriteScalarToMemory (lldb::addr_t vm_addr, const Scalar &scalar, uint32_t size, Error &error);
      
      in lldb_private::Process the following functions were renamed:
      
      From:
      uint64_t
      Process::ReadUnsignedInteger (lldb::addr_t load_addr, 
                                    size_t byte_size,
                                    Error &error);
      
      To:
      uint64_t
      Process::ReadUnsignedIntegerFromMemory (lldb::addr_t load_addr, 
                                              size_t byte_size,
                                              uint64_t fail_value, 
                                              Error &error);
      
      Cleaned up a lot of code that was manually doing what the above functions do
      to use the functions listed above.
      
      Added the ability to get a scalar value as a buffer that can be written down
      to a process (byte swapping the Scalar value if needed):
      
      uint32_t 
      Scalar::GetAsMemoryData (void *dst,
                              uint32_t dst_len, 
                              lldb::ByteOrder dst_byte_order,
                              Error &error) const;
      
      The "dst_len" can be smaller that the size of the scalar and the least 
      significant bytes will be written. "dst_len" can also be larger and the
      most significant bytes will be padded with zeroes. 
      
      Centralized the code that adds or removes address bits for callable and opcode
      addresses into lldb_private::Target:
      
      lldb::addr_t
      Target::GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const;
      
      lldb::addr_t
      Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const;
      
      All necessary lldb_private::Address functions now use the target versions so
      changes should only need to happen in one place if anything needs updating.
      
      Fixed up a lot of places that were calling :
      
      addr_t
      Address::GetLoadAddress(Target*);
      
      to call the Address::GetCallableLoadAddress() or Address::GetOpcodeLoadAddress()
      as needed. There were many places in the breakpoint code where things could
      go wrong for ARM if these weren't used.
      
      llvm-svn: 131878
      f3ef3d2a
  25. Feb 05, 2011
  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 29, 2010
  28. Oct 28, 2010
  29. Oct 15, 2010
    • Jim Ingham's avatar
      Added support for breakpoint conditions. I also had to separate the "run the... · 36f3b369
      Jim Ingham authored
      Added support for breakpoint conditions.  I also had to separate the "run the expression" part of ClangFunction::Execute from the "Gather the expression result" so that in the case of the Breakpoint condition I can move the condition evaluation into the normal thread plan processing.
      
      Also added support for remembering the "last set breakpoint" so that "break modify" will act on the last set breakpoint.
      
      llvm-svn: 116542
      36f3b369
  30. Sep 15, 2010
  31. Sep 03, 2010
  32. Sep 02, 2010
    • Greg Clayton's avatar
      Added a new bool parameter to many of the DumpStopContext() methods that · 6dadd508
      Greg Clayton authored
      might dump file paths that allows the dumping of full paths or just the
      basenames. Switched the stack frame dumping code to use just the basenames for
      the files instead of the full path.
      
      Modified the StackID class to no rely on needing the start PC for the current
      function/symbol since we can use the SymbolContextScope to uniquely identify
      that, unless there is no symbol context scope. In that case we can rely upon
      the current PC value. This saves the StackID from having to calculate the 
      start PC when the StackFrame::GetStackID() accessor is called.
      
      Also improved the StackID less than operator to correctly handle inlined stack
      frames in the same stack.
      
      llvm-svn: 112867
      6dadd508
  33. Aug 24, 2010
    • Greg Clayton's avatar
      Added support for inlined stack frames being represented as real stack frames · 1b72fcb7
      Greg Clayton authored
      which is now on by default. Frames are gotten from the unwinder as concrete
      frames, then if inline frames are to be shown, extra information to track
      and reconstruct these frames is cached with each Thread and exanded as needed.
      
      I added an inline height as part of the lldb_private::StackID class, the class
      that helps us uniquely identify stack frames. This allows for two frames to
      shared the same call frame address, yet differ only in inline height.
      
      Fixed setting breakpoint by address to not require addresses to resolve.
      
      A quick example:
      
      % cat main.cpp
      
      % ./build/Debug/lldb test/stl/a.out 
      Current executable set to 'test/stl/a.out' (x86_64).
      (lldb) breakpoint set --address 0x0000000100000d31
      Breakpoint created: 1: address = 0x0000000100000d31, locations = 1
      (lldb) r
      Launching 'a.out'  (x86_64)
      (lldb) Process 38031 Stopped
      * thread #1: tid = 0x2e03, pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280, stop reason = breakpoint 1.1, queue = com.apple.main-thread
       277   	
       278   	      _CharT*
       279   	      _M_data() const
       280 ->	      { return  _M_dataplus._M_p; }
       281   	
       282   	      _CharT*
       283   	      _M_data(_CharT* __p)
      (lldb) bt
      thread #1: tid = 0x2e03, stop reason = breakpoint 1.1, queue = com.apple.main-thread
        frame #0: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280
        frame #1: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_rep() const at /usr/include/c++/4.2.1/bits/basic_string.h:288
        frame #2: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::size() const at /usr/include/c++/4.2.1/bits/basic_string.h:606
        frame #3: pc = 0x0000000100000d31, where = a.out`main [inlined] operator<< <char, std::char_traits<char>, std::allocator<char> > at /usr/include/c++/4.2.1/bits/basic_string.h:2414
        frame #4: pc = 0x0000000100000d31, where = a.out`main + 33 at /Volumes/work/gclayton/Documents/src/lldb/test/stl/main.cpp:14
        frame #5: pc = 0x0000000100000d08, where = a.out`start + 52
      
      Each inline frame contains only the variables that they contain and each inlined
      stack frame is treated as a single entity.
      
      llvm-svn: 111877
      1b72fcb7
  34. Jul 17, 2010
  35. Jul 09, 2010
  36. Jun 22, 2010
  37. Jun 18, 2010
    • Jim Ingham's avatar
      Change the Breakpoint & BreakpointLocation GetDescription methods so they call... · 0136309f
      Jim Ingham authored
      Change the Breakpoint & BreakpointLocation GetDescription methods so they call the BreakpointOptions::GetDescription rather
      than picking bits out of the breakpoint options.  Added BreakpointOptions::GetDescription to do this job.  Some more mucking
      around to keep the breakpoint listing from getting too verbose.
      
      llvm-svn: 106262
      0136309f
  38. Jun 16, 2010
    • Jim Ingham's avatar
      Add a "thread specification" class that specifies thread specific breakpoints... · 1b54c88c
      Jim Ingham authored
      Add a "thread specification" class that specifies thread specific breakpoints by name, index, queue or TID.  
      Push this through all the breakpoint management code.  Allow this to be set when the breakpoint is created.
      Fix the Process classes so that a breakpoint hit that is not for a particular thread is not reported as a 
      breakpoint hit event for that thread.
      Added a "breakpoint configure" command to allow you to reset any of the thread 
      specific options (or the ignore count.)
      
      llvm-svn: 106078
      1b54c88c
  39. Jun 14, 2010
    • Greg Clayton's avatar
      patch from: Jean-Daniel Dupas · 13238c44
      Greg Clayton authored
      BreakpointLocation::GetLoadAddress() does not match the 'StoppointLocation::GetLoadAddress() const' virtual function prototype, and so, does not override the superclass function.
      
      llvm-svn: 105927
      13238c44
Loading