[Lldb-commits] [lldb] 5a63045 - [LLDB] Fix `Wunused-result` warning

David Blaikie via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 8 13:40:07 PST 2021


Might be worth making an "execution override" object that has a dtor
to do the cleanup?

On Mon, Feb 8, 2021 at 9:10 AM Frederik Gossen via lldb-commits
<lldb-commits at lists.llvm.org> wrote:
>
>
> Author: Frederik Gossen
> Date: 2021-02-08T18:10:08+01:00
> New Revision: 5a63045fe78834937785ed5081052e083a98077f
>
> URL: https://github.com/llvm/llvm-project/commit/5a63045fe78834937785ed5081052e083a98077f
> DIFF: https://github.com/llvm/llvm-project/commit/5a63045fe78834937785ed5081052e083a98077f.diff
>
> LOG: [LLDB] Fix `Wunused-result` warning
>
> Added:
>
>
> Modified:
>     lldb/source/Interpreter/CommandInterpreter.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
> index 0b25abc9cdea..a7afa1034762 100644
> --- a/lldb/source/Interpreter/CommandInterpreter.cpp
> +++ b/lldb/source/Interpreter/CommandInterpreter.cpp
> @@ -2832,7 +2832,9 @@ void CommandInterpreter::IOHandlerInputComplete(IOHandler &io_handler,
>    StartHandlingCommand();
>
>    OverrideExecutionContext(m_debugger.GetSelectedExecutionContext());
> -  llvm::make_scope_exit([this]() { RestoreExecutionContext(); });
> +  auto finalize = llvm::make_scope_exit([this]() {
> +    RestoreExecutionContext();
> +  });
>
>    lldb_private::CommandReturnObject result(m_debugger.GetUseColor());
>    HandleCommand(line.c_str(), eLazyBoolCalculate, result);
>
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


More information about the lldb-commits mailing list