<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp, branch users/shawbyoung/spr/main.boltnfc-refactoring-callgraph</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392) (#96868)</title>
<updated>2024-06-27T08:45:30+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>ismail@bennani.ma</email>
</author>
<published>2024-06-27T08:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9a9ec228cdcf75d01be82be5be13e1542f0fc75d'/>
<id>9a9ec228cdcf75d01be82be5be13e1542f0fc75d</id>
<content type='text'>
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
&amp; ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface &amp; 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} &amp; OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &amp;
`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 &lt;ismail@bennani.ma&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
&amp; ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface &amp; 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} &amp; OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &amp;
`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 &lt;ismail@bennani.ma&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Add a createError variant without error code (NFC) (#93209)</title>
<updated>2024-05-23T21:22:07+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2024-05-23T21:22:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af31883341a122a7285e9b4f0a034470024021eb'/>
<id>af31883341a122a7285e9b4f0a034470024021eb</id>
<content type='text'>
For the significant amount of call sites that want to create an
incontrovertible error, such a wrapper function creates a significant
readability improvement and lowers the cost of entry to add error
handling in more places.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For the significant amount of call sites that want to create an
incontrovertible error, such a wrapper function creates a significant
readability improvement and lowers the cost of entry to add error
handling in more places.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392)" (#93153)</title>
<updated>2024-05-23T08:46:29+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>ismail@bennani.ma</email>
</author>
<published>2024-05-23T08:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ae3f68066c8f282145435880107c1d3dc26ec3b8'/>
<id>ae3f68066c8f282145435880107c1d3dc26ec3b8</id>
<content type='text'>
Reverts llvm/llvm-project#93149 since it breaks
https://lab.llvm.org/buildbot/#/builders/68/builds/74799</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#93149 since it breaks
https://lab.llvm.org/buildbot/#/builders/68/builds/74799</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392) (#93149)</title>
<updated>2024-05-23T08:25:48+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>ismail@bennani.ma</email>
</author>
<published>2024-05-23T08:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4'/>
<id>4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4</id>
<content type='text'>
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
&amp; ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface &amp; 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} &amp; OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &amp;
`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 &lt;ismail@bennani.ma&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
&amp; ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface &amp; 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} &amp; OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &amp;
`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 &lt;ismail@bennani.ma&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fix interactive use of "command script add". (#83350)</title>
<updated>2024-02-29T01:26:29+00:00</updated>
<author>
<name>jimingham</name>
<email>jingham@apple.com</email>
</author>
<published>2024-02-29T01:26:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5784bf85bc5143266565586ece0113cd773a8616'/>
<id>5784bf85bc5143266565586ece0113cd773a8616</id>
<content type='text'>
There was a think-o in a previous commit that made us only able to
define 1 line commands when using command script add interactively.

There was also no test for this feature, so I fixed the think-o and
added a test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was a think-o in a previous commit that made us only able to
define 1 line commands when using command script add interactively.

There was also no test for this feature, so I fixed the think-o and
added a test.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Call Import_AppendInittab before Py_Initialize (#82095)</title>
<updated>2024-02-17T23:10:09+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2024-02-17T23:10:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fbce244299524fc3d736cce9d25b4262303b45d5'/>
<id>fbce244299524fc3d736cce9d25b4262303b45d5</id>
<content type='text'>
The Python documentation [1] says that `PyImport_AppendInittab` should
be called before `Py_Initialize()`. Starting with Python 3.12, this is
enforced with a fatal error:

  Fatal Python error: PyImport_AppendInittab: PyImport_AppendInittab()
  may not be called after Py_Initialize()

This commit ensures we only modify the table of built-in modules if
Python hasn't been initialized. For Python embedded in LLDB, that means
this happen exactly once, before the first call to `Py_Initialize`,
which becomes a NO-OP after. However, when lldb is imported in an
existing Python interpreter, Python will have already been initialized,
but by definition, the lldb module will already have been loaded, so
it's safe to skip adding it (again).

This fixes #70453.

[1] https://docs.python.org/3.12/c-api/import.html#c.PyImport_AppendInittab</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Python documentation [1] says that `PyImport_AppendInittab` should
be called before `Py_Initialize()`. Starting with Python 3.12, this is
enforced with a fatal error:

  Fatal Python error: PyImport_AppendInittab: PyImport_AppendInittab()
  may not be called after Py_Initialize()

This commit ensures we only modify the table of built-in modules if
Python hasn't been initialized. For Python embedded in LLDB, that means
this happen exactly once, before the first call to `Py_Initialize`,
which becomes a NO-OP after. However, when lldb is imported in an
existing Python interpreter, Python will have already been initialized,
but by definition, the lldb module will already have been loaded, so
it's safe to skip adding it (again).

This fixes #70453.

[1] https://docs.python.org/3.12/c-api/import.html#c.PyImport_AppendInittab</pre>
</div>
</content>
</entry>
<entry>
<title>Add the ability to define a Python based command that uses CommandObjectParsed (#70734)</title>
<updated>2024-02-13T19:09:47+00:00</updated>
<author>
<name>jimingham</name>
<email>jingham@apple.com</email>
</author>
<published>2024-02-13T19:09:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a69ecb2420f644e31f18fcc61a07b3ca627e8939'/>
<id>a69ecb2420f644e31f18fcc61a07b3ca627e8939</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)"</title>
<updated>2024-01-29T18:43:33+00:00</updated>
<author>
<name>Jason Molenda</name>
<email>jason@molenda.com</email>
</author>
<published>2024-01-29T18:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=61384850c5950b8c5ee0abd75982f5cad8f98536'/>
<id>61384850c5950b8c5ee0abd75982f5cad8f98536</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)</title>
<updated>2024-01-29T11:17:33+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>ismail@bennani.ma</email>
</author>
<published>2024-01-29T10:21:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=888501bc631c4f6d373b4081ff6c504a1ce4a682'/>
<id>888501bc631c4f6d373b4081ff6c504a1ce4a682</id>
<content type='text'>
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
&amp; ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface &amp; 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} &amp; OperatingSystem.

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

