aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/scripted_process
AgeCommit message (Collapse)AuthorFilesLines
2025-12-05[lldb] Add support for PC-less scripted frames (#170805)Med Ismail Bennani1-0/+29
Scripted frames that materialize Python functions or other non-native code are PC-less by design, meaning they don't have valid program counter values. Previously, these frames would display invalid addresses (`0xffffffffffffffff`) in backtrace output. This patch updates `FormatEntity` to detect and suppress invalid address display for PC-less frames, adds fallback to frame methods when symbol context is unavailable, and modifies `StackFrame::GetSymbolContext` to skip PC-based symbol resolution for invalid addresses. The changes enable PC-less frames to display cleanly with proper function names, file paths, and line numbers, and allow for source display of foreign sources (like Python). Includes comprehensive test coverage demonstrating frames pointing to Python source files. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-12-04[lldb] Add support for synthetic LineEntry objects without valid address ↵Med Ismail Bennani1-0/+14
ranges (#158811) Scripted frames that materialize Python functions are PC-less by design, meaning they don't have valid address ranges. Previously, LineEntry::IsValid() required both a valid address range and a line number, preventing scripted frames from creating valid line entries for these synthetic stack frames. Relaxing this requirement is necessary since `SBSymbolContext::SetLineEntry` will first check if the LineEntry is valid and discard it otherwise. This change introduces an `synthetic` flag that gets set when LineEntry objects are created or modified through the SBAPI (specifically via SetLine). When this flag is set, IsValid() no longer requires a valid address range, only a valid line number. This is risk-free because the flag is only set for LineEntry objects created through the SBAPI, which are primarily used by scripted processes and frames. Regular debug information-derived line entries continue to require valid address ranges. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-09-04[lldb] Introduce ScriptedFrame affordance (#149622)Med Ismail Bennani1-1/+64
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-09-03[lldb] Mark scripted frames as synthetic instead of artificial (#153117)Med Ismail Bennani1-1/+1
This patch changes the way frames created from scripted affordances like Scripted Threads are displayed. Currently, they're marked artificial which is used usually for compiler generated frames. This patch changes that behaviour by introducing a new synthetic StackFrame kind and moves 'artificial' to be a distinct StackFrame attribut. On top of making these frames less confusing, this allows us to know when a frame was created from a scripted affordance. rdar://155949703 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2025-07-31[lldb] Add stop_description Python property to SBThread (#151568)Dave Lee1-3/+1
Add `stop_description` as a Python convenience property to `SBThread`.
2025-02-23Allow option to ignore module load errors in ScriptedProcess (#127153)rchamala2-16/+71
Current state in scripted process expects [all the modules](https://github.com/llvm/llvm-project/blob/912b154f3a3f8c3cebf5cc5731fd8b0749762da5/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp#L498) passed into "get_loaded_images" to load successfully else none of them load. Even if a module loads fine, [but has already been appended](https://github.com/llvm/llvm-project/blob/912b154f3a3f8c3cebf5cc5731fd8b0749762da5/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp#L495) it still fails. This is restrictive and does not help our usecase. **Usecase**: We have a parent scripted process using coredump + tombstone. 1) Scripted process uses child elf-core process to read memory dump 2) Uses tombstones to pass thread names and modules. We do not know whether the modules will be successfully downloaded before creating the scripted process. We use [python module callbacks](https://github.com/llvm/llvm-project/blob/a57e58dbfaae0e86eb5cafeddf8b598f14b96e36/lldb/source/Target/Platform.cpp#L1593) to download a module from symbol server at LLDB load time when the scripted process is being created. The issue is that if one of the symbol is not found from the list specified in tombstone, none of the modules load in scripted process. Even if we ensure symbols are present in symbol server before creating the scripted process, if the load address is wrong or if the module is already appended, all module loads are skipped. **Solution**: Pass in a custom boolean option arg for every module from python scripted process plugin which will indicate whether to ignore the module load error. This will provide the flexibility to user for loading the successfully fetched modules into target while ignoring the failed ones --------- Co-authored-by: rchamala <rachamal@fb.com>
2025-02-06[lldb][NFC] Remove old skipIfOutOfTreeDebugserver's (#126144)Jason Molenda1-1/+0
When a test depends on a new debugserver feature/fix, the API test must be marked @skipIfOutOfTreeDebugserver because the macOS CI bots test using the latest Xcode release debugserver. But over time all of these fixes & new features are picked up in the Xcode debugserver and these skips can be removed. We may see unexpected test failures from removing all of these 1+ year old skips, but that's likely a separate reason the test is failing that is being papered over by this skip.
2024-10-16[lldb] Support tests with nested make invocations on Windows 2/2 (#112360)Stefan Gränitz1-1/+1
Following up from https://github.com/llvm/llvm-project/pull/112342, we roll out the fix and quote nested `make` invocations in all API tests.
2024-09-20[lldb/Interpreter] Introduce ScriptedStopHook{,Python}Interface & make use ↵Med Ismail Bennani1-1/+1
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 Spickett1-1/+1
...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 Bennani1-1/+1
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-05-09[lldb] Verify target stop-hooks support with scripted process (#91107)Med Ismail Bennani2-0/+28
This patch makes sure that scripted process are compatible with target stop-hooks. This wasn't tested in the past, but it turned out to be working out of the box. rdar://124396534 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-02-21[lldb][test] Modernize asserts (#82503)Jordan Rupprecht1-3/+1
This uses [teyit](https://pypi.org/project/teyit/) to modernize asserts, as recommended by the [unittest release notes](https://docs.python.org/3.12/whatsnew/3.12.html#id3). For example, `assertTrue(a == b)` is replaced with `assertEqual(a, b)`. This produces better error messages, e.g. `error: unexpectedly found 1 and 2 to be different` instead of `error: False`.
2023-11-08[lldb][test] Skip ScriptedProcess missing methods test on WindowsDavid Spickett1-0/+2
No dylib on Windows, so the test fails to build.
2023-11-07[lldb/test] Fix TestScriptedProcess.py failures on arm linux botsMed Ismail Bennani1-2/+4
This patch tentatively fixes TestScriptedProcess.py which has been failing on the `lldb-arm-ubuntu` & `lldb-aarch64-ubuntu` bots: - https://lab.llvm.org/buildbot/#/builders/17/builds/44965 - https://lab.llvm.org/buildbot/#/builders/96/builds/48152 According to the test log, on those systems, the clang driver that build the test binary doesn't have the `-m` flag to specify the architure so this patch replaces it with the `-target` flag using `clang -dumpmachine` to get the host triple. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-11-07[lldb] Check for abstract methods implementation in Scripted Plugin Objects ↵Med Ismail Bennani2-0/+68
(#71260) This patch enforces that every scripted object implements all the necessary abstract methods. Every scripted affordance language interface can implement a list of abstract methods name that checked when the object is instanciated. Since some scripting affordances implementations can be derived from template base classes, we can't check the object dictionary since it will contain the definition of the base class, so instead, this checks the scripting class dictionary. Previously, for the various python interfaces, we used `ABC.abstractmethod` decorators but this is too language specific and doesn't work for scripting affordances that are not derived from template base classes (i.e OperatingSystem, ScriptedThreadPlan, ...), so this patch provides generic/language-agnostic checks for every scripted affordance. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-11-07Revert "[lldb] Check for abstract methods implementation in Scripted Plugin ↵Med Ismail Bennani2-68/+0
Objects (#71260)" This reverts commit cc9ad72713405ef8f2468c7a714a137b4a3343ba since it breaks some tests upstream: https://lab.llvm.org/buildbot/#/builders/68/builds/63112 ******************** Failed Tests (4): lldb-api :: functionalities/gdb_remote_client/TestThreadSelectionBug.py lldb-api :: functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py lldb-api :: functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py lldb-api :: functionalities/postmortem/mach-core/TestMachCore.py
2023-11-07[lldb] Check for abstract methods implementation in Scripted Plugin Objects ↵Med Ismail Bennani2-0/+68
(#71260) This patch enforces that every scripted object implements all the necessary abstract methods. Every scripted affordance language interface can implement a list of abstract methods name that checked when the object is instanciated. Since some scripting affordances implementations can be derived from template base classes, we can't check the object dictionary since it will contain the definition of the base class, so instead, this checks the scripting class dictionary. Previously, for the various python interfaces, we used `ABC.abstractmethod` decorators but this is too language specific and doesn't work for scripting affordances that are not derived from template base classes (i.e OperatingSystem, ScriptedThreadPlan, ...), so this patch provides generic/language-agnostic checks for every scripted affordance. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-06-21[lldb/test] Disable TestStackCoreScriptedProcess.pyMed Ismail Bennani1-0/+1
This patch disables TestStackCoreScriptedProcess.py since it times out non deterministicly. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-06-21[lldb] Fix failure in TestStackCoreScriptedProcess on x86_64Med Ismail Bennani1-1/+0
This patch should address the failure of TestStackCoreScriptedProcess that is happening specifically on x86_64. It turns out that in 1370a1cb5b97, I changed the way we extract integers from a `StructuredData::Dictionary` and in order to get a stop info from the scripted process, we call a method that returns a `SBStructuredData` containing the stop reason data. TestStackCoreScriptedProcess` was failing specifically on x86_64 because the stop info dictionary contains the signal number, that the `Scripted Thread` was trying to extract as a signed integer where it was actually parsed as an unsigned integer. That caused `GetValueForKeyAsInteger` to return the default value parameter, `LLDB_INVALID_SIGNAL_NUMBER`. This patch address the issue by extracting the signal number with the appropriate type and re-enables the test. Differential Revision: https://reviews.llvm.org/D152848 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-06-13Revert "[lldb] Fix failure in TestStackCoreScriptedProcess on x86_64"Med Ismail Bennani1-0/+1
This reverts commit 4177b490358432a457935ba5d6d076ae60de588f, since I landed it by mistake.
2023-06-13[lldb] Fix failure in TestStackCoreScriptedProcess on x86_64Med Ismail Bennani1-1/+0
This patch should address the failure of TestStackCoreScriptedProcess that is happening specifically on x86_64. It turns out that in 1370a1cb5b97, I changed the way we extract integers from a `StructuredData::Dictionary` and in order to get a stop info from the scripted process, we call a method that returns a `SBStructuredData` containing the stop reason data. TestStackCoreScriptedProcess` was failing specifically on x86_64 because the stop info dictionary contains the signal number, that the `Scripted Thread` was trying to extract as a signed integer where it was actually parsed as an unsigned integer. That caused `GetValueForKeyAsInteger` to return the default value parameter, `LLDB_INVALID_SIGNAL_NUMBER`. This patch address the issue by extracting the signal number with the appropriate type and re-enables the test. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-05-25TestStackCoreScriptedProcess.py is timing out, skip itJason Molenda1-1/+1
The x86_64 macOS CI bot is failing because this test times out. It was marked as expectedFail earlier today, but that's not considered a fail so the CI runs are red. Skipping it on Darwin for now until Ismail can look into it.
2023-05-25Re-revert "[lldb] Move PassthroughScriptedProcess to `lldb.scripted_process` ↵Med Ismail Bennani1-0/+1
module" This reverts commit 429e74839506ea8ba962d24647264ed81f680bbf since it didn't address the test failures on GreenDragon. This patch will mark the tests as expected to fail until I can reproduce the issue and find a solution. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere5-125/+229
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2023-05-22[lldb] Add "Trace" stop reason in Scripted ThreadMed Ismail Bennani2-4/+2
This patch adds support to eStopReasonTrace to Scripted Threads. This is necessary when using a Scrited Process with a Scripted Thread Plan to report a special thread stop reason to the thread plan. rdar://109425542 Differential Revision: https://reviews.llvm.org/D151043 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-03-03[lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementationMed Ismail Bennani1-0/+9
When using SBProcess::GetScriptedImplementation in python, if the process has a valid implementation, we returned a reference of the object without incrementing the reference counting. That causes the interpreter to crash after accessing the reference several times. This patch address this by incrementing the reference count when passing the valid object reference. Differential Revision: https://reviews.llvm.org/D145260 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03[lldb/Plugins] Add memory writing capabilities to Scripted ProcessMed Ismail Bennani2-5/+23
This patch adds memory writing capabilities to the Scripted Process plugin. This allows to user to get a target address and a memory buffer on the python scripted process implementation that the user can make processing on before performing the actual write. This will also be used to write trap instruction to a real process memory to set a breakpoint. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03[lldb/Plugins] Clean-up Scripted Process interface requirements (NFC)Med Ismail Bennani3-24/+0
The goal of the simple patch is to clean-up the scripted process interface by removing methods that were introduced with the interface originally, but that were never really implemented (get_thread_with_id & get_registers_for_thread). This patch also changes `get_memory_region_containing_address` to have a base implementation (that retunrs `None`), instead of forcing the user to override it in their derived class. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03[lldb/Plugins] Add Attach capabilities to ScriptedProcessMed Ismail Bennani1-1/+7
This patch adds process attach capabilities to the ScriptedProcess plugin. This doesn't really expects a PID or process name, since the process state is already script, however, this allows to create a scripted process without requiring to have an executuble in the target. In order to do so, this patch also turns the scripted process related getters and setters from the `ProcessLaunchInfo` and `ProcessAttachInfo` classes to a `ScriptedMetadata` instance and moves it in the `ProcessInfo` class, so it can be accessed interchangeably. This also adds the necessary SWIG wrappers to convert the internal `Process{Attach,Launch}InfoSP` into a `SB{Attach,Launch}Info` to pass it as argument the scripted process python implementation and convert it back to the internal representation. rdar://104577406 Differential Revision: https://reviews.llvm.org/D143104 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-02-06[lldb/Plugins] Fix method dispatch bug when using multiple scripted processesMed Ismail Bennani2-12/+38
This patch should address a bug when a user have multiple scripted processes in the same debugging session. In order for the scripted process plugin to be able to call into the scripted object instance methods to fetch the necessary data to reconstruct its state, the scripted process plugin calls into a scripted process interface, that has a reference to the created script object instance. However, prior to this patch, we only had a single instance of the scripted process interface, living the script interpreter. So every time a new scripted process plugin was created, it would overwrite the script object instance that was held by the single scripted process interface in the script interpreter. That would cause all the method calls made to the scripted process interface to be dispatched by the last instanciated script object instance, which is wrong. In order to prevent that, this patch moves the scripted process interface reference to be help by the scripted process plugin itself. rdar://104882562 Differential Revision: https://reviews.llvm.org/D143308 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-02-03[lldb] Add a way to get a scripted process implementation from the SBAPIMed Ismail Bennani2-0/+16
This patch introduces a new `GetScriptedImplementation` method to the SBProcess class in the SBAPI. It will allow users of Scripted Processes to fetch the scripted implementation object from to script interpreter to be able to interact with it directly (without having to go through lldb). This allows to user to perform action that are not specified in the scripted process interface, like calling un-specified methods, but also to enrich the implementation, by passing it complex objects. Differential Revision: https://reviews.llvm.org/D143236 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-01-30[lldb/test] Skip TestStackCoreScriptedProcess if Asan is enabledMed Ismail Bennani1-0/+1
This patch skips TestStackCoreScriptedProcess because the test times out when the Address Sanitizer is running. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-01-12[lldb/test] Fix data racing issue in TestStackCoreScriptedProcessMed Ismail Bennani6-29/+30
This patch should fix an nondeterministic error in TestStackCoreScriptedProcess. In order to test both the multithreading capability and shared library loading in Scripted Processes, the test would create multiple threads that would take the same variable as a reference. The first thread would alter the value and the second thread would monitor the value until it gets altered. This assumed a certain ordering regarding the `std::thread` spawning, however the ordering was not always guaranteed at runtime. To fix that, the test now makes use of a `std::condition_variable` shared between the each thread. On the former, it will notify the other thread when the variable gets initialized or updated and on the latter, it will wait until the variable it receives a new notification. This should fix the data racing issue while preserving the testing coverage. rdar://98678134 Differential Revision: https://reviews.llvm.org/D139484 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-01-12[lldb/test] Disable TestScriptedProcess.py on linux while investigating the ↵Med Ismail Bennani1-0/+1
issue Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-01-12[lldb] Add ScriptedPlatform python implementationMed Ismail Bennani3-7/+7
This patch introduces both the Scripted Platform python base implementation and an example for it. The base implementation is embedded in lldb python module under `lldb.plugins.scripted_platform`. This patch also refactor the various SWIG methods to create scripted objects into a single method, that is now shared between the Scripted Platform, Process and Thread. It also replaces the target argument by a execution context object. Differential Revision: https://reviews.llvm.org/D139250 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-18[lldb/Plugins] Improve error reporting with reading memory in Scripted ProcessMed Ismail Bennani4-6/+18
This patch improves the ScriptedPythonInterface::Dispatch method to support passing lldb_private types to the python implementation. This will allow, for instance, the Scripted Process python implementation to report errors when reading memory back to lldb. To do so, the Dispatch method will transform the private types in the parameter pack into `PythonObject`s to be able to pass them down to the python methods. Then, if the call succeeded, the transformed arguments will be converted back to their original type and re-assigned in the parameter pack, to ensure pointers and references behaviours are preserved. This patch also updates various scripted process python class and tests to reflect this change. rdar://100030995 Differential Revision: https://reviews.llvm.org/D134033 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-10-27[lldb][test] Remove empty setUp/tearDown methods (NFC)Dave Lee2-12/+0
2022-08-03[lldb] Add assertStopReason helper functionJonas Devlieghere1-1/+1
Add a function to make it easier to debug a test failure caused by an unexpected stop reason. This is similar to the assertState helper that was added in ce825e46743b. Before: self.assertEqual(stop_reason, lldb.eStopReasonInstrumentation) AssertionError: 5 != 10 After: self.assertStopReason(stop_reason, lldb.eStopReasonInstrumentation) AssertionError: signal (5) != instrumentation (10) Differential revision: https://reviews.llvm.org/D131083
2022-06-17[lldb][tests] Automatically call compute_mydir (NFC)Dave Lee2-4/+0
Eliminate boilerplate of having each test manually assign to `mydir` by calling `compute_mydir` in lldbtest.py. Differential Revision: https://reviews.llvm.org/D128077
2022-04-08[lldb] Skip more tests that don't make sense to run remotelyJonas Devlieghere1-0/+1
Skip another batch of tests that don't really make sense to run remotely.
2022-03-10[lldb/Plugin] Test that a scripted process blueprint can be loaded for the dSYMMed Ismail Bennani1-10/+20
This patch ensures that lldb can automatically load a scripted process blueprint from a dSYM bundle and launch a scripted process with it. rdar://74502750 Differential Revision: https://reviews.llvm.org/D121316 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04[lldb/Test] Fix test_launch_scripted_process_stack_frames failureMed Ismail Bennani1-1/+4
This should fix the test_launch_scripted_process_stack_frames GreenDragon test failure : https://green.lab.llvm.org/green/job/lldb-cmake/41901 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04[lldb/Test] Disable test_scripted_process_and_scripted_thread on WindowsMed Ismail Bennani1-1/+1
This disables TestScriptedProcess.test_scripted_process_and_scripted_thread on Windows since the inferior binary a linked to a dylib that doesn't build on Windows. This should fix https://lab.llvm.org/buildbot/#/builders/83/builds/16100 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04[lldb/Plugins] Add ability to load modules to Scripted ProcessesMed Ismail Bennani6-21/+77
This patch introduces a new way to load modules programatically with Scripted Processes. To do so, the scripted process blueprint holds a list of dictionary describing the modules to load, which their path or uuid, load address and eventually a slide offset. LLDB will fetch that list after launching the ScriptedProcess, and iterate over each entry to create the module that will be loaded in the Scripted Process' target. The patch also refactors the StackCoreScriptedProcess test to stop inside the `libbaz` module and make sure it's loaded correctly and that we can fetch some variables from it. rdar://74520238 Differential Revision: https://reviews.llvm.org/D120969 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-16[lldb/Plugin] Add artificial stackframe loading in ScriptedThreadMed Ismail Bennani4-46/+5
This patch adds the ability for ScriptedThread to load artificial stack frames. To do so, the interpreter instance can create a list that will contain the frame index and its pc address. Then, when the Scripted Process plugin stops, it will refresh its Scripted Threads state by invalidating their register context and load to list from the interpreter object and reconstruct each frame. This patch also removes all of the default implementation for `get_stackframes` from the derived ScriptedThread classes, and add the interface code for the Scripted Thread Interface. rdar://88721095 Differential Revision: https://reviews.llvm.org/D119388 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-14[lldb] Replace asserts on .Success() with assertSuccess()Dave Lee2-3/+3
Replace forms of `assertTrue(err.Success())` with `assertSuccess(err)` (added in D82759). * `assertSuccess` prints out the error's message * `assertSuccess` expresses explicit higher level semantics, both to the reader and for test failure output * `assertSuccess` seems not to be well known, using it where possible will help spread knowledge * `assertSuccess` statements are more succinct Differential Revision: https://reviews.llvm.org/D119616
2022-02-09[lldb/test] Split Scripted Process test in multiple tests (NFC)Med Ismail Bennani2-88/+113
This splits the scripted process tests to be able to run in parallel since some of test functions can take a very long time to run. This also disables debug info testing. Differential Revision: https://reviews.llvm.org/D118513 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-09[lldb/test] Fix TestScriptedProcess.py timeout on x86_64Med Ismail Bennani3-10/+32
This patch fixes a timeout issue on the ScriptedProcess test that was happening on intel platforms. The timeout was due to a misreporting of the StopInfo in the ScriptedThread that caused the ScriptedProcess to never stop. To solve this, this patch changes the way a ScriptedThread reports its stop reason by making it more architecture specific. In order to do so, this patch also refactors the ScriptedProcess & ScriptedThread initializer methods to provide an easy access to the target architecture. Differential Revision: https://reviews.llvm.org/D118484 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-01-27[lldb/test] Disable test_launch_scripted_process_stack_frames on x86_64Med Ismail Bennani1-0/+1
There seems to be an issue on x86_64 when launching a ScriptdProcess. This disables temporarely the test that causes the bot to timeout until I finish investigating the issue. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>