[Lldb-commits] [PATCH] D48465: Added initial code completion support for the `expr` command

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 21 16:44:03 PDT 2018


teemperor created this revision.
teemperor added a reviewer: jingham.
Herald added subscribers: JDevlieghere, aprantl.

This patch adds initial code completion support for the `expr` command.

We now have a completion handler in the expression CommandObject that
essentially just attempts to parse the given user expression with Clang with
an attached code completion consumer. We filter and prepare the
code completions provided by Clang and send them back to the completion
API.

The current completion is limited to variables that are in the current scope.
This includes local variables and all types used by local variables. We however
don't do any completion of symbols that are not used in the local scope (or
in some other way already in the ASTContext).

This is partly because there is not yet any code that manually searches for additiona
information in the debug information. Another cause is that for some reason the existing
code for loading these additional symbols when requested by Clang doesn't seem to work.
This will be fixed in a future patch.


https://reviews.llvm.org/D48465

Files:
  include/lldb/Expression/ExpressionParser.h
  include/lldb/Expression/UserExpression.h
  packages/Python/lldbsuite/test/functionalities/expr_completion/.categories
  packages/Python/lldbsuite/test/functionalities/expr_completion/Makefile
  packages/Python/lldbsuite/test/functionalities/expr_completion/TestExprCompletion.py
  packages/Python/lldbsuite/test/functionalities/expr_completion/main.cpp
  packages/Python/lldbsuite/test/lldbtest.py
  source/Commands/CommandObjectExpression.cpp
  source/Commands/CommandObjectExpression.h
  source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48465.152407.patch
Type: text/x-patch
Size: 46133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180621/b73d8579/attachment-0001.bin>


More information about the lldb-commits mailing list