[all-commits] [llvm/llvm-project] 2abf99: [lldb] Fix assertions caused by un-checked errors ...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Wed Oct 25 17:31:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2abf997f8272e88d1a17138da61448bac721b6c1
      https://github.com/llvm/llvm-project/commit/2abf997f8272e88d1a17138da61448bac721b6c1
  Author: Med Ismail Bennani <ismail at bennani.ma>
  Date:   2023-10-25 (Wed, 25 Oct 2023)

  Changed paths:
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedThread.cpp

  Log Message:
  -----------
  [lldb] Fix assertions caused by un-checked errors in ScriptedProcess

This patch should fix some assertion that started getting hit after f22d82c.

That commit changed the scripted object plugin creation to use
`llvm::Expected<T>` as a return type to enforce error handling, however
I forgot to handle the error which caused the assert.

The interesting  part about this, is that since that assert was triggered
in the ScriptedProcess constructor (where the `llvm::Error` wasn't
handled), that impacted every test that launched any kind of process,
since the process plugin manager would eventually also iterate over the
`ScriptedProcess::Create` factory method.

This patch should fix the assertions by handling the errors.

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>




More information about the All-commits mailing list