This is an archive of the discontinued LLVM Phabricator instance.

[lldb/bindings] Change ScriptedThread initializer parameters
ClosedPublic

Authored by mib on Oct 18 2021, 6:16 PM.

Details

Summary

This patch changes the ScriptedThread initializer in couple of ways:

  • It replaces the SBTarget parameter by a SBProcess (pointing to the ScriptedProcess that "owns" the ScriptedThread).
  • It adds a reference to the ScriptedProcessInfo Dictionary, to pass arbitrary user-input to the ScriptedThread.

This patch also fixes the SWIG bindings methods that call the
ScriptedProcess and ScriptedThread initializers by passing all the
arguments to the appropriate PythonCallable object.

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

Diff Detail

Event Timeline

mib requested review of this revision.Oct 18 2021, 6:16 PM
mib created this revision.
mib updated this revision to Diff 380818.Oct 19 2021, 4:32 PM

Update after rebase.

Given that there's a 1:1 mapping between the target and the process, why did you change the interface as opposed to say extracting the process from the target?

lldb/examples/python/scripted_process/my_scripted_process.py
137

No newline at end of file

mib added a comment.EditedOct 22 2021, 1:28 PM

Given that there's a 1:1 mapping between the target and the process, why did you change the interface as opposed to say extracting the process from the target?

A process is guaranteed to have a target, but the inverse is not true: if the process didn't launch or failed to launch, the target has no process.

mib added a comment.Oct 22 2021, 1:31 PM

Given that there's a 1:1 mapping between the target and the process, why did you change the interface as opposed to say extracting the process from the target?

A process is guaranteed to have a target, but the inverse is not true: if the process didn't launch or failed to launch, the target has no process.

To add more to this, I can't think of any reason, at the moment, to create a ScriptedThread if you don't have ScriptedProcess.

JDevlieghere accepted this revision.Oct 22 2021, 1:34 PM

Makes sense. LGTM

This revision is now accepted and ready to land.Oct 22 2021, 1:34 PM
This revision was automatically updated to reflect the committed changes.