<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/examples/python/cmdtemplate.py, branch main</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>Make flag-only options work in the ParsedCommand mode of adding commands (#157756)</title>
<updated>2025-09-10T16:27:29+00:00</updated>
<author>
<name>jimingham</name>
<email>jingham@apple.com</email>
</author>
<published>2025-09-10T16:27:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e2d9420272e2f479dc714706be5a4aa0a4b2c90d'/>
<id>e2d9420272e2f479dc714706be5a4aa0a4b2c90d</id>
<content type='text'>
I neglected to add a test when I was writing tests for this, so of
course it broke. This makes it work again and adds a test.

rdar://159459160</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I neglected to add a test when I was writing tests for this, so of
course it broke. This makes it work again and adds a test.

rdar://159459160</pre>
</div>
</content>
</entry>
<entry>
<title>Add the ability to define custom completers to the parsed_cmd template. (#109062)</title>
<updated>2024-09-24T17:00:00+00:00</updated>
<author>
<name>jimingham</name>
<email>jingham@apple.com</email>
</author>
<published>2024-09-24T17:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=04b443e77845cd20ab5acc4356cee509316135dd'/>
<id>04b443e77845cd20ab5acc4356cee509316135dd</id>
<content type='text'>
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&lt;TAB&gt;` only complete on symbols
in foo.dylib, you can use this new mechanism to achieve that.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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&lt;TAB&gt;` only complete on symbols
in foo.dylib, you can use this new mechanism to achieve that.</pre>
</div>
</content>
</entry>
<entry>
<title>Add docs and an example use of the scripted command get_flags API. (#109176)</title>
<updated>2024-09-19T01:10:43+00:00</updated>
<author>
<name>jimingham</name>
<email>jingham@apple.com</email>
</author>
<published>2024-09-19T01:10:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=615bd9ee60ca213d0e93a7ddc5c1bf48418952e9'/>
<id>615bd9ee60ca213d0e93a7ddc5c1bf48418952e9</id>
<content type='text'>
The API is present, and we even have a test for it, but it isn't
documented so no one probably knows you can set requirements for your
scripted commands. This just adds docs and uses it appropriately in the
`framestats` example command.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The API is present, and we even have a test for it, but it isn't
documented so no one probably knows you can set requirements for your
scripted commands. This just adds docs and uses it appropriately in the
`framestats` example command.</pre>
</div>
</content>
</entry>
<entry>
<title>Add the ability for Script based commands to specify their "repeat command" (#94823)</title>
<updated>2024-07-03T17:39:34+00:00</updated>
<author>
<name>jimingham</name>
<email>jingham@apple.com</email>
</author>
<published>2024-07-03T17:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=77d131eddb6ca9060c844fae9cb78779fa70c8f0'/>
<id>77d131eddb6ca9060c844fae9cb78779fa70c8f0</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</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>[NFC][Py Reformat] Reformat python files in lldb</title>
<updated>2023-05-25T19:54:09+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2023-05-25T15:48:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2238dcc39358353cac21df75c3c3286ab20b8f53'/>
<id>2238dcc39358353cac21df75c3c3286ab20b8f53</id>
<content type='text'>
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 &lt;yourfile&gt;` 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;yourfile&gt;` 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
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Update custom commands to always be overrriden</title>
<updated>2023-01-13T03:20:51+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>medismail.bennani@gmail.com</email>
</author>
<published>2023-01-12T23:30:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e3930e77fc5b626a3c6b95f08ed25a3f8807c579'/>
<id>e3930e77fc5b626a3c6b95f08ed25a3f8807c579</id>
<content type='text'>
This is a follow-up patch to 6f7835f309b9.

As explained previously, when running from an IDE, it can happen that
the IDE imports some lldb scripts by itself. If the user also tries to
import these commands, lldb will show the following message:

```
error: cannot add command: user command exists and force replace not set
```

This message is confusing to the user, because it suggests that the
command import failed and that the execution should stop. However, in
this case, lldb will continue the execution with the command added
previously by the user.

To prevent that, this patch updates every first-party lldb-packaged
custom commands to override commands that were pre-imported in lldb.

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

Signed-off-by: Med Ismail Bennani &lt;medismail.bennani@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up patch to 6f7835f309b9.

As explained previously, when running from an IDE, it can happen that
the IDE imports some lldb scripts by itself. If the user also tries to
import these commands, lldb will show the following message:

```
error: cannot add command: user command exists and force replace not set
```

This message is confusing to the user, because it suggests that the
command import failed and that the execution should stop. However, in
this case, lldb will continue the execution with the command added
previously by the user.

To prevent that, this patch updates every first-party lldb-packaged
custom commands to override commands that were pre-imported in lldb.

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

Signed-off-by: Med Ismail Bennani &lt;medismail.bennani@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB] Remove __future__ imports from examples</title>
<updated>2022-08-15T09:04:25+00:00</updated>
<author>
<name>David Spickett</name>
<email>david.spickett@linaro.org</email>
</author>
<published>2022-08-12T13:14:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9f947abf94e16fa7c759ab56a4fb030d6ef25961'/>
<id>9f947abf94e16fa7c759ab56a4fb030d6ef25961</id>
<content type='text'>
Not needed now that we require python 3.

Reviewed By: kastiglione, JDevlieghere

Differential Revision: https://reviews.llvm.org/D131772
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not needed now that we require python 3.

Reviewed By: kastiglione, JDevlieghere

Differential Revision: https://reviews.llvm.org/D131772
</pre>
</div>
</content>
</entry>
<entry>
<title>Harmonize Python shebang</title>
<updated>2020-07-16T19:53:45+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@redhat.com</email>
</author>
<published>2020-07-15T07:31:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=515bc8c1554f03515565878ea3d35cffdc6fd195'/>
<id>515bc8c1554f03515565878ea3d35cffdc6fd195</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D83857
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D83857
</pre>
</div>
</content>
</entry>
<entry>
<title>Python 2/3 compatibility: from __future__ import print_function</title>
<updated>2019-03-21T18:27:40+00:00</updated>
<author>
<name>Serge Guelton</name>
<email>sguelton@redhat.com</email>
</author>
<published>2019-03-21T18:27:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=525cd59f5a12254e80d5f20bf2d9713728a114d4'/>
<id>525cd59f5a12254e80d5f20bf2d9713728a114d4</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D59580

llvm-svn: 356695
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D59580

llvm-svn: 356695
</pre>
</div>
</content>
</entry>
</feed>
