aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces
AgeCommit message (Collapse)AuthorFilesLines
2025-12-04[lldb/ScriptInterpreter] Fix typo in GetScriptedModulePath (NFC)Med Ismail Bennani1-1/+1
This fixes a typo in `ScriptedPythonInterface::GetScriptedModulePath`. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-12-02Reland "[lldb] Introduce ScriptedFrameProvider for real threads (#161870)" ↵users/pranavk/bazel-fix-159173-1764801865Med Ismail Bennani5-8/+209
(#170236) This patch re-lands #161870 with fixes to the previous test failures. rdar://161834688 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-12-01[lldb/ScriptInterpreter] Add a way to retrieve script module file path (#170202)Med Ismail Bennani1-0/+56
This adds a new virtual method `GetScriptedModulePath()` to `ScriptedInterface` that allows retrieving the file path of the Python module containing the scripted object implementation. The Python implementation acquires the GIL and walks through the object's `__class__.__module__` to find the module's `__file__` attribute. This will be used by ScriptedFrame to populate the module and compile unit for frames pointing to Python source files. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-12-01[lldb] Handle staticmethod/classmethod descriptors in ↵Med Ismail Bennani1-1/+2
ScriptedPythonInterface (#170188) Extract `__func__` attribute from staticmethod/classmethod descriptors before treating them as callables. Python's `@staticmethod` and `@classmethod` decorators wrap methods in descriptor objects that are not directly usable as PythonCallable, when calling PyCallable_Check. The actual callable function is stored in the `__func__` attribute of these descriptors, so we need to unwrap them to properly validate and invoke the decorated methods in scripted interfaces. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-12-01[lldb/ScriptInterpreter] Fix typo in AbstractMethodCheckerPayload (NFC) ↵Med Ismail Bennani1-6/+6
(#170187) This fixes a typo in ScriptedPythonInterface and changes `AbstrackMethodCheckerPayload` to `AbstractMethodCheckerPayload`. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-11-12Revert "[lldb] Introduce ScriptedFrameProvider for real threads" (#167662)Michael Buch5-209/+8
The new test fails on x86 and arm64 public macOS bots: ``` 09:27:59 ====================================================================== 09:27:59 FAIL: test_append_frames (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that we can add frames after real stack. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 122, in test_append_frames 09:27:59 self.assertEqual(new_frame_count, original_frame_count + 1) 09:27:59 AssertionError: 5 != 6 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_applies_to_thread (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that applies_to_thread filters which threads get the provider. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 218, in test_applies_to_thread 09:27:59 self.assertEqual( 09:27:59 AssertionError: 5 != 1 : Thread with ID 1 should have 1 synthetic frame 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_prepend_frames (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that we can add frames before real stack. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 84, in test_prepend_frames 09:27:59 self.assertEqual(new_frame_count, original_frame_count + 2) 09:27:59 AssertionError: 5 != 7 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_remove_frame_provider_by_id (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that RemoveScriptedFrameProvider removes a specific provider by ID. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 272, in test_remove_frame_provider_by_id 09:27:59 self.assertEqual(thread.GetNumFrames(), 3, "Should have 3 synthetic frames") 09:27:59 AssertionError: 5 != 3 : Should have 3 synthetic frames 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_replace_all_frames (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that we can replace the entire stack. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 41, in test_replace_all_frames 09:27:59 self.assertEqual(thread.GetNumFrames(), 3, "Should have 3 synthetic frames") 09:27:59 AssertionError: 5 != 3 : Should have 3 synthetic frames 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ====================================================================== 09:27:59 FAIL: test_scripted_frame_objects (TestScriptedFrameProvider.ScriptedFrameProviderTestCase) 09:27:59 Test that provider can return ScriptedFrame objects. 09:27:59 ---------------------------------------------------------------------- 09:27:59 Traceback (most recent call last): 09:27:59 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py", line 159, in test_scripted_frame_objects 09:27:59 self.assertEqual(frame0.GetFunctionName(), "custom_scripted_frame_0") 09:27:59 AssertionError: 'thread_func(int)' != 'custom_scripted_frame_0' 09:27:59 - thread_func(int) 09:27:59 + custom_scripted_frame_0 09:27:59 09:27:59 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 09:27:59 ---------------------------------------------------------------------- 09:27:59 Ran 6 tests in 14.242s 09:27:59 09:27:59 FAILED (failures=6) ``` Reverts llvm/llvm-project#161870
2025-11-11[lldb] Introduce ScriptedFrameProvider for real threads (#161870)Med Ismail Bennani5-8/+209
This patch extends ScriptedFrame to work with real (non-scripted) threads, enabling frame providers to synthesize frames for native processes. Previously, ScriptedFrame only worked within ScriptedProcess/ScriptedThread contexts. This patch decouples ScriptedFrame from ScriptedThread, allowing users to augment or replace stack frames in real debugging sessions for use cases like custom calling conventions, reconstructing corrupted frames from core files, or adding diagnostic frames. Key changes: - ScriptedFrame::Create() now accepts ThreadSP instead of requiring ScriptedThread, extracting architecture from the target triple rather than ScriptedProcess.arch - Added SBTarget::RegisterScriptedFrameProvider() and ClearScriptedFrameProvider() APIs, with Target storing a SyntheticFrameProviderDescriptor template for new threads - Added "target frame-provider register/clear" commands for CLI access - Thread class gains LoadScriptedFrameProvider(), ClearScriptedFrameProvider(), and GetFrameProvider() methods for per-thread frame provider management - New SyntheticStackFrameList overrides FetchFramesUpTo() to lazily provide frames from either the frame provider or the real stack This enables practical use of the SyntheticFrameProvider infrastructure in real debugging workflows. rdar://161834688 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-11-11Add a workaround for people that use *args instead of listing (#166883)jimingham1-1/+6
parameters when defining the scripting interfaces. We try to count the parameters to make sure the user has defined them correctly, but this throws the counting off. I'm not adding a test for this because then it would seem like we thought this was a good idea. I'd actually rather not support it altogether, but we added the parameter checking pretty recently so there are extant implementations that we broke. I only want to support them, not suggest anyone else do this going forward.
2025-11-06[lldb/Interpreter] Implement ScriptedFrameProvider{,Python}Interface (#166662)Med Ismail Bennani6-0/+133
This patch implements the base and python interface for the ScriptedFrameProvider class. This is necessary to call python APIs from the ScriptedFrameProvider that will come in a follow-up. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-10-09Add a scripted way to re-present a stop location (#158128)jimingham4-0/+108
This patch adds the notion of "Facade" locations which can be reported from a ScriptedResolver instead of the actual underlying breakpoint location for the breakpoint. Also add a "was_hit" method to the scripted resolver that allows the breakpoint to say which of these "Facade" locations was hit, and "get_location_description" to provide a description for the facade locations. I apologize in advance for the size of the patch. Almost all of what's here was necessary to (a) make the feature testable and (b) not break any of the current behavior. The motivation for this feature is given in the "Providing Facade Locations" section that I added to the python-reference.rst so I won't repeat it here. rdar://152112327
2025-09-04[lldb] Introduce ScriptedFrame affordance (#149622)Med Ismail Bennani7-1/+242
This patch introduces a new scripting affordance in lldb: `ScriptedFrame`. This allows user to produce mock stackframes in scripted threads and scripted processes from a python script. With this change, StackFrame can be synthetized from different sources: - Either from a dictionary containing a load address, and a frame index, which is the legacy way. - Or by creating a ScriptedFrame python object. One particularity of synthezising stackframes from the ScriptedFrame python object, is that these frame have an optional PC, meaning that they don't have a report a valid PC and they can act as shells that just contain static information, like the frame function name, the list of variables or registers, etc. It can also provide a symbol context. rdar://157260006 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-07-28Switch the ScriptedBreakpointResolver over to the ScriptedInterface form ↵jimingham7-0/+185
(#150720) This is NFC, I'm modernizing the interface before I add to it in a subsequent commit.
2025-06-04[lldb/cmake] Implicitly pass arguments to llvm_add_library (#142583)Pavel Labath1-3/+2
If we're not touching them, we don't need to do anything special to pass them along -- with one important caveat: due to how cmake arguments work, the implicitly passed arguments need to be specified before arguments that we handle. This isn't particularly nice, but the alternative is enumerating all arguments that can be used by llvm_add_library and the macros it calls (it also relies on implicit passing of some arguments to llvm_process_sources).
2025-05-22[lldb] Remove redundant control flow statements (NFC) (#141183)Kazu Hirata1-1/+0
2025-01-16[lldb] Add OS plugin property for reporting all threads (#123145)Felipe de Azevedo Piovezan2-0/+12
Currently, an LLDB target option controls whether plugins report all threads. However, it seems natural for this knowledge could come from the plugin itself. To support this, this commits adds a virtual method to the plugin base class, making the Python OS query the target option to preserve existing behavior.
2024-09-20[lldb/Interpreter] Introduce ScriptedStopHook{,Python}Interface & make use ↵Med Ismail Bennani7-6/+187
of it (#109498) This patch re-lands #105449 and fixes the various test failures. --------- Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-09-20Revert "[lldb] Fix SWIG wrapper compilation error"David Spickett7-187/+6
...and "[lldb/Interpreter] Introduce `ScriptedStopHook{,Python}Interface` & make use of it (#105449)" This reverts commit 76b827bb4d5b4cc4d3229c4c6de2529e8b156810, and commit 1e131ddfa8f1d7b18c85c6e4079458be8b419421 because the first commit caused the test command-stop-hook-output.test to fail.
2024-09-19[lldb/Interpreter] Introduce `ScriptedStopHook{,Python}Interface` & make use ↵Med Ismail Bennani7-6/+187
of it (#105449) This patch introduces new `ScriptedStopHook{,Python}Interface` classes that make use of the Scripted Interface infrastructure and makes use of it in `StopHookScripted`. It also relax the requirement on the number of argument for initializing scripting extension if the size of the interface parameter pack contains 1 less element than the extension maximum number of positional arguments for this initializer. This addresses the cases where the embedded interpreter session dictionary is passed to the extension initializer which is not used most of the time. --------- Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-09-19[lldb/Interpreter] Add requirements to Scripted Interface abstract methods ↵Med Ismail Bennani6-53/+142
(#109063) This patch adds new requirements to the Scripted Interface abstract method checker to check the minimum number of argument for abstract methods. This check is done when creating the interface object so the object is not created if the user implementation doesn't match the abstract method requirement. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-09-05[lldb] Make deep copies of Status explicit (NFC) (#107170)Adrian Prantl2-5/+9
2024-09-05[lldb] Make conversions from llvm::Error explicit with Status::FromEr… ↵Adrian Prantl1-1/+1
(#107163) …ror() [NFC]
2024-08-27[lldb] Turn lldb_private::Status into a value type. (#106163)Adrian Prantl2-12/+14
This patch removes all of the Set.* methods from Status. This cleanup is part of a series of patches that make it harder use the anti-pattern of keeping a long-lives Status object around and updating it while dropping any errors it contains on the floor. This patch is largely NFC, the more interesting next steps this enables is to: 1. remove Status.Clear() 2. assert that Status::operator=() never overwrites an error 3. remove Status::operator=() Note that step (2) will bring 90% of the benefits for users, and step (3) will dramatically clean up the error handling code in various places. In the end my goal is to convert all APIs that are of the form ` ResultTy DoFoo(Status& error) ` to ` llvm::Expected<ResultTy> DoFoo() ` How to read this patch? The interesting changes are in Status.h and Status.cpp, all other changes are mostly ` perl -pi -e 's/\.SetErrorString/ = Status::FromErrorString/g' $(git grep -l SetErrorString lldb/source) ` plus the occasional manual cleanup.
2024-08-20[lldb] Fix windows debug build after 9d07f43 (#104896)Med Ismail Bennani15-94/+100
This patch tries to fix an issue with the windows debug builds where the PDB file for python scripted interfaces cannot be opened since its path length exceed the windows `MAX_PATH` limit: https://github.com/llvm/llvm-project/pull/101672#issuecomment-2289481324 This patch addresses the issue by building all the interfaces as a single library plugin that initiliazes each component as part of its `Initialize` method, instead of building each interface as its own library plugin. This keeps the build artifact path length smaller while respecting the naming convention and without making any exception in the build system. Fixes #104895. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-08-02Reland "[lldb] Reland 2402b3213c2f with `/H` to debug the windows build ↵David Spickett4-12/+67
issue (#101672) This reverts commit 9effefbae8d96006a4dd29bb9ab8532fd408559d. With the include order in ScriptedProcessPythonInterface.cpp fixed (though I cannot explain exactly why it works) and removes the /H flag intended for debugging this issue. I think it is something to do with Process.h pulling in PosixApi.h somewhere along the line, and including Process.h after lldb-python.h means that NO_PID_T is defined to prevent a redefinition of pid_t.
2024-07-31Revert "[lldb] Reland 2402b3213c2f with `/H` to debug the windows build issue"Haowei Wu4-71/+11
This reverts commit e72cdae47b4e263ea97b2bdd75cf44c1510cf3be, which broke LLVM's lldb builder for Windows msvc.
2024-07-30[lldb] Reland 2402b3213c2f with `/H` to debug the windows build issueMed Ismail Bennani4-11/+71
This patch relands 2402b3213c2f to investigate the ambigious typedef issue happening on the windows bots: https://lab.llvm.org/buildbot/#/builders/141/builds/1175/ However this patch adds the `/H` compiler flag when building the ScriptedProcessPythonInterface library to be able to investigate the include order issue. This patch will be revert after 1 failing run on the windows bot. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-30Revert "[lldb] Reland 2402b3213c2f with `-H` to debug the windows build issue"Med Ismail Bennani4-67/+11
This reverts commit c35c4c72e4977258fc1da940e0470e8d0671bf07.
2024-07-30[lldb] Reland 2402b3213c2f with `-H` to debug the windows build issueMed Ismail Bennani4-11/+67
This patch relands 2402b3213c2f to investigate the ambigious typedef issue happening on the windows bots: https://lab.llvm.org/buildbot/#/builders/141/builds/1175/ However this patch adds the `-H` compiler flag when building the ScriptedProcessPythonInterface library to be able to investigate the include order issue. This patch will be revert after 1 failing run on the windows bot. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-29Revert "[lldb] Reland 2402b3213c2f with `-H -MM` to debug the windows build ↵Med Ismail Bennani4-67/+11
issue" This reverts commit 6bd5fd35063cd14b0a56bc6f7fb1e7b6e1ac56d5.
2024-07-29[lldb] Reland 2402b3213c2f with `-H -MM` to debug the windows build issueMed Ismail Bennani4-11/+67
This patch relands 2402b3213c2f to investigate the ambigious typedef issue happening on the windows bots: https://lab.llvm.org/buildbot/#/builders/141/builds/1175/ However this patch adds the `-H` & `-MM` compiler flags when building the ScriptedProcessPythonInterface library to be able to investigate the include order issue. This patch will be revert after 1 failing run on the windows bot. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-27Revert "[lldb] Add ScriptedProcess to `scripting template list`"Med Ismail Bennani4-64/+11
This reverts commit 2402b3213c2f10d5033b31df3a0e59e4ad151fbd since it breaks the windows bot: https://lab.llvm.org/buildbot/#/builders/141/builds/1175/
2024-07-27[lldb] Add ScriptedProcess to `scripting template list`Med Ismail Bennani4-11/+64
This patch is a follow-up to bccff3baeff8 which adds the `ScriptedProcess` extension to the `scripting template list` command as well as its description. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-27[lldb] Add OperatingSystem to `scripting template list`Med Ismail Bennani4-7/+56
This patch is a follow-up to bccff3baeff8 which adds the `OperatingSystem` extension to the `scripting template list` command as well as its description. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-27[lldb] Add ScriptedPlatform to `scripting template list`Med Ismail Bennani4-9/+50
This patch is a follow-up to bccff3baeff8 which adds the `ScriptedPlatform` extension to the `scripting template list` command as well as its description. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-27[lldb/Commands] Add `scripting template list` command with auto discoveryMed Ismail Bennani4-7/+55
This patch introduces a new `template` multiword sub-command to the `scripting` top-level command. As the name suggests, this sub-command operates on scripting templates, and currently has the ability to automatically discover the various scripting extensions that lldb supports. This was previously reviewed in #97273. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-25[lldb] Revert scripting template list patches (#100673)Med Ismail Bennani17-302/+45
Reverts https://github.com/llvm/llvm-project/pull/97273 since it broke the windows bot: https://lab.llvm.org/buildbot/#/builders/141/builds/1025/steps/4/logs/stdio
2024-07-25[lldb/Plugins] Fix build failure on windows following 2914a4b88837Med Ismail Bennani7-16/+43
This patch tries to fix the following build failure on windows: https://lab.llvm.org/buildbot/#/builders/141/builds/1083 This started happening following 2914a4b88837, and it seems to be caused by some special `#include` ordering for the lldb-python header on Windows. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-25[lldb/Plugins] Fix build failure on windows following 2914a4b88837Med Ismail Bennani2-0/+15
This patch tries to fix the following build failure on windows: https://lab.llvm.org/buildbot/#/builders/141/builds/1083 This started happening following 2914a4b88837, and it seems to be caused by some special `#include` ordering for the lldb-python header on Windows. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-25Revert "[lldb] Fix incorrect logical operator in 'if' condition check (NFC)" ↵David Spickett1-9/+8
(#100561) Reverts llvm/llvm-project#94779 Due to bot failures: https://lab.llvm.org/buildbot/#/builders/18/builds/1371
2024-07-25[lldb] Fix incorrect uses of logical operator in 'if' condition check (NFC) ↵Shivam Gupta1-8/+9
(#94779) The condition checking for missing class name, interpreter dictionary, and script object incorrectly used logical AND (&&), which could never be true to enter the 'if' block. This commit uses separate if conditions for each class name, interpreter dictionary, and script object. Cought by cppcheck - lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:89:11: warning: Identical inner 'if' condition is always true. [identicalInnerCondition] lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h:91:16: warning: Identical inner 'if' condition is always true. [identicalInnerCondition] Fix #89195 --------- Co-authored-by: Shivam Gupta <shivma98.tkg@gmail.com>
2024-07-25[lldb/Plugins] Fix build failure on windows following 2914a4b88837Med Ismail Bennani4-10/+34
This patch tries to fix the following build failure on windows: https://lab.llvm.org/buildbot/#/builders/141/builds/1083 This started happening following 2914a4b88837, and it seems to be caused by some special `#include` ordering for the lldb-python header on Windows. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-25[lldb/Commands] Add `scripting template list` command with auto discoveryMed Ismail Bennani13-34/+225
This patch introduces a new `template` multiword sub-command to the `scripting` top-level command. As the name suggests, this sub-command operates on scripting templates, and currently has the ability to automatically discover the various scripting extensions that lldb supports. This was previously reviewed in #97273. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-07-23Revert "[lldb/Commands] Add `scripting template list` command with auto ↵Med Ismail Bennani13-220/+34
discovery" (#100273) Reverts llvm/llvm-project#97273 since it broke the windows bot: https://lab.llvm.org/buildbot/#/builders/141/builds/1025/steps/4/logs/stdio
2024-07-23[lldb/Commands] Add `scripting template list` command with auto discovery ↵Med Ismail Bennani13-34/+220
(#97273) This patch introduces a new `template` multiword sub-command to the `scripting` top-level command. As the name suggests, this sub-command operates on scripting templates, and currently has the ability to automatically discover the various scripting extensions that lldb supports. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-28Reland "[lldb/Interpreter] Discard ScriptedThreadPlan::GetStopDescription ↵Med Ismail Bennani4-18/+11
return value (#96985)" (#97092) This reverts commit a2e3af5d581547d3ea53e5383d6f7f1cab45120a and solves the build error in https://lab.llvm.org/buildbot/#/builders/141/builds/369. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-28Revert "[lldb/Interpreter] Discard ScriptedThreadPlan::GetStopDescription ↵Nico Weber4-11/+18
return value (#96985)" This reverts commit 1130e923e2d7fe046101bf639bc5ebcde194c005. Very likely causes build problems on Windows and with LLVM_NO_DEAD_STRIP=ON, see https://github.com/llvm/llvm-project/pull/96985#pullrequestreview-2147599208
2024-06-28[lldb/Interpreter] Discard ScriptedThreadPlan::GetStopDescription return ↵Med Ismail Bennani4-18/+11
value (#96985) This patch changes `ScriptedThreadPlan::GetStopDescription` behavior by discarding its return value since it is optional in the first place (the user doesn't need to provide a return value in their implementation). This patch also addresses the test failures in TestStepScripted following 9a9ec22 and re-enables the tests that were XFAIL'd previously. The issue here was that the `Stream*` that's passed to `ThreadPlanPython::GetDescription` wasn't being passed by reference to the python method so it was never updated to reflect how the python method interacted with it. This patch solves this issue by making a temporary `StreamSP` that will be passed to the python method by reference, after what we will copy its content to the caller `Stream` pointer argument. --------- Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-27[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan ↵Med Ismail Bennani8-23/+251
(#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>
2024-05-23Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan ↵Med Ismail Bennani8-251/+23
(Reland #70392)" (#93153) Reverts llvm/llvm-project#93149 since it breaks https://lab.llvm.org/buildbot/#/builders/68/builds/74799
2024-05-23[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland ↵Med Ismail Bennani8-23/+251
#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>