[all-commits] [llvm/llvm-project] 9cbdfc: [lldb] Fix assertion when ScriptedProcess have no ...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Wed Apr 12 16:09:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9cbdfcdb4cf75bdb4f7061276ff89929c2b157a1
      https://github.com/llvm/llvm-project/commit/9cbdfcdb4cf75bdb4f7061276ff89929c2b157a1
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2023-04-12 (Wed, 12 Apr 2023)

  Changed paths:
    M lldb/examples/python/scripted_process/crashlog_scripted_process.py
    M lldb/examples/python/scripted_process/scripted_process.py
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.h

  Log Message:
  -----------
  [lldb] Fix assertion when ScriptedProcess have no pid after launch

This patch should fix an assertion that causes some test failures:
https://ci.swift.org/view/LLDB/job/llvm-org-lldb-release-debuginfo/3587/console

This was caused by the changes introduces in `88f409194d5a` where we
replaced `DidLaunch` by `DidResume` in the `ScriptedProcess` class.

However, by the time we resume the process, the pid should be already
set. To address this, this patch brings back `DidLaunch` which will
initialize the ScriptedProcess pid with a placeholder value. That value
will be updated in `DidResume` to the final pid.

Note, this 2 stage PID initialization is necessary sometimes, when the
scripted process gets stopped at entry (launch) and gets assigned an
object that contains the PID value. In this case, we need to update the
PID when we resume the process after we've stopped at entry.

This also replaces the default scripted process id to an arbitrary
number (42) since the current value (0) is considered invalid.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>




More information about the All-commits mailing list