<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Commands/CommandObjectExpression.h, branch users/nico/python-2</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] Part 2 of 2 - Refactor `CommandObject::DoExecute(...)` return `void` (not `bool`) (#69991)</title>
<updated>2023-10-30T20:21:00+00:00</updated>
<author>
<name>Pete Lawrence</name>
<email>plawrence@apple.com</email>
</author>
<published>2023-10-30T20:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=92d8a28cc665d73d9d679b8c014dd04f95d1df18'/>
<id>92d8a28cc665d73d9d679b8c014dd04f95d1df18</id>
<content type='text'>
[lldb] Part 2 of 2 - Refactor `CommandObject::DoExecute(...)` to return
`void` instead of ~~`bool`~~

Justifications:
- The code doesn't ultimately apply the `true`/`false` return values.
- The methods already pass around a `CommandReturnObject`, typically
with a `result` parameter.
- Each command return object already contains:
	- A more precise status
	- The error code(s) that apply to that status

Part 1 refactors the `CommandObject::Execute(...)` method.
- See
[https://github.com/llvm/llvm-project/pull/69989](https://github.com/llvm/llvm-project/pull/69989)

rdar://117378957</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[lldb] Part 2 of 2 - Refactor `CommandObject::DoExecute(...)` to return
`void` instead of ~~`bool`~~

Justifications:
- The code doesn't ultimately apply the `true`/`false` return values.
- The methods already pass around a `CommandReturnObject`, typically
with a `result` parameter.
- Each command return object already contains:
	- A more precise status
	- The error code(s) that apply to that status

Part 1 refactors the `CommandObject::Execute(...)` method.
- See
[https://github.com/llvm/llvm-project/pull/69989](https://github.com/llvm/llvm-project/pull/69989)

rdar://117378957</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Delay removal of persistent results</title>
<updated>2023-05-18T16:44:11+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-05-15T21:36:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=db814552132d614e410118e22b22c89d35ae6062'/>
<id>db814552132d614e410118e22b22c89d35ae6062</id>
<content type='text'>
Follow up to "Suppress persistent result when running po" (D144044).

This change delays removal of the persistent result until after `Dump` has been called.
In doing so, the persistent result is available for the purpose of getting its object
description.

In the original change, the persistent result removal happens indirectly, by setting
`EvaluateExpressionOptions::SetSuppressPersistentResult`. In practice this has worked,
however this exposed a latent bug in swift-lldb. The subtlety, and the bug, depend on
when the persisteted result variable is removed.

When the result is removed via `SetSuppressPersistentResult`, it happens within the call
to `Target::EvaluateExpression`. That is, by the time the call returns, the persistent
result is already removed.

The issue occurs shortly thereafter, when `ValueObject::Dump` is called, it cannot make
use of the persistent result variable (instead it uses the `ValueObjectConstResult`). In
swift-lldb, this causes an additional expression evaluation to happen. It first tries an
expression that reference `$R0` etc, but that always fails because `$R0` is removed. The
fallback to this failure does work most of the time, but there's at least one bug
involving imported Clang types.

Differential Revision: https://reviews.llvm.org/D150619
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up to "Suppress persistent result when running po" (D144044).

This change delays removal of the persistent result until after `Dump` has been called.
In doing so, the persistent result is available for the purpose of getting its object
description.

In the original change, the persistent result removal happens indirectly, by setting
`EvaluateExpressionOptions::SetSuppressPersistentResult`. In practice this has worked,
however this exposed a latent bug in swift-lldb. The subtlety, and the bug, depend on
when the persisteted result variable is removed.

When the result is removed via `SetSuppressPersistentResult`, it happens within the call
to `Target::EvaluateExpression`. That is, by the time the call returns, the persistent
result is already removed.

The issue occurs shortly thereafter, when `ValueObject::Dump` is called, it cannot make
use of the persistent result variable (instead it uses the `ValueObjectConstResult`). In
swift-lldb, this causes an additional expression evaluation to happen. It first tries an
expression that reference `$R0` etc, but that always fails because `$R0` is removed. The
fallback to this failure does work most of the time, but there's at least one bug
involving imported Clang types.

Differential Revision: https://reviews.llvm.org/D150619
</pre>
</div>
</content>
</entry>
<entry>
<title>Recommit [lldb] Change dwim-print to default to disabled persistent results</title>
<updated>2023-03-21T17:42:24+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-03-08T21:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=385496385476fc9735da5fa4acabc34654e8b30d'/>
<id>385496385476fc9735da5fa4acabc34654e8b30d</id>
<content type='text'>
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Updates: To recommit this, both TestPersistentResult.py and TestPAlias.py needed to be
updated, as well as the changes in D146230.

Differential Revision: https://reviews.llvm.org/D145609
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Updates: To recommit this, both TestPersistentResult.py and TestPAlias.py needed to be
updated, as well as the changes in D146230.

Differential Revision: https://reviews.llvm.org/D145609
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb] Change dwim-print to default to disabled persistent results"</title>
<updated>2023-03-15T21:00:00+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-03-15T20:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e6a65f52ca6263795d81bde220fb4c80b7b05ec'/>
<id>9e6a65f52ca6263795d81bde220fb4c80b7b05ec</id>
<content type='text'>
This reverts commit 8bad4ae679df6fc7dbd016dccbd3da34206e836b.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 8bad4ae679df6fc7dbd016dccbd3da34206e836b.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Change dwim-print to default to disabled persistent results</title>
<updated>2023-03-15T20:34:19+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-03-08T21:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8bad4ae679df6fc7dbd016dccbd3da34206e836b'/>
<id>8bad4ae679df6fc7dbd016dccbd3da34206e836b</id>
<content type='text'>
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Differential Revision: https://reviews.llvm.org/D145609
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Differential Revision: https://reviews.llvm.org/D145609
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Make persisting result variables configurable</title>
<updated>2023-02-18T01:50:43+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-02-16T23:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=63c77bf71d80b24df377fc45c80bfa1904ee849e'/>
<id>63c77bf71d80b24df377fc45c80bfa1904ee849e</id>
<content type='text'>
Context: The `expression` command uses artificial variables to store the expression
result. This result variable is unconditionally kept around after the expression command
has completed. These variables are known as persistent results. These are the variables
`$0`, `$1`, etc, that are displayed when running `p` or `expression`.

This change allows users to control whether result variables are persisted, by
introducing a `--persistent-result` flag.

This change keeps the current default behavior, persistent results are created by
default. This change gives users the ability to opt-out by re-aliasing `p`. For example:

```
command unalias p
command alias p expression --persistent-result false --
```

For consistency, this flag is also adopted by `dwim-print`. Of note, if asked,
`dwim-print` will create a persistent result even for frame variables.

Differential Revision: https://reviews.llvm.org/D144230
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Context: The `expression` command uses artificial variables to store the expression
result. This result variable is unconditionally kept around after the expression command
has completed. These variables are known as persistent results. These are the variables
`$0`, `$1`, etc, that are displayed when running `p` or `expression`.

This change allows users to control whether result variables are persisted, by
introducing a `--persistent-result` flag.

This change keeps the current default behavior, persistent results are created by
default. This change gives users the ability to opt-out by re-aliasing `p`. For example:

```
command unalias p
command alias p expression --persistent-result false --
```

For consistency, this flag is also adopted by `dwim-print`. Of note, if asked,
`dwim-print` will create a persistent result even for frame variables.

Differential Revision: https://reviews.llvm.org/D144230
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Add expression command options in dwim-print</title>
<updated>2023-02-18T01:50:08+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-02-15T16:23:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=920b46e108b23454e6827ed0fa5e0a69fcb4a6e6'/>
<id>920b46e108b23454e6827ed0fa5e0a69fcb4a6e6</id>
<content type='text'>
Adopt `expression`'s options in `dwim-print`.

This is primarily added to support the `--language`/`-l` flag.

Differential Revision: https://reviews.llvm.org/D144114
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adopt `expression`'s options in `dwim-print`.

This is primarily added to support the `--language`/`-l` flag.

Differential Revision: https://reviews.llvm.org/D144114
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Mark expressions that couldn't be parsed or executed as failed expressions</title>
<updated>2020-03-23T14:28:17+00:00</updated>
<author>
<name>Raphael Isemann</name>
<email>teemperor@gmail.com</email>
</author>
<published>2020-03-23T14:25:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6a4905ae2d65a2883112bf8cbf83c35c0c03f410'/>
<id>6a4905ae2d65a2883112bf8cbf83c35c0c03f410</id>
<content type='text'>
Summary:
LLDB keeps statistics of how many expression evaluations are 'successful' and 'failed'
which are updated after each expression evaluation (assuming statistics are enabled).
From what I understand the idea is that this could be used to define how well LLDB's
expression evaluator is working.

Currently all expressions are considered successful unless the user passes an explicit
positive element counting to the expression command (with the `-Z` flag) and then passes
an expression that successfully evaluates to a type that doesn't support element counting.
Expressions that fail to parse, execute or any other outcome are considered successful
at the moment which means we nearly always have a 100% expression evaluation
success rate.

This patch makes that expressions that fail to parse or execute to count as failed
expressions.

We can't know whether the expression failed because of an user error
of because LLDB couldn't correctly parse/compile it, but I would argue that this is
still an improvement. Assuming that the percentage of valid user expressions stays
mostly constant over time (which seems like a reasonable assumption), then this
way we can still see if we are doing relatively better/worse from release to release.

Reviewers: davide, aprantl, JDevlieghere

Reviewed By: aprantl

Subscribers: abidh

Differential Revision: https://reviews.llvm.org/D76280
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
LLDB keeps statistics of how many expression evaluations are 'successful' and 'failed'
which are updated after each expression evaluation (assuming statistics are enabled).
From what I understand the idea is that this could be used to define how well LLDB's
expression evaluator is working.

Currently all expressions are considered successful unless the user passes an explicit
positive element counting to the expression command (with the `-Z` flag) and then passes
an expression that successfully evaluates to a type that doesn't support element counting.
Expressions that fail to parse, execute or any other outcome are considered successful
at the moment which means we nearly always have a 100% expression evaluation
success rate.

This patch makes that expressions that fail to parse or execute to count as failed
expressions.

We can't know whether the expression failed because of an user error
of because LLDB couldn't correctly parse/compile it, but I would argue that this is
still an improvement. Assuming that the percentage of valid user expressions stays
mostly constant over time (which seems like a reasonable assumption), then this
way we can still see if we are doing relatively better/worse from release to release.

Reviewers: davide, aprantl, JDevlieghere

Reviewed By: aprantl

Subscribers: abidh

Differential Revision: https://reviews.llvm.org/D76280
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Ptrs-&gt;refs in CommandObjectExpression::EvaluateExpression parameters</title>
<updated>2020-03-17T12:23:16+00:00</updated>
<author>
<name>Raphael Isemann</name>
<email>teemperor@gmail.com</email>
</author>
<published>2020-03-17T11:57:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7c6e52ac0ce5a6879331bc3c322dd20bfec3bf14'/>
<id>7c6e52ac0ce5a6879331bc3c322dd20bfec3bf14</id>
<content type='text'>
The error_stream and result parameter were inconsistently checked for
being null, so we might as well make them references instead of crashing
in case someone passes a nullptr and hits one of the code paths that are
currently not doing a nullptr check on those parameters. Also change
output_stream for consistency.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The error_stream and result parameter were inconsistently checked for
being null, so we might as well make them references instead of crashing
in case someone passes a nullptr and hits one of the code paths that are
currently not doing a nullptr check on those parameters. Also change
output_stream for consistency.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFC] Refactor our option generation out of EvaluateExpression</title>
<updated>2020-03-07T02:32:16+00:00</updated>
<author>
<name>Raphael Isemann</name>
<email>teemperor@gmail.com</email>
</author>
<published>2020-03-07T02:27:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8f7c911b58813908da7fa99c7c1a8e7ca1a58213'/>
<id>8f7c911b58813908da7fa99c7c1a8e7ca1a58213</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
