Skip to content
  1. Sep 15, 2011
    • Sean Callanan's avatar
      This patch modifies the expression parser to allow it · 3bfdaa2a
      Sean Callanan authored
      to execute expressions even in the absence of a process.
      This allows expressions to run in situations where the
      target cannot run -- e.g., to perform calculations based
      on type information, or to inspect a binary's static
      data.
      
      This modification touches the following files:
      
      lldb-private-enumerations.h
        Introduce a new enum specifying the policy for
        processing an expression.  Some expressions should
        always be JITted, for example if they are functions
        that will be used over and over again.  Some
        expressions should always be interpreted, for
        example if the target is unsafe to run.  For most,
        it is acceptable to JIT them, but interpretation
        is preferable when possible.
      
      Target.[h,cpp]
        Have EvaluateExpression now accept the new enum.
      
      ClangExpressionDeclMap.[cpp,h]
        Add support for the IR interpreter and also make
        the ClangExpressionDeclMap more robust in the 
        absence of a process.
      
      ClangFunction.[cpp,h]
        Add support for the new enum.
      
      IRInterpreter.[cpp,h]
        New implementation.
      
      ClangUserExpression.[cpp,h]
        Add support for the new enum, and for running 
        expressions in the absence of a process.
      
      ClangExpression.h
        Remove references to the old DWARF-based method
        of evaluating expressions, because it has been
        superseded for now.
      
      ClangUtilityFunction.[cpp,h]
        Add support for the new enum.
      
      ClangExpressionParser.[cpp,h]
        Add support for the new enum, remove references
        to DWARF, and add support for checking whether
        the expression could be evaluated statically.
      
      IRForTarget.[h,cpp]
        Add support for the new enum, and add utility
        functions to support the interpreter.
      
      IRToDWARF.cpp
        Removed
      
      CommandObjectExpression.cpp
        Remove references to the obsolete -i option.
      
      Process.cpp 
        Modify calls to ClangUserExpression::Evaluate
        to pass the correct enum (for dlopen/dlclose)
      
      SBValue.cpp
        Add support for the new enum.
      
      SBFrame.cpp
        Add support for he new enum.
      
      BreakpointOptions.cpp
        Add support for the new enum.
      
      llvm-svn: 139772
      3bfdaa2a
    • Jason Molenda's avatar
      · 995cd3a5
      Jason Molenda authored
      Have the FuncUnwinder object request & provide an architecture-defined
      UnwindPlan for unwinding from the first instruction of an otherwise
      unknown function call (GetUnwindPlanArchitectureDefaultAtFunctionEntry()).
      
      Update RegisterContextLLDB::GetFullUnwindPlanForFrame() to detect the
      case of a frame 0 at address 0x0 which indicates that we jumped through
      a NULL function pointer.  Use the ABI's FunctionEntryUnwindPlan to
      find the caller frame.
      
      These changes make it so lldb can identify the calling frame correctly
      in code like
      
      int main ()
      {
        void (*f)(void) = 0;
        f();
      }
      
      llvm-svn: 139760
      995cd3a5
  2. Sep 11, 2011
  3. Sep 10, 2011
  4. 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
  5. Sep 02, 2011
    • Greg Clayton's avatar
      Added the ability for DWARF locations to use the ABI plug-ins to resolve · afacd14b
      Greg Clayton authored
      register names when dumping variable locations and location lists. Also did
      some cleanup where "int" types were being used for "lldb::RegisterKind"
      values.
      
      llvm-svn: 138988
      afacd14b
    • Greg Clayton's avatar
      Added support for accessing and loading our new .debug_names and .debug_types · f9eec20b
      Greg Clayton authored
      DWARF accelerator table sections to the DWARF parser. These sections are similar
      to the .debug_pubnames and .debug_pubtypes, but they are designed to be hash tables
      that are saved to disc in a way that the sections can just be loaded into memory
      and used without any work on the debugger side. The .debug_pubnames and .debug_pubtypes
      sections are not ordered, contain a copy of the name in the section itself which
      makes these sections quite large, they only include publicly exported names (so no
      static functions, no types defined inside functions), many compilers put different
      information in them making them very unreliable so most debugger ignore these sections
      and parse the DWARF on their own. The tables must also be parsed and sorted in order 
      to be used effectively. The new sections can be quickly loaded and very efficiently be used 
      to do name to DIE lookups with very little up front work. The format of these new
      sections will be changing while we work out the bugs, but we hope to have really 
      fast name to DIE lookups soon.
      
      llvm-svn: 138979
      f9eec20b
  6. Aug 25, 2011
  7. Aug 19, 2011
    • Sean Callanan's avatar
      Refined the rollback to LLVM, picking up a newer · a87bee84
      Sean Callanan authored
      revision and adding a patch that fixes an AsmParser
      crash on ARM.
      
      One feature that we unfortunately lost (for the
      moment!) is the ability to cast unknown code symbols
      to arbitrary function types and put the resulting
      function pointer in a result variable.  This feature
      will be back, though.
      
      llvm-svn: 138036
      a87bee84
  8. Aug 16, 2011
  9. Aug 15, 2011
  10. Aug 12, 2011
  11. 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
    • Sean Callanan's avatar
      Fixed the type code to print "<invalid>" for NULL · 1c49954b
      Sean Callanan authored
      types instead of letting Clang crash.
      
      llvm-svn: 137167
      1c49954b
  12. Aug 09, 2011
    • Enrico Granata's avatar
      Basic support for reading synthetic children by index: · 27b625e1
      Enrico Granata authored
       if your datatype provides synthetic children, "frame variable object[index]" should now do the right thing
       in cases where the above syntax would have been rejected before, i.e.
        object is not a pointer nor an array (frame variable ignores potential overload of [])
        object is a pointer to an Objective-C class (which cannot be dereferenced)
       expression will still run operator[] if available and complain if it cannot do so
       synthetic children by name do not work yet
      
      llvm-svn: 137097
      27b625e1
  13. Aug 06, 2011
    • Sean Callanan's avatar
      This is an overhaul of the expression parser code · 72e4940b
      Sean Callanan authored
      that detects what context the current expression is
      meant to execute in.  LLDB now properly consults
      the method declaration in the debug information
      rather than trying to hunt down the "this" or "self"
      pointer by name, which can be misleading.
      
      Other fixes include:
      
      - LLDB now properly detects that it is inside
        an inlined C++ member function.
      
      - LLDB now allows access to non-const members when
        in const code.
      
      - The functions in SymbolFile that locate the
        DeclContext containing a DIE have been renamed
        to reflect what they actually do.  I have added
        new functions that find the DeclContext for the
        DIE itself.
      
      I have also introduced testcases for C++ and 
      Objective-C.
      
      llvm-svn: 136999
      72e4940b
  14. Aug 05, 2011
  15. Aug 04, 2011
  16. 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
  17. Jul 30, 2011
    • Sean Callanan's avatar
      This change brings in the latest LLVM/Clang, and · cc427fad
      Sean Callanan authored
      completes the support in the LLDB expression parser
      for incomplete types.  Clang now imports types
      lazily, and we complete those types as necessary.
      
      Changes include:
      
      - ClangASTSource now supports three APIs which it
        passes to ClangExpressionDeclMap.  CompleteType
        completes a TagDecl or an ObjCInterfaceDecl when
        needed; FindExternalVisibleDecls finds named
        entities that are visible in the expression's
        scope; and FindExternalLexicalDecls performs a
        (potentially restricted) search for entities
        inside a lexical scope like a namespace.  These
        changes mean that entities in namespaces should
        work normally.
      
      - The SymbolFileDWARF code for searching a context
        for a specific name is now more general, and can
        search arbitrary contexts.
      
      - We are continuing to adapt our calls into LLVM
        from interfaces that take start and end iterators
        when accepting multiple items to interfaces that
        use ArrayRef.
      
      - I have cleaned up some code, especially our use
        of namespaces.
      
      This change is neutral for our testsuite and greatly
      improves correctness for large programs (like Clang)
      with complicated type systems.  It should also lay
      the groundwork for improving the expression parser's
      performance as we are lazier and lazier about
      providing type information.
      
      llvm-svn: 136555
      cc427fad
    • Greg Clayton's avatar
      Fixed a compile error. · 880cbb04
      Greg Clayton authored
      llvm-svn: 136551
      880cbb04
    • Enrico Granata's avatar
      changes in the new GetMinimumLanguages() ; robustness improvements in the... · 3bcee026
      Enrico Granata authored
      changes in the new GetMinimumLanguages() ; robustness improvements in the CFStringSynthProvider object ; made a CFString_SummaryProvider function you can use if all you care about is the summary string for your NSString objects
      
      llvm-svn: 136544
      3bcee026
    • Greg Clayton's avatar
      Moved some functionality from ValueObject to ClangASTType. · 92eac7f5
      Greg Clayton authored
      llvm-svn: 136536
      92eac7f5
  18. 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
  19. Jul 26, 2011
  20. Jul 16, 2011
    • Enrico Granata's avatar
      System-wide summaries: · 9dd75c88
      Enrico Granata authored
       - Summaries for char*, const char* and char[] are loaded at startup as
         system-wide summaries. This means you cannot delete them unless you use
         the -a option to type summary delete/clear
       - You can add your own system-wide summaries by using the -w option to type
         summary add
      Several code improvements for the Python summaries feature
      
      llvm-svn: 135326
      9dd75c88
  21. Jul 12, 2011
    • Greg Clayton's avatar
      Added the ability to _not_ skip the prologue when settings breakpoints · d16e1e59
      Greg Clayton authored
      by name by adding an extra parameter to the lldb_private::Target breakpoint 
      setting functions.
      
      Added a function in the DWARF symbol file plug-in that can dump errors
      and prints out which DWARF file the error is happening in so we can track
      down what used to be assertions easily.
      
      Fixed the MacOSX kernel plug-in to properly read the kext images and set
      the kext breakpoint to watch for kexts as they are loaded.
      
      llvm-svn: 134990
      d16e1e59
    • Enrico Granata's avatar
      named summaries: · f9fa6ee5
      Enrico Granata authored
       - a new --name option for "type summary add" lets you give a name to a summary
       - a new --summary option for "frame variable" lets you bind a named summary to one or more variables
      ${var%s} now works for printing the value of 0-terminated CStrings
      type format test case now tests for cascading
       - this is disabled on GCC because GCC may end up stripping typedef chains, basically breaking cascading
      new design for the FormatNavigator class
      new template class CleanUp2 meant to support cleanup routines with 1 additional parameter beyond resource handle
      
      llvm-svn: 134943
      f9fa6ee5
  22. Jul 11, 2011
    • Greg Clayton's avatar
      Added the ability to see block variables when looking up addresses · c749eb89
      Greg Clayton authored
      with the "target modules lookup --address <addr>" command. The variable
      ID's, names, types, location for the address, and declaration is
      displayed.
      
      This can really help with crash logs since we get, on MacOSX at least,
      the registers for the thread that crashed so it is often possible to
      figure out some of the variable contents. 
      
      llvm-svn: 134886
      c749eb89
  23. Jul 10, 2011
    • Greg Clayton's avatar
      Allow the built in ValueObject summary providers for C strings · 45ba8543
      Greg Clayton authored
      use lldb_private::Target::ReadMemory(...) to allow constant strings
      to be displayed in global variables prior on in between process
      execution.
      
      Centralized the variable declaration dumping into:
      
      	bool
      	Variable::DumpDeclaration (Stream *s, bool show_fullpaths, bool show_module);
      
      Fixed an issue if you used "target variable --regex <regex>" where the
      variable name would not be displayed, but the regular expression would.
      
      Fixed an issue when viewing global variables through "target variable"
      might not display correctly when doing DWARF in object files.
      
      llvm-svn: 134878
      45ba8543
  24. Jul 09, 2011
    • Greg Clayton's avatar
      Fixed the global and static variables to always be in scope. · daf515fc
      Greg Clayton authored
      Made it so that you can create synthetic children of array
      value objects. This is for creating array members when the
      array index is out of range. This comes in handy when you have
      a structure definition like:
      
      struct Collection
      {
          uint32_t count;
          Item array[0];
      };
      "array" has 1 item, but many times in practice there are more
      items in "item_array".
      
      This allows you to do:
      
      (lldb) target variable g_collection.array[3]
      
      To implement this, the get child at index has been modified
      to have a "ignore_array_bounds" boolean that can be set to true.
      
      llvm-svn: 134846
      daf515fc
    • Greg Clayton's avatar
      Fixed an issue with getting the size of an array from an opaque clang_type_t · ef37d68a
      Greg Clayton authored
      variable where we were using a static cast when we shouldn't have been.
      Fixed another array related issue where we weren't looking through a typedef.
      
      llvm-svn: 134823
      ef37d68a
  25. Jul 08, 2011
  26. Jul 07, 2011
    • Greg Clayton's avatar
      Added "target variable" command that allows introspection of global · 644247c1
      Greg Clayton authored
      variables prior to running your binary. Zero filled sections now get
      section data correctly filled with zeroes when Target::ReadMemory
      reads from the object file section data.
      
      Added new option groups and option values for file lists. I still need
      to hook up all of the options to "target variable" to allow more complete
      introspection by file and shlib.
      
      Added the ability for ValueObjectVariable objects to be created with
      only the target as the execution context. This allows them to be read
      from the object files through Target::ReadMemory(...). 
      
      Added a "virtual Module * GetModule()" function to the ValueObject
      class. By default it will look to the parent variable object and
      return its module. The module is needed when we have global variables
      that have file addresses (virtual addresses that are specific to
      module object files) and in turn allows global variables to be displayed
      prior to running.
      
      Removed all of the unused proxy object support that bit rotted in 
      lldb_private::Value.
      
      Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
      with the more efficient "FileSpec::Equal (lhs, rhs)".
      
      Improved logging in GDB remote plug-in.
      
      llvm-svn: 134579
      644247c1
  27. Jul 06, 2011
Loading