History log of /llvm-project/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp (Results 1 – 25 of 64)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1
# 04b443e7 24-Sep-2024 jimingham <jingham@apple.com>

Add the ability to define custom completers to the parsed_cmd template. (#109062)

If your arguments or option values are of a type that naturally uses one
of our common completion mechanisms, you w

Add the ability to define custom completers to the parsed_cmd template. (#109062)

If your arguments or option values are of a type that naturally uses one
of our common completion mechanisms, you will get completion for free.
But if you have your own custom values or if you want to do fancy things
like have `break set -s foo.dylib -n ba<TAB>` only complete on symbols
in foo.dylib, you can use this new mechanism to achieve that.

show more ...


# f732157a 20-Sep-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/Interpreter] Introduce ScriptedStopHook{,Python}Interface & make use of it (#109498)

This patch re-lands #105449 and fixes the various test failures.

---------

Signed-off-by: Med Ismail

[lldb/Interpreter] Introduce ScriptedStopHook{,Python}Interface & make use of it (#109498)

This patch re-lands #105449 and fixes the various test failures.

---------

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

show more ...


# 801046e3 20-Sep-2024 David Spickett <david.spickett@linaro.org>

Revert "[lldb] Fix SWIG wrapper compilation error"

...and "[lldb/Interpreter] Introduce `ScriptedStopHook{,Python}Interface` & make use of it (#105449)"

This reverts commit 76b827bb4d5b4cc4d3229c4c

Revert "[lldb] Fix SWIG wrapper compilation error"

...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.

show more ...


# 76b827bb 20-Sep-2024 David Spickett <david.spickett@linaro.org>

[lldb] Fix SWIG wrapper compilation error

Introduced by 1e131ddfa8f1d7b18c85c6e4079458be8b419421.

https://lab.llvm.org/buildbot/#/builders/59/builds/5272


# 1e131ddf 20-Sep-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/Interpreter] Introduce `ScriptedStopHook{,Python}Interface` & make use of it (#105449)

This patch introduces new `ScriptedStopHook{,Python}Interface` classes
that make use of the Scripted Int

[lldb/Interpreter] Introduce `ScriptedStopHook{,Python}Interface` & make use 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>

show more ...


Revision tags: llvmorg-19.1.0
# b798f4bd 05-Sep-2024 Adrian Prantl <aprantl@apple.com>

[lldb] Make deep copies of Status explicit (NFC) (#107170)


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 77d131ed 03-Jul-2024 jimingham <jingham@apple.com>

Add the ability for Script based commands to specify their "repeat command" (#94823)

Among other things, returning an empty string as the repeat command
disables auto-repeat, which can be useful fo

Add the ability for Script based commands to specify their "repeat command" (#94823)

Among other things, returning an empty string as the repeat command
disables auto-repeat, which can be useful for state-changing commands.

There's one remaining refinement to this setup, which is that for parsed
script commands, it should be possible to change an option value, or add
a new option value that wasn't originally specified, then ask lldb "make
this back into a command string". That would make doing fancy things
with repeat commands easier.

That capability isn't present in the lldb_private side either, however.
So that's for a next iteration.

I haven't added this to the docs on adding commands yet. I wanted to
make sure this was an acceptable approach before I spend the time to do
that.

show more ...


# 9a9ec228 27-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

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

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities b

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#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>

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7
# ae3f6806 23-May-2024 Med Ismail Bennani <ismail@bennani.ma>

Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392)" (#93153)

Reverts llvm/llvm-project#93149 since it breaks
https://lab.llvm.org/buildbot/#/builders/68/bu

Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392)" (#93153)

Reverts llvm/llvm-project#93149 since it breaks
https://lab.llvm.org/buildbot/#/builders/68/builds/74799

show more ...


# 4cc6d0f4 23-May-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392) (#93149)

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facil

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (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>

show more ...


Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3
# 5c96e71d 18-Feb-2024 Jonas Devlieghere <jonas@devlieghere.com>

[lldb] Don't rely on ScriptInterpreterPythonImpl::Initialize in the unit tests (#82096)

The unit tests only test the Python objects and don't actually use
anything from the LLDB module. That means

[lldb] Don't rely on ScriptInterpreterPythonImpl::Initialize in the unit tests (#82096)

The unit tests only test the Python objects and don't actually use
anything from the LLDB module. That means that all the additional
complexity in ScriptInterpreterPythonImpl::Initialize is overkill.

By doing the initialization by hand, we avoid the annoying
ModuleNotFoundError.

Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb'

The error is the result of us stubbing out the SWIG (specifically
`PyInit__lldb`) because we cannot link against libLLDB from the unit
tests.

The downside of doing the initialization manually is that we do lose a
bit of test coverage. For example, issue #70453 also manifested itself
in the unit tests.

show more ...


# a69ecb24 13-Feb-2024 jimingham <jingham@apple.com>

Add the ability to define a Python based command that uses CommandObjectParsed (#70734)

This allows you to specify options and arguments and their definitions
and then have lldb handle the completi

Add the ability to define a Python based command that uses CommandObjectParsed (#70734)

This allows you to specify options and arguments and their definitions
and then have lldb handle the completions, help, etc. in the same way
that lldb does for its parsed commands internally.

This feature has some design considerations as well as the code, so I've
also set up an RFC, but I did this one first and will put the RFC
address in here once I've pushed it...

Note, the lldb "ParsedCommand interface" doesn't actually do all the
work that it should. For instance, saying the type of an option that has
a completer doesn't automatically hook up the completer, and ditto for
argument values. We also do almost no work to verify that the arguments
match their definition, or do auto-completion for them. This patch
allows you to make a command that's bug-for-bug compatible with built-in
ones, but I didn't want to stall it on getting the auto-command checking
to work all the way correctly.

As an overall design note, my primary goal here was to make an interface
that worked well in the script language. For that I needed, for
instance, to have a property-based way to get all the option values that
were specified. It was much more convenient to do that by making a
fairly bare-bones C interface to define the options and arguments of a
command, and set their values, and then wrap that in a Python class
(installed along with the other bits of the lldb python module) which
you can then derive from to make your new command. This approach will
also make it easier to experiment.

See the file test_commands.py in the test case for examples of how this
works.

show more ...


Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1
# 61384850 29-Jan-2024 Jason Molenda <jason@molenda.com>

Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)"

Temporarily revert to unblock the CI bots, this is breaking the -DLLVM_ENABLE_MODULES=On
modules style build.

Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#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 888501bc631c4f6d373b4081ff6c504a1ce4a682.

show more ...


# 888501bc 29-Jan-2024 Med Ismail Bennani <ismail@bennani.ma>

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

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introduc

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#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>

show more ...


Revision tags: llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4
# 6eafe2cb 31-Oct-2023 Med Ismail Bennani <ismail@bennani.ma>

Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)"

This reverts commit 4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce since it
introduces some test failures:

https://l

Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)"

This reverts commit 4b3cd379cce3f455bf3c8677ca7a5be6e708a4ce since it
introduces some test failures:

https://lab.llvm.org/buildbot/#/builders/68/builds/62556

show more ...


# 4b3cd379 30-Oct-2023 Med Ismail Bennani <ismail@bennani.ma>

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

This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introdu

[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#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>

show more ...


# 7a1e8783 26-Oct-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb] Introduce OperatingSystem{,Python}Interface and make use it

This patch aims to consolidate the OperatingSystem scripting affordance
by introducing a stable interface that conforms to the
Scri

[lldb] Introduce OperatingSystem{,Python}Interface and make use it

This patch aims to consolidate the OperatingSystem scripting affordance
by introducing a stable interface that conforms to the
Scripted{,Python}Interface.

This unify the way we call into python methods from lldb while
also improving its capabilities by allowing us to pass lldb_private
objects are arguments.

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

show more ...


# f22d82ce 25-Oct-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/Interpreter] Make ScriptedInterface Object creation more generic (#68052)

This patch changes the way plugin objects used with Scripted Interfaces
are created.

Instead of implementing a dif

[lldb/Interpreter] Make ScriptedInterface Object creation more generic (#68052)

This patch changes the way plugin objects used with Scripted Interfaces
are created.

Instead of implementing a different SWIG method to create the object for
every scripted interface, this patch makes the creation more generic by
re-using some of the ScriptedPythonInterface templated Dispatch code.

This patch also improves error handling of the object creation by
returning an `llvm::Expected`.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

show more ...


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4
# 27b6a4e6 08-May-2023 Alex Langford <alangford@apple.com>

[lldb] Mark most SBAPI methods involving private types as protected or private

Many SB classes have public constructors or methods involving types that
are private. Some are more obvious (e.g. conta

[lldb] Mark most SBAPI methods involving private types as protected or private

Many SB classes have public constructors or methods involving types that
are private. Some are more obvious (e.g. containing lldb_private in the
name) than others (lldb::FooSP is usually std::shared_pointer<lldb_private::Foo>).

This commit explicitly does not address FileSP, so I'm leaving that one
alone for now.

Some of these were for other SB classes to use and should have been made
protected/private with a friend class entry added. Some of these were
public for some of the swig python helpers to use. I put all of those
functions into a class and made them static methods. The relevant SB
classes mark that class as a friend so they can access those
private/protected members.

I've also removed an outdated SBStructuredData test (can you guess which
constructor it was using?) and updated the other relevant tests.

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

show more ...


# c2be7021 02-May-2023 Jim Ingham <jingham@apple.com>

Allow scripted thread plans to modify the thread stop description when
they are completed.


Revision tags: llvmorg-16.0.3
# e31d0c20 25-Apr-2023 Med Ismail Bennani <medismail.bennani@gmail.com>

[lldb] Improve breakpoint management for interactive scripted process

This patch improves breakpoint management when doing interactive
scripted process debugging.

In other to know which process set

[lldb] Improve breakpoint management for interactive scripted process

This patch improves breakpoint management when doing interactive
scripted process debugging.

In other to know which process set a breakpoint, we need to do some book
keeping on the multiplexer scripted process. When initializing the
multiplexer, we will first copy breakpoints that are already set on the
driving target.

Everytime we launch or resume, we should copy breakpoints from the
multiplexer to the driving process.

When creating a breakpoint from a child process, it needs to be set both
on the multiplexer and on the driving process. We also tag the created
breakpoint with the name and pid of the originator process.

This patch also implements all the requirement to achieve proper
breakpoint management. That involves:

- Adding python interator for breakpoints and watchpoints in SBTarget
- Add a new `ScriptedProcess.create_breakpoint` python method

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

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

show more ...


Revision tags: llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4
# f190ec68 04-Mar-2023 Med Ismail Bennani <medismail.bennani@gmail.com>

[lldb/Plugins] Add memory writing capabilities to Scripted Process

This patch adds memory writing capabilities to the Scripted Process plugin.

This allows to user to get a target address and a memo

[lldb/Plugins] Add memory writing capabilities to Scripted Process

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>

show more ...


# b9d4c94a 03-Mar-2023 Med Ismail Bennani <medismail.bennani@gmail.com>

[lldb/Plugins] Add Attach capabilities to ScriptedProcess

This patch adds process attach capabilities to the ScriptedProcess
plugin. This doesn't really expects a PID or process name, since the
proc

[lldb/Plugins] Add Attach capabilities to ScriptedProcess

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>

show more ...


Revision tags: llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# bb4ccc66 12-Jan-2023 Med Ismail Bennani <medismail.bennani@gmail.com>

[lldb] Add ScriptedPlatform python implementation

This patch introduces both the Scripted Platform python base
implementation and an example for it.

The base implementation is embedded in lldb pyth

[lldb] Add ScriptedPlatform python implementation

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>

show more ...


# 2fe83274 07-Jan-2023 Kazu Hirata <kazu@google.com>

[lldb] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/

[lldb] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


123