Skip to content
  1. Apr 26, 2012
  2. Apr 25, 2012
  3. Mar 27, 2012
    • Enrico Granata's avatar
      adding a summary for Objective-C type 'Class' · bf70ee97
      Enrico Granata authored
      llvm-svn: 153541
      bf70ee97
    • Enrico Granata's avatar
      Synthetic values are now automatically enabled and active by default. SBValue... · c5bc412c
      Enrico Granata authored
      Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
      A new setting enable-synthetic-value is provided on the target to disable this behavior.
      There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
      The test suite has been changed accordingly.
      Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
      Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching
      
      llvm-svn: 153495
      c5bc412c
    • Greg Clayton's avatar
      <rdar://problem/11113279> · 84db9105
      Greg Clayton authored
      Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 
      
      This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.
      
      This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.
      
      llvm-svn: 153482
      84db9105
  4. Mar 22, 2012
    • Enrico Granata's avatar
      Removing cascading through inheritance chains for data formatters · 4a3274af
      Enrico Granata authored
      This is the feature that allowed the user to have things like:
      
      class Base { ... };
      class Derived : public Base { ... };
      
      and have formatters defined for Base work automatically for Derived.
      
      This feature turned out to be too expensive since it requires completing types.
      
      This patch takes care of removing cascading (other than typedefs chain cascading), updating the test suite accordingly, and adding required Cocoa class names to keep the AppKit formatters working
      
      llvm-svn: 153272
      4a3274af
  5. 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
  6. Mar 13, 2012
  7. 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
  8. Mar 08, 2012
  9. 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
  10. Mar 02, 2012
  11. 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
  12. 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
  13. Feb 24, 2012
    • 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
  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 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
  17. 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
  18. Jan 31, 2012
  19. 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
  20. Oct 27, 2011
    • Greg Clayton's avatar
      Added support for the new ".apple_objc" accelerator tables. These tables are · 5009f9d5
      Greg Clayton authored
      in the same hashed format as the ".apple_names", but they map objective C
      class names to all of the methods and class functions. We need to do this 
      because in the DWARF the methods for Objective C are never contained in the
      class definition, they are scattered about at the translation unit level and
      they don't even have attributes that say the are contained within the class
      itself. 
      
      Added 3 new formats which can be used to display data:
      
          eFormatAddressInfo
          eFormatHexFloat
          eFormatInstruction
          
      eFormatAddressInfo describes an address such as function+offset and file+line,
      or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
      The format character for this is "A", the long format is "address".
      
      eFormatHexFloat will print out the hex float format that compilers tend to use.
      The format character for this is "X", the long format is "hex float".
      
      eFormatInstruction will print out disassembly with bytes and it will use the
      current target's architecture. The format character for this is "i" (which
      used to be being used for the integer format, but the integer format also has
      "d", so we gave the "i" format to disassembly), the long format is 
      "instruction".
      
      Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
      been from the start. It is very specialized and doesn't belong in the public 
      API.
      
      llvm-svn: 143114
      5009f9d5
  21. Oct 12, 2011
  22. Sep 07, 2011
    • Enrico Granata's avatar
      Refactoring of Get() methods in FormatManager/FormatCategory to have... · 855cd901
      Enrico Granata authored
      Refactoring of Get() methods in FormatManager/FormatCategory to have explicative names and return shared-pointers instead of bools
      Reduced the amount of memory required to avoid loops in DumpPrintableRepresentation() from 32 bits down to 1 bit
       - Additionally, disallowed creating summary strings of the form ${var%S} which did nothing but cause endless loops by definition
      
      llvm-svn: 139201
      855cd901
  23. 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
  24. Aug 23, 2011
  25. Aug 22, 2011
    • Enrico Granata's avatar
      Code cleanup and refactoring (round 4): · 1d887499
      Enrico Granata authored
       - FormatCategories now are directly mapped by ConstString objects instead of going through
         const char* -> ConstString -> const char*
       - FormatCategory callback does not pass category name anymore. This is not necessary because
         FormatCategory objects themselves hold their name as a member variable
      
      llvm-svn: 138254
      1d887499
    • Enrico Granata's avatar
      - Support for Python namespaces: · def5391a
      Enrico Granata authored
        If you have a Python module foo, in order to use its contained objects in LLDB you do not need to use
        'from foo import *'. You can use 'import foo', and then refer to items in foo as 'foo.bar', and LLDB
        will know how to resolve bar as a member of foo.
        Accordingly, GNU libstdc++ formatters have been moved from the global namespace to gnu_libstdcpp and a few
        test cases are also updated to reflect the new convention. Python docs suggest using a plain 'import' en lieu of
        'from-import'.
      
      llvm-svn: 138244
      def5391a
  26. Aug 19, 2011
    • Enrico Granata's avatar
      Third round of code cleanups: · 02b6676d
      Enrico Granata authored
       - reorganizing the PTS (Partial Template Specializations) in FormatManager.h
       - applied a patch by Filipe Cabecinhas to make LLDB compile with GCC
      Functional changes:
       - fixed an issue where command type summary add for type "struct Foo" would not match any types.
         currently, "struct" will be stripped off and type "Foo" will be matched.
         similar behavior occurs for class, enum and union specifiers.
      
      llvm-svn: 138020
      02b6676d
  27. Aug 18, 2011
    • Enrico Granata's avatar
      Second round of code cleanups: · 85933ed4
      Enrico Granata authored
       - reorganizing classes layout to have public part first
         Typedefs that we want to keep private, but must be defined for some public code to work correctly are an exception
       - avoiding methods in the form T foo() { code; } all on one-line
       - moving method implementations from .h to .cpp whenever feasible
         Templatized code is an exception and so are very small methods
       - generally, adhering to coding conventions followed project-wide
      Functional changes:
       - fixed an issue where using ${var} in a summary for an aggregate, and then displaying a pointer-to-aggregate would lead to no summary being displayed
         The issue was not a major one because all ${var} was meant to do in that context was display an error for invalid use of pointer
         Accordingly fixed test cases and added a new test case
      
      llvm-svn: 137944
      85933ed4
    • 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
  28. Aug 12, 2011
    • Enrico Granata's avatar
      *Some more optimizations in usage of ConstString · 22c55d18
      Enrico Granata authored
      *New setting target.max-children-count gives an upper-bound to the number of child objects that will be displayed at each depth-level
        This might be a breaking change in some scenarios. To override the new limit you can use the --show-all-children (-A) option
        to frame variable or increase the limit in your lldbinit file
      *Command "type synthetic" has been split in two:
        - "type synthetic" now only handles Python synthetic children providers
        - the new command "type filter" handles filters
        Because filters and synthetic providers are both ways to replace the children of a ValueObject, only one can be effective at any given time.
      
      llvm-svn: 137416
      22c55d18
  29. 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
  30. 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
Loading