Signed-off-by: Med Ismail Bennani &lt;ismail@bennani.ma&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
&amp; ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface &amp; 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} &amp; OperatingSystem.

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

Signed-off-by: Med Ismail Bennani &lt;ismail@bennani.ma&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/Interpreter] Make Scripted*Interface base class abstract (#71465)</title>
<updated>2023-11-07T17:56:22+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>ismail@bennani.ma</email>
</author>
<published>2023-11-07T17:56:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7991412270ce1147ca0ab286e2479b5381a564ad'/>
<id>7991412270ce1147ca0ab286e2479b5381a564ad</id>
<content type='text'>
This patch makes the various Scripted Interface base class abstract by
making the `CreatePluginObject` method pure virtual.

This means that we cannot construct a Scripted Interface base class
instance, so this patch also updates the various
`ScriptedInterpreter::CreateScripted*Interface` methods to return a
`nullptr` instead.`

This patch also removes the `ScriptedPlatformInterface` member from the
`ScriptInterpreter` class since it the interpreter can be owned by the
`ScriptedPlatform` instance itself, like we do for `ScriptedProcess`
objects.

Signed-off-by: Med Ismail Bennani &lt;ismail@bennani.ma&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes the various Scripted Interface base class abstract by
making the `CreatePluginObject` method pure virtual.

This means that we cannot construct a Scripted Interface base class
instance, so this patch also updates the various
`ScriptedInterpreter::CreateScripted*Interface` methods to return a
`nullptr` instead.`

This patch also removes the `ScriptedPlatformInterface` member from the
`ScriptInterpreter` class since it the interpreter can be owned by the
`ScriptedPlatform` instance itself, like we do for `ScriptedProcess`
objects.

Signed-off-by: Med Ismail Bennani &lt;ismail@bennani.ma&gt;</pre>
</div>
</content>
</entry>
</feed>
