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
  2. Sep 13, 2011
    • Greg Clayton's avatar
      Fixed some incorrect return values. · cce8671f
      Greg Clayton authored
      llvm-svn: 139582
      cce8671f
    • Greg Clayton's avatar
      Huge memory and performance improvements in the DWARF parser. · d4a2b370
      Greg Clayton authored
      Address ranges are now split up into two different tables: 
      - one in DWARFDebugInfo that is compile unit specific
      - one in each DWARFCompileUnit that has exact function DIE offsets
      
      This helps keep the size of the aranges down since the main table will get
      uniqued and sorted and have consecutive ranges merged. We then only parse the
      compile unit one on demand once we have determined that a compile unit contains
      the address in question. We also now use the .debug_aranges section if there 
      is one instead of always indexing the DWARF manually.
      
      NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map.
      std::map is very bulky as each node has 3 pointers and the key and value types.
      This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves
      us a lot of memory when we have very large DWARF.
      
      DWARFDebugAranges now has a smaller footprint for each range it contains to 
      save on memory.
      
      llvm-svn: 139557
      d4a2b370
  3. Sep 02, 2011
  4. Aug 25, 2011
  5. Aug 23, 2011
    • Sean Callanan's avatar
      Added support for persistent types to the · bccce813
      Sean Callanan authored
      expression parser.  You can use a persistent
      type like this:
      
      (lldb) expr struct $foo { int a; int b; };
      (lldb) struct $foo i; i.a = 2; i.b = 3; i
      ($foo) $0 = {
        (int) a = 2
        (int) b = 3
      }
      
      typedefs work similarly.
      
      This patch affects the following files:
      
      test/expression_command/persistent_types/*
        A test case for persistent types,
        in particular structs and typedefs.
      
      ClangForward.h
        Added TypeDecl, needed to declare some
        functions in ASTResultSynthesizer.h
      
      ClangPersistentVariables.[h,cpp]
        Added a list of persistent types to the
        persistent variable store.
      
      ASTResultSynthesizer.[h,cpp]
        Made the AST result synthesizer iterate
        across TypeDecls in the expression, and
        record any persistent types found.  Also
        made a minor documentation fix.
      
      ClangUserExpression.[h,cpp]
        Extended the user expression class to
        keep the state needed to report the
        persistent variable store for the target
        to the AST result synthesizers. 
      
        Also introduced a new error code for
        expressions that executed normally but
        did not return a result.
      
      CommandObjectExpression.cpp
        Improved output for expressions (like 
        declarations of new persistent types) that
        don't return a result.  This is no longer
        treated as an error.
      
      llvm-svn: 138383
      bccce813
  6. Aug 16, 2011
  7. Aug 12, 2011
  8. Aug 10, 2011
    • Sean Callanan's avatar
      Fixed a problem that prevented access to members · 5207a340
      Sean Callanan authored
      of string literals ("hello"[2]).  Also fixed a
      problem in which empty string literals were not
      being compiled correctly ((int)printf("") would
      print garbage).
      
      Added a testcase that covers both.
      
      llvm-svn: 137247
      5207a340
    • 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
    • Johnny Chen's avatar
      Check log shared pointer before using it. · ee7a359d
      Johnny Chen authored
      llvm-svn: 137173
      ee7a359d
    • Johnny Chen's avatar
      Check log shared pointer before using it. · e95fcf78
      Johnny Chen authored
      llvm-svn: 137169
      e95fcf78
  9. Aug 09, 2011
  10. Aug 06, 2011
    • Sean Callanan's avatar
      Made the expression parser use the StackFrame's · 69b5341c
      Sean Callanan authored
      variable search API rather than rolling its own,
      fixing one of our testcases.
      
      llvm-svn: 137004
      69b5341c
    • 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
  11. Aug 04, 2011
    • Sean Callanan's avatar
      Fixed a problem that caused LLDB to fail to execute · 0c4d8d25
      Sean Callanan authored
      expressions that used function pointers.  The problem
      was that IRForTarget previously only scanned the IR
      for the expression for call instructions; if a function
      was used in another context, it was ignored.
      
      Now LLDB scans the Module for functions that are only
      declared (not also defined -- so these are externals);
      it then constructs function pointers for these
      functions and substitutes them wherever the function
      is used.
      
      Also made some changes so that "expr main" works just
      as well as "expr &main"; they end up being the same
      code, but LLDB was generating the result variable in
      different ways.
      
      llvm-svn: 136928
      0c4d8d25
  12. Aug 03, 2011
    • Sean Callanan's avatar
      Improved the expression parser's detection of the · a789aa77
      Sean Callanan authored
      current context.  Previously, if there was a variable
      called "self" available, the expression parser
      assumed it was inside a method.  But class methods
      in Objective-C also take a "self" parameter, of DWARF
      type "id".  We now detect this properly, and only
      assume we're in an instance method if "self" is a
      pointer to an Objective-C object.
      
      llvm-svn: 136784
      a789aa77
  13. Aug 01, 2011
    • Sean Callanan's avatar
      Fixed a problem in the expression parser that · 7f3755b5
      Sean Callanan authored
      caused functions that were cast as part of the
      call to have that cast ignored once their 
      addresses were resolved.
      
      Notably, in the case of objc_msgSend(), if
      the function was cast from something returning
      i8* to something returning i8, the expression
      parser was discarding the cast as part of its
      resolution.  This caused crashes later on.
      
      llvm-svn: 136648
      7f3755b5
    • Sean Callanan's avatar
      Added checking to make sure that the target has a · b9951199
      Sean Callanan authored
      scratch AST context before attempting to parse.
      
      llvm-svn: 136631
      b9951199
    • Sean Callanan's avatar
      Fixed a bug where named constants were being · af8e96c1
      Sean Callanan authored
      treated as externals, causing problems when we
      tried to look their locations up in the debug
      info.  For example:
      
      expr char c[] = "foo"; c[0]
      
      would terminate when trying to find c in the
      debug information, despite the fact that c was
      defined inside the expression.
      
      llvm-svn: 136629
      af8e96c1
  14. Jul 31, 2011
  15. 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
  16. Jul 19, 2011
    • Johnny Chen's avatar
      Patch by Matt Johnson to silence G++ warnings! · 4480530a
      Johnny Chen authored
      Used hand merge to apply the diffs.  I did not apply the diffs for FormatManager.h and
      the diffs for memberwise initialization for ValueObject.cpp because they changed since.
      I will ask my colleague to apply them later.
      
      llvm-svn: 135508
      4480530a
    • 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
  17. Jul 18, 2011
  18. 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
  19. Jul 08, 2011
  20. 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
  21. Jul 06, 2011
  22. Jun 30, 2011
  23. Jun 25, 2011
    • Greg Clayton's avatar
      This commit adds broad architectural support for hierarchical · a2721476
      Greg Clayton authored
      inspection of namespaces in the expression parser.
      
      ClangExpressionDeclMap hitherto reported that namespaces had
      been completely imported, even though the namespaces are
      returned empty.  To deal with this situation, ClangASTSource
      was recently extended with an API to complete incomplete type
      definitions, and, for greater efficiency, to complete these
      definitions partially, returning only those objects that have
      a given name.
      
      This commit supports these APIs on LLDB's side, and uses it
      to provide information on types resident in namespaces.
      Namespaces are now imported as they were -- that is to say,
      empty -- but with minimal import mode on.  This means that
      Clang will come back and request their contents by name as
      needed.  We now respond with information on the contained
      types; this will be followed soon by information on functions
      and variables.
      
      llvm-svn: 133852
      a2721476
    • Greg Clayton's avatar
      Cleanup error output on expressions. · 5fd05903
      Greg Clayton authored
      llvm-svn: 133834
      5fd05903
  24. Jun 23, 2011
  25. Jun 20, 2011
  26. Jun 03, 2011
  27. May 30, 2011
Loading