teak-llvm/lldb/packages/Python/lldbsuite/test/expression_command
Raphael Isemann 6c0bbfc0c9 Add ability to import std module into expression parser to improve C++ debugging
Summary:
This patch is the MVP version of importing the std module into the expression parser to improve C++ debugging.

What happens in this patch is that we inject a `@import std` into our expression source code. We also
modify our internal Clang instance for parsing this expression to work with modules and debug info
at the same time (which is the main change in terms of LOC). We implicitly build the `std` module on the first use. The
C++ include paths for building are extracted from the debug info, which means that this currently only
works if the program is compiled with `-glldb -fmodules` and uses the std module. The C include paths
are currently specified by LLDB.

I enabled the tests currently only for libc++ and Linux because I could test this locally. I'll enable the tests
for other platforms once this has landed and doesn't break any bots (and I implemented the platform-specific
C include paths for them).

With this patch we can now:
* Build a libc++ as a module and import it into the expression parser.
* Read from the module while also referencing declarations from the debug info. E.g. `std::abs(local_variable)`.

What doesn't work (yet):
* Merging debug info and C++ module declarations. E.g. `std::vector<CustomClass>` doesn't work.
* Pretty much anything that involves the ASTImporter and templated code. As the ASTImporter is used for saving the result declaration, this means that we can't
call yet any function that returns a non-trivial type.
* Use libstdc++ for this, as it requires multiple include paths and Clang only emits one include path per module. Also libstdc++ doesn't support Clang modules without patches.

Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille

Reviewed By: aprantl

Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits

Tags: #c_modules_in_lldb, #lldb

Differential Revision: https://reviews.llvm.org/D58125

llvm-svn: 355939
2019-03-12 17:09:33 +00:00
..
anonymous-struct [lldbsuite] Un-xfail tests on Windows that are now passing 2018-12-19 19:04:01 +00:00
calculator_mode
call-function [test] Remove flakiness decorator from TestObjCDynamicSBType 2018-12-30 06:10:03 +00:00
call-overridden-method [lit, lldbsuite] Disable tests that are failing because of pr21765 and pr24489 2018-05-17 16:58:00 +00:00
call-restarts [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
call-throws Fix whitespace in the python test suite. 2018-07-27 22:20:59 +00:00
char [lldbsuite] Un-xfail tests on Windows that are now passing (pt.2) 2018-12-19 19:10:25 +00:00
class_template_specialization_empty_pack Fix handling of CreateTemplateParameterList when there is an empty pack 2019-01-30 21:48:56 +00:00
completion [lldbsuite] Un-xfail tests on Windows that are now passing 2018-12-19 19:04:01 +00:00
context-object [Expressions] Add support of expressions evaluation in some object's context 2019-02-05 09:14:36 +00:00
context-object-objc [Expressions] Add support of expressions evaluation in some object's context 2019-02-05 09:14:36 +00:00
dont_allow_jit [lldbsuite] Un-xfail tests on Windows that are now passing (pt.2) 2018-12-19 19:10:25 +00:00
expr-in-syscall [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
fixits Fix whitespace in the python test suite. 2018-07-27 22:20:59 +00:00
formatters [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
import_builtin_fileid Adding test to cover the correct import of SourceLocation pertaining to a built-in during expression parsing 2019-03-06 18:03:54 +00:00
import-std-module Add ability to import std module into expression parser to improve C++ debugging 2019-03-12 17:09:33 +00:00
inline-namespace Correctly look up declarations in inline namespaces 2019-03-12 07:45:04 +00:00
ir-interpreter [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
ir-interpreter-phi-nodes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
issue_11588 Fix whitespace in the python test suite. 2018-07-27 22:20:59 +00:00
macros
options [Expr] Fix TestExprOptions after r348240 on MacOS X 2018-12-04 11:08:02 +00:00
persist_objc_pointeetype Wrap all references to build artifacts in the LLDB testsuite (NFC) 2018-01-19 23:24:35 +00:00
persistent_ptr_update Wrap all references to build artifacts in the LLDB testsuite (NFC) 2018-01-19 23:24:35 +00:00
persistent_types Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
persistent_variables Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
po_verbosity Wrap all references to build artifacts in the LLDB testsuite (NFC) 2018-01-19 23:24:35 +00:00
pr35310 [lldbsuite] Un-xfail tests on Windows that are now passing (pt.2) 2018-12-19 19:10:25 +00:00
radar_8638051 Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
radar_9531204 [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
radar_9673664 Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
rdar42038760 [IRInterpreter] Fix misevaluation of interpretation expressions with urem. 2018-07-12 00:31:04 +00:00
rdar44436068 Don't run TestBreakpointThumbCodesection.py on darwin systems; 2019-01-17 22:26:25 +00:00
save_jit_objects [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
scoped_enums Rename test directory 2019-01-24 18:24:17 +00:00
test [lldb] [test] Mark a few tests flakey on NetBSD 2019-03-11 15:46:07 +00:00
timeout [lldb] [test] Mark failing tests XFAIL on NetBSD 2019-03-04 16:54:06 +00:00
top-level Compile the LLDB tests out-of-tree. 2018-01-30 18:29:16 +00:00
two-files Wrap all references to build artifacts in the LLDB testsuite (NFC) 2018-01-19 23:24:35 +00:00
unwind_expression [lldb] [test] Mark more tests flakey on NetBSD 2019-03-11 17:01:31 +00:00
xvalue Fix whitespace in the python test suite. 2018-07-27 22:20:59 +00:00
.categories