Skip to content
  1. Sep 13, 2012
  2. Sep 04, 2012
  3. Mar 20, 2012
  4. Mar 19, 2012
    • Enrico Granata's avatar
      Massive enumeration name changes: a number of enums in ValueObject were not... · 86cc9829
      Enrico Granata authored
      Massive enumeration name changes: a number of enums in ValueObject were not following the naming pattern
      Changes to synthetic children:
       - the update(self): function can now (optionally) return a value - if it returns boolean value True, ValueObjectSyntheticFilter will not clear its caches across stop-points
         this should allow better performance for Python-based synthetic children when one can be sure that the child ValueObjects have not changed
       - making a difference between a synthetic VO and a VO with a synthetic value: now a ValueObjectSyntheticFilter will not return itself as its own synthetic value, but will (correctly)
         claim to itself be synthetic
       - cleared up the internal synthetic children architecture to make a more consistent use of pointers and references instead of shared pointers when possible
       - major cleanup of unnecessary #include, data and functions in ValueObjectSyntheticFilter itself
       - removed the SyntheticValueType enum and replaced it with a plain boolean (to which it was equivalent in the first place)
      Some clean ups to the summary generation code
      Centralized the code that clears out user-visible strings and data in ValueObject
      More efficient summaries for libc++ containers
      
      llvm-svn: 153061
      86cc9829
  5. Mar 07, 2012
    • Enrico Granata's avatar
      Using the new ScriptInterpreterObject in the implementation of synthetic... · a73b7df7
      Enrico Granata authored
      Using the new ScriptInterpreterObject in the implementation of synthetic children to enhance type safety
      Several places in the ScriptInterpreter interface used StringList objects where an std::string would suffice - Fixed
      Refactoring calls that generated special-purposes functions in the Python interpreter to use helper functions instead of duplicating blobs of code
      
      llvm-svn: 152164
      a73b7df7
  6. 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
  7. Feb 17, 2012
    • Greg Clayton's avatar
      This checking is part one of trying to add some threading safety to our · cc4d0146
      Greg Clayton authored
      internals. The first part of this is to use a new class:
      
      lldb_private::ExecutionContextRef
      
      This class holds onto weak pointers to the target, process, thread and frame
      and it also contains the thread ID and frame Stack ID in case the thread and
      frame objects go away and come back as new objects that represent the same
      logical thread/frame. 
      
      ExecutionContextRef objcets have accessors to access shared pointers for
      the target, process, thread and frame which might return NULL if the backing
      object is no longer available. This allows for references to persistent program
      state without needing to hold a shared pointer to each object and potentially
      keeping that object around for longer than it needs to be. 
      
      You can also "Lock" and ExecutionContextRef (which contains weak pointers)
      object into an ExecutionContext (which contains strong, or shared pointers)
      with code like
      
      ExecutionContext exe_ctx (my_obj->GetExectionContextRef().Lock());
      
      llvm-svn: 150801
      cc4d0146
  8. 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
  9. Feb 03, 2012
    • Enrico Granata's avatar
      Added a new --omit-names (-O, uppercase letter o) option to "type summary add". · a6a60d0d
      Enrico Granata authored
      When used in conjunction with --inline-children, this option will cause the names of the values to be omitted from the output. This can be beneficial in cases such as vFloat, where it will compact the representation from
      ([0]=1,[1]=2,[2]=3,[3]=4) to (1, 2, 3, 4).
      Added a test case to check that the new option works correctly.
      Also took some time to revisit SummaryFormat and related classes and tweak them for added readability and maintainability.
      Finally, added a new class name to which the std::string summary should be applied.
      
      llvm-svn: 149644
      a6a60d0d
  10. Nov 04, 2011
    • Greg Clayton's avatar
      Fixed the Xcode project building of LLVM to be a bit more user friendly: · dce502ed
      Greg Clayton authored
      - If you download and build the sources in the Xcode project, x86_64 builds
        by default using the "llvm.zip" checkpointed LLVM.
      - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the
        Xcode project will download the right LLVM sources and build them from 
        scratch
      - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib"
        directory, we will use the sources you have placed in the LLDB directory.
        
      Python can now be disabled for platforms that don't support it. 
      
      Changed the way the libllvmclang.a files get used. They now all get built into
      arch specific directories and never get merged into universal binaries as this
      was causing issues where you would have to go and delete the file if you wanted
      to build an extra architecture slice.
      
      llvm-svn: 143678
      dce502ed
  11. Oct 31, 2011
  12. Oct 23, 2011
  13. Oct 12, 2011
  14. Sep 22, 2011
    • Greg Clayton's avatar
      Converted the lldb_private::Process over to use the intrusive · c14ee32d
      Greg Clayton authored
      shared pointers.
      
      Changed the ExecutionContext over to use shared pointers for
      the target, process, thread and frame since these objects can
      easily go away at any time and any object that was holding onto
      an ExecutionContext was running the risk of using a bad object.
      
      Now that the shared pointers for target, process, thread and
      frame are just a single pointer (they all use the instrusive
      shared pointers) the execution context is much safer and still
      the same size. 
      
      Made the shared pointers in the the ExecutionContext class protected
      and made accessors for all of the various ways to get at the pointers,
      references, and shared pointers.
      
      llvm-svn: 140298
      c14ee32d
  15. Sep 06, 2011
    • Enrico Granata's avatar
      Redesign of the interaction between Python and frozen objects: · 9128ee2f
      Enrico Granata authored
       - introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
         a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
         in frozen objects ; now such reads transparently move from host to target as required
       - as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
         removed code that enabled to recognize an expression result VO as such
       - introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
         representing a T* or T[], and doing dereferences transparently
         in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
       - as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
         en lieu of doing the raw read itself
       - introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
         this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
         in public layer this returns an SBData, just like GetPointeeData()
       - introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
         the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
         of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
       - added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
      Solved a bug where global pointers to global variables were not dereferenced correctly for display
      New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
      Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
      Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
       of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
       addresses that generate file address children UNLESS we have a live process)
      Updated help text for summary-string
      Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
      Edited the syntax and help for some commands to have proper argument types
      
      llvm-svn: 139160
      9128ee2f
  16. Aug 23, 2011
  17. Aug 22, 2011
    • Greg Clayton's avatar
      Added a new plug-in type: lldb_private::OperatingSystem. The operating system · 56d9a1b3
      Greg Clayton authored
      plug-ins are add on plug-ins for the lldb_private::Process class that can add
      thread contexts that are read from memory. It is common in kernels to have
      a lot of threads that are not currently executing on any cores (JTAG debugging
      also follows this sort of thing) and are context switched out whose state is
      stored in memory data structures. Clients can now subclass the OperatingSystem
      plug-ins and then make sure their Create functions correcltly only enable 
      themselves when the right binary/target triple are being debugged. The 
      operating system plug-ins get a chance to attach themselves to processes just
      after launching or attaching and are given a lldb_private::Process object 
      pointer which can be inspected to see if the main executable, target triple,
      or any shared  libraries match a case where the OS plug-in should be used.
      Currently the OS plug-ins can create new threads, define the register contexts
      for these threads (which can all be different if desired), and populate and
      manage the thread info (stop reason, registers in the register context) as
      the debug session goes on.
      
      llvm-svn: 138228
      56d9a1b3
  18. Aug 19, 2011
    • Enrico Granata's avatar
      - Now using ${var} as the summary for an aggregate type will produce... · d64d0bc0
      Enrico Granata authored
      - Now using ${var} as the summary for an aggregate type will produce "name-of-type @ object-location" instead of giving an error
        e.g. you may get "foo_class @ 0x123456" when typing "type summary add -f ${var} foo_class"
      - Added a new special formatting token %T for summaries. This shows the type of the object.
        Using it, the new "type @ location" summary could be manually generated by writing ${var%T} @ ${var%L}
      - Bits and pieces required to support "frame variable array[n-m]"
        The feature is not enabled yet because some additional design and support code is required, but the basics
        are getting there
      - Fixed a potential issue where a ValueObjectSyntheticFilter was not holding on to its SyntheticChildrenSP
        Because of the way VOSF are being built now, this has never been an actual issue, but it is still sensible for
        a VOSF to hold on to the SyntheticChildrenSP as well as to its FrontEnd
      
      llvm-svn: 138080
      d64d0bc0
  19. Aug 18, 2011
    • Enrico Granata's avatar
      First round of code cleanups: · c482a192
      Enrico Granata authored
       - all instances of "vobj" have been renamed to "valobj"
       - class Debugger::Formatting has been renamed to DataVisualization (defined in FormatManager.h/cpp)
         The interface to this class has not changed
       - FormatCategory now uses ConstString's as keys to the navigators instead of repeatedly casting
         from ConstString to const char* and back all the time
         Next step is making the same happen for categories themselves
       - category gnu-libstdc++ is defined in the constructor for a FormatManager
         The source code for it is defined in gnu_libstdcpp.py, drawn from examples/synthetic at compile time
         All references to previous 'osxcpp' name have been removed from both code and file names
      Functional changes:
       - the name of the option to use a summary string for 'type summary add' has changed from the previous --format-string
         to the new --summary-string. It is expected that the short option will change from -f to -s, and -s for --python-script
         will become -o
      
      llvm-svn: 137886
      c482a192
  20. Aug 10, 2011
    • Greg Clayton's avatar
      While tracking down memory consumption issue a few things were needed: the · 3418c857
      Greg Clayton authored
      ability to dump more information about modules in "target modules list". We
      can now dump the shared pointer reference count for modules, the pointer to
      the module itself (in case performance tools can help track down who has
      references to said pointer), and the modification time.
      
      Added "target delete [target-idx ...]" to be able to delete targets when they
      are no longer needed. This will help track down memory usage issues and help 
      to resolve when module ref counts keep getting incremented. If the command gets
      no arguments, the currently selected target will be deleted. If any arguments 
      are given, they must all be valid target indexes (use the "target list" 
      command to get the current target indexes).
      
      Took care of a bunch of "no newline at end of file" warnings.
      
      TimeValue objects can now dump their time to a lldb_private::Stream object.
      
      Modified the "target modules list --global" command to not error out if there
      are no targets since it doesn't require a target.
      
      Fixed an issue in the MacOSX DYLD dynamic loader plug-in where if a shared 
      library was updated on disk, we would keep using the older one, even if it was
      updated.
      
      Don't allow the ModuleList::GetSharedModule(...) to return an empty module.
      Previously we could specify a valid path on disc to a module, and specify an
      architecture that wasn't contained in that module and get a shared pointer to
      a module that wouldn't be able to return an object file or a symbol file. We
      now make sure an object file can be extracted prior to adding the shared pointer
      to the module to get added to the shared list.
      
      llvm-svn: 137196
      3418c857
  21. Aug 04, 2011
    • Enrico Granata's avatar
      New formatting symbol %# can be used in summary strings to get the "count of... · 5dfd49cc
      Enrico Granata authored
      New formatting symbol %# can be used in summary strings to get the "count of children" of a variable
       - accordingly, the test cases for the synthetic providers for the std:: containers have been edited to use
         ${svar%#} instead of ${svar.len} to print out the count of elements ; the .len synthetic child has been
         removed from the synthetic providers
      The synthetic children providers for the std:: containers now return None when asked for children indexes >= num_children()
      Basic code to support filter names based on regular expressions (WIP)
      
      llvm-svn: 136862
      5dfd49cc
  22. Aug 02, 2011
    • Enrico Granata's avatar
      Fixed a bug where a variable could not be formatted in a summary if its... · c3e320a7
      Enrico Granata authored
      Fixed a bug where a variable could not be formatted in a summary if its datatype already had a custom format
      Fixed a bug where Objective-C variables coming out of the expression parser could crash the Python synthetic providers:
       - expression parser output has a "frozen data" component, which is a byte-exact copy of the value (in host memory),
         if trying to read into memory based on the host address, LLDB would crash. we are now passing the correct (target)
         pointer to the Python code
      Objective-C "id" variables are now formatted according to their dynamic type, if the -d option to frame variable is used:
       - Code based on the Objective-C 2.0 runtime is used to obtain this information without running code on the target
      
      llvm-svn: 136695
      c3e320a7
  23. Jul 29, 2011
    • Enrico Granata's avatar
      Public API changes: · 6f3533fb
      Enrico Granata authored
       - Completely new implementation of SBType
       - Various enhancements in several other classes
      Python synthetic children providers for std::vector<T>, std::list<T> and std::map<K,V>:
       - these return the actual elements into the container as the children of the container
       - basic template name parsing that works (hopefully) on both Clang and GCC
       - find them in examples/synthetic and in the test suite in functionalities/data-formatter/data-formatter-python-synth
      New summary string token ${svar :
       - the syntax is just the same as in ${var but this new token lets you read the values
         coming from the synthetic children provider instead of the actual children
       - Python providers above provide a synthetic child len that returns the number of elements
         into the container
      Full bug fix for the issue in which getting byte size for a non-complete type would crash LLDB
      Several other fixes, including:
       - inverted the order of arguments in the ClangASTType constructor
       - EvaluationPoint now only returns SharedPointer's to Target and Process
       - the help text for several type subcommands now correctly indicates argument-less options as such
      
      llvm-svn: 136504
      6f3533fb
  24. Jul 25, 2011
  25. Jul 24, 2011
    • Enrico Granata's avatar
      Python synthetic children: · a37a065c
      Enrico Granata authored
       - you can now define a Python class as a synthetic children producer for a type
         the class must adhere to this "interface":
              def __init__(self, valobj, dict):
           	def get_child_at_index(self, index):
           	def get_child_index(self, name):
         then using type synth add -l className typeName
         (e.g. type synth add -l fooSynthProvider foo)
         (This is still WIP with lots to be added)
         A small test case is available also as reference
      
      llvm-svn: 135865
      a37a065c
  26. Jul 22, 2011
    • Enrico Granata's avatar
      when typing a summary string you can use the %S symbol to explicitly indicate... · d55546b2
      Enrico Granata authored
      when typing a summary string you can use the %S symbol to explicitly indicate that you want the summary to be used to print the target object
       (e.g. ${var%S}). this might already be the default if your variable is of an aggregate type
      new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset
       - the restricted list of children obeys the typical rules (e.g. summaries prevail over children)
       - one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible
       - to provide a synthetic children list use the "type synth add" command, as in:
         type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4]
         (you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported)
       - a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones
      
      llvm-svn: 135731
      d55546b2
  27. Jul 19, 2011
    • Enrico Granata's avatar
      The implementation of categories is now synchronization safe · 20edcdbe
      Enrico Granata authored
      Code cleanup:
       - The Format Manager implementation is now split between two files: FormatClasses.{h|cpp} where the
         actual formatter classes (ValueFormat, SummaryFormat, ...) are implemented and
         FormatManager.{h|cpp} where the infrastructure classes (FormatNavigator, FormatManager, ...)
         are contained. The wrapper code always remains in Debugger.{h|cpp}
       - Several leftover fields, methods and comments from previous design choices have been removed
      type category subcommands (enable, disable, delete) now can take a list of category names as input
       - for type category enable, saying "enable A B C" is the same as saying
          enable C
          enable B
          enable A
         (the ordering is relevant in enabling categories, and it is expected that a user typing
          enable A B C wants to look into category A, then into B, then into C and not the other
          way round)
       - for the other two commands, the order is not really relevant (however, the same inverted ordering
         is used for consistency)
      
      llvm-svn: 135494
      20edcdbe
Loading