Skip to content

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan - #70392

Merged
medismailben merged 1 commit into
llvm:mainfrom
medismailben:main
Oct 30, 2023
Merged

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan#70392
medismailben merged 1 commit into
llvm:mainfrom
medismailben:main

Conversation

@medismailben

@medismailben medismailben commented Oct 26, 2023

Copy link
Copy Markdown
Member

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for ThreadPlan, Stream &
Event, to allow the bijection between C++ objects and their python
counterparts.

@llvmbot llvmbot added the lldb label Oct 26, 2023
@medismailben medismailben changed the title [lldb/Interpreter] Make ScriptedInterface Object creation more generic [lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan Oct 26, 2023
Comment thread lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h Outdated
Comment thread lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h Outdated
Comment thread lldb/source/Interpreter/ScriptInterpreter.cpp Outdated
@medismailben
medismailben force-pushed the main branch 2 times, most recently from 086c5f8 to 56f95c1 Compare October 27, 2023 22:20

@bulbazord bulbazord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of my comments have been addressed. Thanks!

@JDevlieghere JDevlieghere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few nits. This looks really great with the new interfaces.

Comment thread lldb/source/Target/ThreadPlanPython.cpp Outdated
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
@medismailben
medismailben merged commit 4b3cd37 into llvm:main Oct 30, 2023
medismailben added a commit that referenced this pull request Oct 31, 2023
@medismailben

Copy link
Copy Markdown
Member Author

This has been reverted in 6eafe2c since it introduced some test failures:


Failed Tests (4):
lldb-api :: functionalities/completion/TestCompletion.py
lldb-api :: functionalities/step_scripted/TestStepScripted.py
lldb-api :: functionalities/thread_plan/TestThreadPlanCommands.py
lldb-shell :: Commands/command-stop-hook-output.test

@DavidSpickett

Copy link
Copy Markdown
Contributor

So in case it was confusing, the revert did fix Arm 32 bit linux as well, but it stayed red for other reasons.

Also I looked into it on the same machine and got:

********************
Unresolved Tests (1):
  lldb-api :: functionalities/thread_plan/TestThreadPlanCommands.py

********************
Failed Tests (3):
  lldb-api :: functionalities/completion/TestCompletion.py
  lldb-api :: functionalities/step_scripted/TestStepScripted.py
  lldb-shell :: Commands/command-stop-hook-output.test

Same tests as on x86. One failed with:

FAIL: LLDB (/home/david.spickett/build-arm/bin/clang-arm) :: test_thread_plan_actions (TestThreadPlanCommands.TestThreadPlanCommands)
======================================================================
ERROR: test_thread_plan_actions (TestThreadPlanCommands.TestThreadPlanCommands)
----------------------------------------------------------------------
TypeError: WrapStepOver.__init__() missing 1 required positional argument: 'dict'

And I see that the previous special case Python object maker thingy (can you tell I know nothing about this :) ) did pass on, or make a dict of some sort.

The others seemed to be trying to create a plan, which failed (same reason I expect), then tried to use it which of course failed.

@medismailben

Copy link
Copy Markdown
Member Author

@DavidSpickett Checking! Thanks for the heads-up.

medismailben added a commit that referenced this pull request Jan 29, 2024
…70392)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
jasonmolenda added a commit that referenced this pull request Jan 29, 2024
…eadPlan (#70392)"

Temporarily revert to unblock the CI bots, this is breaking the -DLLVM_ENABLE_MODULES=On
modules style build.  I've notified Ismail.

This reverts commit 888501b.
medismailben added a commit to medismailben/llvm-project that referenced this pull request May 23, 2024
…lvm#70392)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
medismailben added a commit that referenced this pull request May 23, 2024
…(Reland #70392) (#93149)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

This just re-lands #70392 after fixing test failures.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
medismailben added a commit to medismailben/llvm-project that referenced this pull request Jun 27, 2024
…lvm#70392)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

This just re-lands llvm#70392 after fixing test failures.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
medismailben added a commit that referenced this pull request Jun 27, 2024
…70392) (#96868)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

This just re-lands #70392 after fixing test failures.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
…lvm#70392) (llvm#96868)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

This just re-lands llvm#70392 after fixing test failures.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants