aprantl added a comment.

A slightly more elegant solution might be to inject a #line directive that 
changes to a different source file for the code that the user entered. I've 
been long wanting to make `expr -g` more palatable to end users by hiding the 
LLDB-injected code in a separate source file by default. If that turns out to 
be too much work, feel free to land this version.



================
Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:111
+  // True iff the parser has entered or passed the actual user expression.
+  // False means the parser is still parsing the wrapper code generated by 
LLDB.
+  bool m_entered_expr = false;
----------------
`///`


================
Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:141
+    // loaded by the user. We can stop here as we only care about user-loaded
+    // modules.
+    if (!m_entered_expr)
----------------
Just to make sure I'm understanding:

`expr @import Foo` will still work, but it will import Foo into the expression 
rather than into the context from which we ASTImport definitions?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61565/new/

https://reviews.llvm.org/D61565



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to