Internal expressions shouldn't increment the result variable numbering.
authorJim Ingham <jingham@apple.com>
Fri, 20 Mar 2020 21:59:54 +0000 (14:59 -0700)
committerJim Ingham <jingham@apple.com>
Mon, 23 Mar 2020 20:30:37 +0000 (13:30 -0700)
commit67d67ebe8f2535c5de75c62820f7713f87d07307
tree0c7d9159c6fb89cb6611dd4547394bb659b62b02
parent5f5fb56c68e4830597a5b52d7a8edafea21566ac
Internal expressions shouldn't increment the result variable numbering.

There an option: EvaluateExpressionOptions::SetResultIsInternal to indicate
whether the result number should be returned to the pool or not.  It
got broken when the PersistentExpressionState was refactored.

This fixes the issue and provides a test of the behavior.

Differential Revision: https://reviews.llvm.org/D76532
12 files changed:
lldb/include/lldb/Expression/ExpressionVariable.h
lldb/include/lldb/Target/Target.h
lldb/source/Core/ValueObject.cpp
lldb/source/Expression/ExpressionVariable.cpp
lldb/source/Expression/Materializer.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
lldb/source/Target/ABI.cpp
lldb/test/API/commands/expression/result_numbering/Makefile [new file with mode: 0644]
lldb/test/API/commands/expression/result_numbering/TestResultNumbering.py [new file with mode: 0644]
lldb/test/API/commands/expression/result_numbering/main.c [new file with mode: 0644]