Skip to content
  1. Sep 12, 2010
  2. Sep 11, 2010
    • Greg Clayton's avatar
      Remove the eSymbolTypeFunction, eSymbolTypeGlobal, and eSymbolTypeStatic. · bcf2cfbd
      Greg Clayton authored
      They will now be represented as:
      eSymbolTypeFunction: eSymbolTypeCode with IsDebug() == true
        eSymbolTypeGlobal: eSymbolTypeData with IsDebug() == true and IsExternal() == true
        eSymbolTypeStatic: eSymbolTypeData with IsDebug() == true and IsExternal() == false
      
      This simplifies the logic when dealing with symbols and allows for symbols
      to be coalesced into a single symbol most of the time.
      
      Enabled the minimal symbol table for mach-o again after working out all the
      kinks. We now get nice concise symbol tables and debugging with DWARF in the
      .o files with a debug map in the binary works well again. There were issues
      where the SymbolFileDWARFDebugMap symbol file parser was using symbol IDs and
      symbol indexes interchangeably. Now that all those issues are resolved 
      debugging is working nicely.
      
      llvm-svn: 113678
      bcf2cfbd
    • Jim Ingham's avatar
      Move the "Object Description" into the ValueObject, and the add an API to · 53c47f1e
      Jim Ingham authored
      SBValue to access it.  For now this is just the result of ObjC NSPrintForDebugger,
      but could be extended.  Also store the results of the ObjC Object Printer in a
      Stream, not a ConstString.
      
      llvm-svn: 113660
      53c47f1e
    • Jim Ingham's avatar
      When the debugger updates its symbol context, if no thread or frame are... · 59ce7fe0
      Jim Ingham authored
      When the debugger updates its symbol context, if no thread or frame are selected select the first thread's 0th frame.
      
      llvm-svn: 113657
      59ce7fe0
  3. Sep 10, 2010
    • Greg Clayton's avatar
      Added some missing API for address resolving within a module, and looking · 09960031
      Greg Clayton authored
      up a seciton offset address (SBAddress) within a module that returns a
      symbol context (SBSymbolContext). Also added a SBSymbolContextList in 
      preparation for adding find/lookup APIs that can return multiple results.
      
      Added a lookup example code that shows how to do address lookups.
      
      llvm-svn: 113599
      09960031
    • Jason Molenda's avatar
      The first part of an lldb native stack unwinder. · fbcb7f2c
      Jason Molenda authored
      The Unwind and RegisterContext subclasses still need
      to be finished; none of this code is used by lldb at
      this point (unless you call into it by hand).
      
      The ObjectFile class now has an UnwindTable object.
      
      The UnwindTable object has a series of FuncUnwinders
      objects (Function Unwinders) -- one for each function
      in that ObjectFile we've backtraced through during this
      debug session.
      
      The FuncUnwinders object has a few different UnwindPlans.
      UnwindPlans are a generic way of describing how to find
      the canonical address of a given function's stack frame
      (the CFA idea from DWARF/eh_frame) and how to restore the
      caller frame's register values, if they have been saved
      by this function.
      
      UnwindPlans are created from different sources.  One source is the
      eh_frame exception handling information generated by the compiler
      for unwinding an exception throw.  Another source is an assembly
      language inspection class (UnwindAssemblyProfiler, uses the Plugin
      architecture) which looks at the instructions in the funciton
      prologue and describes the stack movements/register saves that are
      done.
      
      Two additional types of UnwindPlans that are worth noting are
      the "fast" stack UnwindPlan which is useful for making a first
      pass over a thread's stack, determining how many stack frames there
      are and retrieving the pc and CFA values for each frame (enough
      to create StackFrameIDs).  Only a minimal set of registers is
      recovered during a fast stack walk.  
      
      The final UnwindPlan is an architectural default unwind plan.
      These are provided by the ArchDefaultUnwindPlan class (which uses
      the plugin architecture).  When no symbol/function address range can
      be found for a given pc value -- when we have no eh_frame information
      and when we don't have a start address so we can't examine the assembly
      language instrucitons -- we have to make a best guess about how to 
      unwind.  That's when we use the architectural default UnwindPlan.
      On x86_64, this would be to assume that rbp is used as a stack pointer
      and we can use that to find the caller's frame pointer and pc value.
      It's a last-ditch best guess about how to unwind out of a frame.
      
      There are heuristics about when to use one UnwindPlan versues the other --
      this will all happen in the still-begin-written UnwindLLDB subclass of
      Unwind which runs the UnwindPlans.
      
      llvm-svn: 113581
      fbcb7f2c
    • Caroline Tice's avatar
      If the file the user specifies can't be found in the current directory, · 428a9a58
      Caroline Tice authored
      and the user didn't specify a particular directory, search for the file 
      using the $PATH environment variable.
      
      llvm-svn: 113575
      428a9a58
    • Greg Clayton's avatar
      Cleaned up the output of "image lookup --address <ADDR>" which involved · c9800667
      Greg Clayton authored
      cleaning up the output of many GetDescription objects that are part of a 
      symbol context. This fixes an issue where no ranges were being printed out
      for functions, blocks and symbols.
      
      llvm-svn: 113571
      c9800667
  4. Sep 09, 2010
  5. Sep 08, 2010
  6. Sep 07, 2010
  7. Sep 04, 2010
    • Caroline Tice's avatar
      · 3df9a8df
      Caroline Tice authored
      This is a very large commit that completely re-does the way lldb
      handles user settable internal variables (the equivalent of set/show
      variables in gdb).  In addition to the basic infrastructure (most of
      which is defined in UserSettingsController.{h,cpp}, there are examples
      of two classes that have been set up to contain user settable
      variables (the Debugger and Process classes).  The 'settings' command
      has been modified to be a command-subcommand structure, and the 'set',
      'show' and 'append' commands have been moved into this sub-commabnd
      structure.  The old StateVariable class has been completely replaced
      by this, and the state variable dictionary has been removed from the
      Command Interpreter.  Places that formerly accessed the state variable
      mechanism have been modified to access the variables in this new
      structure instead (checking the term-width; getting/checking the
      prompt; etc.)
      
      Variables are attached to classes; there are two basic "flavors" of
      variables that can be set: "global" variables (static/class-wide), and
      "instance" variables (one per instance of the class).  The whole thing
      has been set up so that any global or instance variable can be set at
      any time (e.g. on start up, in your .lldbinit file), whether or not
      any instances actually exist (there's a whole pending and default
      values mechanism to help deal with that).
      
      llvm-svn: 113041
      3df9a8df
    • Greg Clayton's avatar
      Improved name demangling performance by 20% on darwin. · e41e5899
      Greg Clayton authored
      llvm-svn: 113032
      e41e5899
    • Johnny Chen's avatar
      Fixed an lldb infrastructure bug, where the debugger should reaaly update its · 725945d5
      Johnny Chen authored
      execution context only when the process is still alive.  When running the test
      suite, the debugger is launching and killing processes constantly.
      
      This might be the cause of the test hang as reported in rdar://problem/8377854,
      where the debugger was looping infinitely trying to update a supposedly stale
      thread list.
      
      llvm-svn: 113022
      725945d5
  8. 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
    • Greg Clayton's avatar
      StackFrame objects now own ValueObjects for any frame variables (locals, args, · 288bdf9c
      Greg Clayton authored
      function statics, file globals and static variables) that a frame contains. 
      The StackFrame objects can give out ValueObjects instances for
      each variable which allows us to track when a variable changes and doesn't
      depend on variable names when getting value objects.
      
      StackFrame::GetVariableList now takes a boolean to indicate if we want to
      get the frame compile unit globals and static variables.
      
      The value objects in the stack frames can now correctly track when they have
      been modified. There are a few more tweaks needed to complete this work. The
      biggest issue is when stepping creates partial stacks (just frame zero usually)
      and causes previous stack frames not to match up with the current stack frames
      because the previous frames only has frame zero. We don't really want to 
      require that all previous frames be complete since stepping often must check
      stack frames to complete their jobs. I will fix this issue tomorrow.
      
      llvm-svn: 112800
      288bdf9c
  9. Sep 01, 2010
  10. Aug 30, 2010
  11. Aug 28, 2010
  12. Aug 27, 2010
  13. Aug 26, 2010
    • Jim Ingham's avatar
      Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to... · 2976d00a
      Jim Ingham authored
      Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "Selected" i.e. GetSelectedThread.  Selected makes more sense, since these are set by some user action (a selection).  I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected.
      
      llvm-svn: 112221
      2976d00a
  14. Aug 25, 2010
    • Greg Clayton's avatar
      Fixed another issue with the inline stack frames where if the first frame · 288e5afe
      Greg Clayton authored
      has inlined functions that all started at the same address, then the inlined
      backtrace would not produce correct stack frames.
      
      Also cleaned up and inlined a lot of stuff in lldb_private::Address.
      
      Added a function to StackFrame to detect if the frame is a concrete frame so
      we can detect the difference between actual frames and inlined frames.
      
      llvm-svn: 111989
      288e5afe
  15. Aug 24, 2010
    • Greg Clayton's avatar
      Got a lot of the kinks worked out in the inline support after debugging more · 9da7bd07
      Greg Clayton authored
      complex inlined examples.
      
      StackFrame classes don't have a "GetPC" anymore, they have "GetFrameCodeAddress()".
      This is because inlined frames will have a PC value that is the same as the 
      concrete frame that owns the inlined frame, yet the code locations for the
      frame can be different. We also need to be able to get the real PC value for
      a given frame so that variables evaluate correctly. To get the actual PC
      value for a frame you can use:
      
          addr_t pc = frame->GetRegisterContext()->GetPC();
      
      Some issues with the StackFrame stomping on its own symbol context were 
      resolved which were causing the information to change for a frame when the
      stack ID was calculated. Also the StackFrame will now correctly store the
      symbol context resolve flags for any extra bits of information that were 
      looked up (if you ask for a block only and you find one, you will alwasy have
      the compile unit and function).
      
      llvm-svn: 111964
      9da7bd07
    • 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
  16. Aug 18, 2010
    • Greg Clayton's avatar
      Changed "Error Value::GetValueAsData (...)" to set the data extractor byte · ad3843c9
      Greg Clayton authored
      order and address size correctly when the value comes from a file address.
      Values have "file" addresses when they are globals and the debug information
      specifies that they live in the object file at a given address (DWARF will
      represent this as a location "DW_OP_addr <addr>"). This causes global pointers
      to correctly extract their children on 64 bit programs.
      
      llvm-svn: 111380
      ad3843c9
  17. Aug 10, 2010
  18. Aug 03, 2010
    • Greg Clayton's avatar
      Added FindTypes to Module and ModuleList. · 3504eee8
      Greg Clayton authored
      llvm-svn: 110093
      3504eee8
    • Greg Clayton's avatar
      Added support for objective C built-in types: id, Class, and SEL. This · b0b9fe61
      Greg Clayton authored
      involved watching for the objective C built-in types in DWARF and making sure
      when we convert the DWARF types into clang types that we use the appropriate
      ASTContext types.
      
      Added a way to find and dump types in lldb (something equivalent to gdb's 
      "ptype" command):
      
          image lookup --type <TYPENAME>
      
      This only works for looking up types by name and won't work with variables.
      It also currently dumps out verbose internal information. I will modify it
      to dump more appropriate user level info in my next submission.
      
      Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so
      we can lookup types by name in one or more images.
      
      Fixed "image lookup --address <ADDRESS>" to be able to correctly show all
      symbol context information, but it will only show this extra information when
      the new "--verbose" flag is used.
      
      Updated to latest LLVM to get a few needed fixes.
      
      llvm-svn: 110089
      b0b9fe61
  19. Jul 28, 2010
    • Greg Clayton's avatar
      Created lldb::LanguageType by moving an enumeration from the · 9e40956a
      Greg Clayton authored
      lldb_private::Language class into the enumerations header so it can be freely
      used by other interfaces.
      
      Added correct objective C class support to the DWARF symbol parser. Prior to
      this fix we were parsing objective C classes as C++ classes and now that the
      expression parser is ready to call functions we need to make sure the objective
      C classes have correct AST types.
      
      llvm-svn: 109574
      9e40956a
  20. Jul 27, 2010
    • Sean Callanan's avatar
      Changed SymbolContext so when you search for functions · 8ade104a
      Sean Callanan authored
      it returns a list of functions as a SymbolContextList.
      
      Rewrote the clients of SymbolContext to use this
      SymbolContextList.
      
      Rewrote some of the providers of the data to SymbolContext
      to make them respect preferences as to whether the list
      should be cleared first; propagated that change out.
      
      ClangExpressionDeclMap and ClangASTSource use this new
      function list to properly generate function definitions -
      even for functions that don't have a prototype in the
      debug information.
      
      llvm-svn: 109476
      8ade104a
  21. Jul 23, 2010
  22. Jul 22, 2010
    • Greg Clayton's avatar
      Modified both the ObjectFileMachO and ObjectFileELF to correctly set the · 4ceb9980
      Greg Clayton authored
      SectionType for Section objects for DWARF.
      
      Modified the DWARF plug-in to get the DWARF sections by SectionType so we
      can safely abstract the LLDB core from section names for the various object
      file formats.
      
      Modified the SectionType definitions for .debug_pubnames and .debug_pubtypes
      to use the correct case.
      
      llvm-svn: 109054
      4ceb9980
Loading