Skip to content
  1. Mar 16, 2012
  2. Mar 12, 2012
    • Enrico Granata's avatar
      Added formatters for libc++ (http://libcxx.llvm.org): · c7f87306
      Enrico Granata authored
       std::string has a summary provider
       std::vector std::list and std::map have both a summary and a synthetic children provider
      Given the usage of a custom namespace (std::__1::classname) for the implementation of libc++, we keep both libstdcpp and libc++ formatters enabled at the same time since that raises no conflicts and enabled for seamless transition between the two
      The formatters for libc++ reside in a libcxx category, and are loaded from libcxx.py (to be found in examples/synthetic)
      
      The formatters-stl test cases have been divided to be separate for libcxx and libstdcpp. This separation is necessary because
       (a) we need different compiler flags for libc++ than for libstdcpp
       (b) libc++ inlines a lot more than libstdcpp and some code changes were required to accommodate this difference
      
      llvm-svn: 152570
      c7f87306
  3. Mar 08, 2012
    • Sean Callanan's avatar
      Updated the revision of LLVM/Clang used by LLDB. · 226b70c1
      Sean Callanan authored
      This takes two important changes:
      
      - Calling blocks is now supported.  You need to
        cast their return values, but that works fine.
      
      - We now can correctly run JIT-compiled
        expressions that use floating-point numbers.
      
      Also, we have taken a fix that allows us to
      ignore access control in Objective-C as in C++.
      
      llvm-svn: 152286
      226b70c1
  4. Mar 06, 2012
  5. Mar 05, 2012
  6. Mar 03, 2012
    • Enrico Granata's avatar
      added a new formatter for CF(Mutable)BitVector · 385ad4e4
      Enrico Granata authored
      fixed a few potential NULL-pointer derefs in ValueObject
      we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits
      added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain
      
      llvm-svn: 151962
      385ad4e4
  7. Mar 02, 2012
  8. Mar 01, 2012
    • Enrico Granata's avatar
      (a) adding an introspection formatter for NS(Mutable)IndexSet · 896cd1d3
      Enrico Granata authored
      (b) fixes and improvements to the formatters for NSDate and NSString
      (c) adding an introspection formatter for NSCountedSet
      (d) making the Objective-C formatters test cases pass on both 64 and 32 bit
          one of the test cases is marked as expected failure on i386 - support needs to be added to the LLDB core for it to pass
      
      llvm-svn: 151826
      896cd1d3
    • Sean Callanan's avatar
      Updated LLVM to take a new MC JIT that supports · d5f33a86
      Sean Callanan authored
      allocations by section.  We install these sections
      in the target process and inform the JIT of their
      new locations.
      
      Also removed some unused variable warnings.
      
      llvm-svn: 151789
      d5f33a86
  9. Feb 29, 2012
    • Enrico Granata's avatar
      This commit: · 7bc0ec3a
      Enrico Granata authored
       a) adds a Python summary provider for NSDate
       b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around
       c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side
       d) contains much needed performance improvements:
          1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time
          2) redundant memory reads in the Python ObjC runtime wrapper are eliminated
          3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object
       e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure
      
      llvm-svn: 151703
      7bc0ec3a
  10. Feb 25, 2012
  11. Feb 24, 2012
    • Greg Clayton's avatar
      Fixed the launching code when using the new SBLaunchInfo. · 38d1f051
      Greg Clayton authored
      llvm-svn: 151392
      38d1f051
    • Greg Clayton's avatar
      Added the new way we will eventually do all attaches and launches. First clients · 0e615684
      Greg Clayton authored
      will fill out either a SBLaunchInfo or SBAttachInfo class, then call:
      
      SBProcess SBTarget::Launch (SBLaunchInfo &, SBError &);
      SBProcess SBTarget::Attach (SBAttachInfo &, SBError &);
      
      The attach is working right now and allows the ability to set many filters such
      as the parent process ID, the user/group ID, the effective user/group ID, and much
      more.
      
      The launch is not yet working, but I will get this working soon. By changing our
      launch and attach calls to take an object, it allows us to add more capabilities to
      launching and attaching without having to have launch and attach functions that
      take more and more arguments. 
      
      Once this is all working we will deprecated the older launch and attach fucntions
      and eventually remove them.
      
      llvm-svn: 151344
      0e615684
    • Sean Callanan's avatar
      Updated LLVM to take some fixes that make the · 6f298a64
      Sean Callanan authored
      Intel disassembler usable.
      
      Also flipped the switch: we are now exclusively
      using Disassembler.h instead of
      EnhancedDisassembly.h for all disassembly in
      LLDB.
      
      llvm-svn: 151306
      6f298a64
    • Enrico Granata's avatar
      This patch provides a set of formatters for most of the commonly used Cocoa classes. · d3d444f8
      Enrico Granata authored
      The formatter for NSString is an improved version of the one previously shipped as an example, the others are new in design and implementation.
      A more robust and OO-compliant Objective-C runtime wrapper is provided for runtime versions 1 and 2 on 32 and 64 bit.
      The formatters are contained in a category named "AppKit", which is not enabled at startup.
      
      llvm-svn: 151299
      d3d444f8
  12. Feb 23, 2012
  13. Feb 22, 2012
  14. Feb 21, 2012
  15. Feb 17, 2012
    • Enrico Granata's avatar
      Adding formatters for several useful Objective-C/Cocoa data types. The new... · 864e3e84
      Enrico Granata authored
      Adding formatters for several useful Objective-C/Cocoa data types. The new categories are not enabled at startup, but can be manually activated if desired.
      Adding new API calls to SBValue to be able to retrieve the associated formatters
      Some refactoring to FormatNavigator::Get() in order to shrink its size down to more manageable terms (a future, massive, refactoring effort will still be needed)
      Test cases added for the above
      
      llvm-svn: 150784
      864e3e84
  16. Feb 16, 2012
  17. Feb 15, 2012
    • Enrico Granata's avatar
      <rdar://problem/10062621> · 061858ce
      Enrico Granata authored
      New public API for handling formatters: creating, deleting, modifying categories, and formatters, and managing type/formatter association.
      This provides SB classes for each of the main object types involved in providing formatter support:
       SBTypeCategory
       SBTypeFilter
       SBTypeFormat
       SBTypeSummary
       SBTypeSynthetic
      plus, an SBTypeNameSpecifier class that is used on the public API layer to abstract the notion that formatters can be applied to plain type-names as well as to regular expressions
      For naming consistency, this patch also renames a lot of formatters-related classes.
      Plus, the changes in how flags are handled that started with summaries is now extended to other classes as well. A new enum (lldb::eTypeOption) is meant to support this on the public side.
      The patch also adds several new calls to the formatter infrastructure that are used to implement by-index accessing and several other design changes required to accommodate the new API layer.
      An architectural change is introduced in that backing objects for formatters now become writable. On the public API layer, CoW is implemented to prevent unwanted propagation of changes.
      Lastly, there are some modifications in how the "default" category is constructed and managed in relation to other categories.
      
      llvm-svn: 150558
      061858ce
  18. Feb 09, 2012
  19. Feb 08, 2012
  20. Feb 06, 2012
    • Greg Clayton's avatar
      Removed all of the "#ifndef SWIG" from the SB header files since we are using · 5569e64e
      Greg Clayton authored
      interface (.i) files for each class.
      
      Changed the FindFunction class from:
      
      uint32_t
      SBTarget::FindFunctions (const char *name, 
                               uint32_t name_type_mask, 
                               bool append, 
                               lldb::SBSymbolContextList& sc_list)
      
      uint32_t
      SBModule::FindFunctions (const char *name, 
                               uint32_t name_type_mask, 
                               bool append, 
                               lldb::SBSymbolContextList& sc_list)
      
      To:
      
      lldb::SBSymbolContextList
      SBTarget::FindFunctions (const char *name, 
                               uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
      
      lldb::SBSymbolContextList
      SBModule::FindFunctions (const char *name,
                               uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
      
      This makes the API easier to use from python. Also added the ability to
      append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList.
      
      Exposed properties for lldb.SBSymbolContextList in python:
      
      lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list
      lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list
      lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list
      lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list
      lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list
      lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list
      
      This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...)
      and then the result can be used to extract the desired information:
      
      sc_list = lldb.target.FindFunctions("erase")
      
      for function in sc_list.functions:
          print function
      for symbol in sc_list.symbols:
          print symbol
      
      Exposed properties for the lldb.SBSymbolContext objects in python:
      
      lldb.SBSymbolContext.module => lldb.SBModule
      lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit
      lldb.SBSymbolContext.function => lldb.SBFunction
      lldb.SBSymbolContext.block => lldb.SBBlock
      lldb.SBSymbolContext.line_entry => lldb.SBLineEntry
      lldb.SBSymbolContext.symbol => lldb.SBSymbol
      
      
      Exposed properties for the lldb.SBBlock objects in python:
      
      lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains
      lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block
      lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block
      lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column
      lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents
      lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block)
      lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned
      lldb.SBBlock.ranges => an array or all address ranges for this block
      lldb.SBBlock.num_ranges => the number of address ranges for this blcok
      
      SBFunction objects can now get the SBType and the SBBlock that represents the
      top scope of the function.
      
      SBBlock objects can now get the variable list from the current block. The value
      list returned allows varaibles to be viewed prior with no process if code
      wants to check the variables in a function. There are two ways to get a variable
      list from a SBBlock:
      
      lldb::SBValueList
      SBBlock::GetVariables (lldb::SBFrame& frame,
                             bool arguments,
                             bool locals,
                             bool statics,
                             lldb::DynamicValueType use_dynamic);
      
      lldb::SBValueList
      SBBlock::GetVariables (lldb::SBTarget& target,
                             bool arguments,
                             bool locals,
                             bool statics);
      
      When a SBFrame is used, the values returned will be locked down to the frame
      and the values will be evaluated in the context of that frame.
      
      When a SBTarget is used, global an static variables can be viewed without a
      running process.
      
      llvm-svn: 149853
      5569e64e
  21. Feb 05, 2012
    • Greg Clayton's avatar
      <rdar://problem/10560053> · c9660546
      Greg Clayton authored
      Fixed "target modules list" (aliased to "image list") to output more information
      by default. Modified the "target modules list" to have a few new options:
      
      "--header" or "-h" => show the image header address
      "--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library)
      
      Removed the "--symfile-basename" or "-S" option, and repurposed it to 
      "--symfile-unique" "-S" which will show the symbol file if it differs from
      the executable file.
      
      ObjectFile's can now be loaded from memory for cases where we don't have the
      files cached locally in an SDK or net mounted root. ObjectFileMachO can now
      read mach files from memory.
      
      Moved the section data reading code into the ObjectFile so that the object
      file can get the section data from Process memory if the file is only in
      memory.
      
      lldb_private::Module can now load its object file in a target with a rigid 
      slide (very common operation for most dynamic linkers) by using:
      
      bool 
      Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)
      
      lldb::SBModule() now has a new constructor in the public interface:
      
      SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr);
      
      This will find an appropriate ObjectFile plug-in to load an image from memory
      where the object file header is at "header_addr".
      
      llvm-svn: 149804
      c9660546
  22. Feb 04, 2012
    • Sean Callanan's avatar
      I have brought LLDB up-to-date with top of tree · 5b26f27f
      Sean Callanan authored
      LLVM/Clang.  This brings in several fixes, including:
      
      - Improvements in the Just-In-Time compiler's
        allocation of memory: the JIT now allocates
        memory in chunks of sections, improving its
        ability to generate relocations.  I have
        revamped the RecordingMemoryManager to reflect
        these changes, as well as to get the memory
        allocation and data copying out fo the
        ClangExpressionParser code.  Jim Grosbach wrote
        the updates to the JIT on the LLVM side.
      
      - A new ExternalASTSource interface to allow LLDB to
        report accurate structure layout information to
        Clang.  Previously we could only report the sizes
        of fields, not their offsets.  This meant that if
        data structures included field alignment
        directives, we could not communicate the necessary
        alignment to Clang and accesses to the data would
        fail.  Now we can (and I have update the relevant
        test case).  Thanks to Doug Gregor for implementing
        the Clang side of this fix.
      
      - The way Objective-C interfaces are completed by
        Clang has been made consistent with RecordDecls;
        with help from Doug Gregor and Greg Clayton I have
        ensured that this still works.
      
      - I have eliminated all local LLVM and Clang patches,
        committing the ones that are still relevant to LLVM
        and Clang as needed.
      
      I have tested the changes extensively locally, but
      please let me know if they cause any trouble for you.
      
      llvm-svn: 149775
      5b26f27f
    • Greg Clayton's avatar
      Allow a SBAddress to be created from a SBSection and an offset. · 819134a7
      Greg Clayton authored
      Changed the lldb.SBModule.section[<str>] property to return a single section.
      
      Added a lldb.SBSection.addr property which returns an lldb.SBAddress object.
      
      llvm-svn: 149755
      819134a7
    • Greg Clayton's avatar
      Convert all python objects in our API to use overload the __str__ method · 81e871ed
      Greg Clayton authored
      instead of the __repr__. __repr__ is a function that should return an
      expression that can be used to recreate an python object and we were using
      it to just return a human readable string.
      
      Fixed a crasher when using the new implementation of SBValue::Cast(SBType).
      
      Thread hardened lldb::SBValue and lldb::SBWatchpoint and did other general
      improvements to the API.
      
      Fixed a crasher in lldb::SBValue::GetChildMemberWithName() where we didn't
      correctly handle not having a target.
      
      llvm-svn: 149743
      81e871ed
  23. Feb 03, 2012
    • Greg Clayton's avatar
      Expose more convenience functionality in the python classes. · 7edbdfc9
      Greg Clayton authored
      lldb.SBValueList now exposes the len() method and also allows item access:
      
      lldb.SBValueList[<int>] - where <int> is an integer index into the list, returns a single lldb.SBValue which might be empty if the index is out of range
      lldb.SBValueList[<str>] - where <str> is the name to look for, returns a list() of lldb.SBValue objects with any matching values (the list might be empty if nothing matches)
      lldb.SBValueList[<re>]  - where <re> is a compiles regular expression, returns a list of lldb.SBValue objects for containing any matches or a empty list if nothing matches
      
      lldb.SBFrame now exposes:
      
      lldb.SBFrame.variables => SBValueList of all variables that are in scope
      lldb.SBFrame.vars => see lldb.SBFrame.variables
      lldb.SBFrame.locals => SBValueList of all variables that are locals in the current frame
      lldb.SBFrame.arguments => SBValueList of all variables that are arguments in the current frame
      lldb.SBFrame.args => see lldb.SBFrame.arguments
      lldb.SBFrame.statics => SBValueList of all static variables
      lldb.SBFrame.registers => SBValueList of all registers for the current frame
      lldb.SBFrame.regs => see lldb.SBFrame.registers
      
      Combine any of the above properties with the new lldb.SBValueList functionality
      and now you can do:
      
      y = lldb.frame.vars['rect.origin.y']
      
      or
      
      vars = lldb.frame.vars
      for i in range len(vars):
        print vars[i]
      
      Also expose "lldb.SBFrame.var(<str>)" where <str> can be en expression path
      for any variable or child within the variable. This makes it easier to get a
      value from the current frame like "rect.origin.y". The resulting value is also
      not a constant result as expressions will return, but a live value that will
      continue to track the current value for the variable expression path.
      
      lldb.SBValue now exposes:
      
      lldb.SBValue.unsigned => unsigned integer for the value
      lldb.SBValue.signed => a signed integer for the value
      
      llvm-svn: 149684
      7edbdfc9
    • Greg Clayton's avatar
      Fixed casting in the lldb::SBValue::Cast(SBType) function. · 9a142cf8
      Greg Clayton authored
      llvm-svn: 149673
      9a142cf8
    • Greg Clayton's avatar
      Cleaned up the documentation strings for many helper objects and added · b62bb8ce
      Greg Clayton authored
      lldb.SBModule.section and lldb.SBModule.sections property access.
      
      llvm-svn: 149665
      b62bb8ce
    • Greg Clayton's avatar
      Added support to SBType for getting template arguments from a SBType: · 402230e6
      Greg Clayton authored
      uint32_t
      SBType::GetNumberOfTemplateArguments ();
      
      lldb::SBType
      SBType::GetTemplateArgumentType (uint32_t idx);
      
      lldb::TemplateArgumentKind
      SBType::GetTemplateArgumentKind (uint32_t idx);
      
      Some lldb::TemplateArgumentKind values don't have a corresponding SBType
      that will be returned from SBType::GetTemplateArgumentType(). This will
      help our data formatters do their job by being able to find out the
      type of template params and do smart things with those.
      
      llvm-svn: 149658
      402230e6
  24. Feb 02, 2012
  25. Feb 01, 2012
    • Greg Clayton's avatar
      Added many more python convenience accessors: · 6b2bd939
      Greg Clayton authored
      You can now access a frame in a thread using:
      
      lldb.SBThread.frame[int] -> lldb.SBFrame object for a frame in a thread
      
      Where "int" is an integer index. You can also access a list object with all of
      the frames using:
      
      lldb.SBThread.frames => list() of lldb.SBFrame objects
      
      All SB objects that give out SBAddress objects have properties named "addr"
      
      lldb.SBInstructionList now has the following convenience accessors for len() and
      instruction access using an index:
      
      insts = lldb.frame.function.instructions
      for idx in range(len(insts)):
          print insts[idx]
          
      Instruction lists can also lookup an isntruction using a lldb.SBAddress as the key:
      
      pc_inst = lldb.frame.function.instructions[lldb.frame.addr]
      
      lldb.SBProcess now exposes:
      
      lldb.SBProcess.is_alive => BOOL Check if a process is exists and is alive
      lldb.SBProcess.is_running => BOOL check if a process is running (or stepping):
      lldb.SBProcess.is_running => BOOL check if a process is currently stopped or crashed:
      lldb.SBProcess.thread[int] => lldb.SBThreads for a given "int" zero based index
      lldb.SBProcess.threads => list() containing all lldb.SBThread objects in a process
      
      SBInstruction now exposes:
      lldb.SBInstruction.mnemonic => python string for instruction mnemonic
      lldb.SBInstruction.operands => python string for instruction operands
      lldb.SBInstruction.command => python string for instruction comment
      
      SBModule now exposes:
      
      lldb.SBModule.uuid => uuid.UUID(), an UUID object from the "uuid" python module
      lldb.SBModule.symbol[int] => lldb.Symbol, lookup symbol by zero based index
      lldb.SBModule.symbol[str] => list() of lldb.Symbol objects that match "str"
      lldb.SBModule.symbol[re] => list() of lldb.Symbol objecxts that match the regex
      lldb.SBModule.symbols => list() of all symbols in a module
      
        
      SBAddress objects can now access the current load address with the "lldb.SBAddress.load_addr"
      property. The current "lldb.target" will be used to try and resolve the load address.
      
      Load addresses can also be set using this accessor:
      
      addr = lldb.SBAddress()
      addd.load_addr = 0x123023
      
      Then you can check the section and offset to see if the address got resolved.
      
      SBTarget now exposes:
      
      lldb.SBTarget.module[int] => lldb.SBModule from zero based module index
      lldb.SBTarget.module[str] => lldb.SBModule by basename or fullpath or uuid string
      lldb.SBTarget.module[uuid.UUID()] => lldb.SBModule whose UUID matches
      lldb.SBTarget.module[re] => list() of lldb.SBModule objects that match the regex
      lldb.SBTarget.modules => list() of all lldb.SBModule objects in the target
      
      SBSymbol now exposes:
      
      lldb.SBSymbol.name => python string for demangled symbol name
      lldb.SBSymbol.mangled => python string for mangled symbol name or None if there is none
      lldb.SBSymbol.type => lldb.eSymbolType enum value
      lldb.SBSymbol.addr => SBAddress object that represents the start address for this symbol (if there is one)
      lldb.SBSymbol.end_addr => SBAddress for the end address of the symbol  (if there is one)
      lldb.SBSymbol.prologue_size => pythin int containing The size of the prologue in bytes
      lldb.SBSymbol.instructions => SBInstructionList containing all instructions for this symbol
      
      SBFunction now also has these new properties in addition to what is already has:
      lldb.SBFunction.addr => SBAddress object that represents the start address for this function
      lldb.SBFunction.end_addr => SBAddress for the end address of the function
      lldb.SBFunction.instructions => SBInstructionList containing all instructions for this function
      
      SBFrame now exposes the SBAddress for the frame:
      lldb.SBFrame.addr => SBAddress which is the section offset address for the current frame PC
      
      These are all in addition to what was already added. Documentation and website
      updates coming soon.
      
      llvm-svn: 149489
      6b2bd939
    • Greg Clayton's avatar
      Added a new convenience property on lldb.SBThread names "frames" which always... · 2415586f
      Greg Clayton authored
      Added a new convenience property on lldb.SBThread names "frames" which always returns a complete list of all lldb.SBFrame objects:
      
      (lldb) script
      >>> frames = lldb.thread.frames
      >>> for frame in frames:
      ...   print frame
      
      Also changed all of the "__repr__" methods to strip any trailing newline characters so we don't end up with entra newlines.
      
      llvm-svn: 149466
      2415586f
Loading