<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Interpreter/CommandAlias.cpp, 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>[lldb] Use llvm::Error instead of CommandReturnObject for error reporting (#125125)</title>
<updated>2025-01-31T21:23:26+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-01-31T21:23:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6deee0d5b36c8b4b83209759df8d4933e4922bc8'/>
<id>6deee0d5b36c8b4b83209759df8d4933e4922bc8</id>
<content type='text'>
Use `llvm::Error` instead of `CommandReturnObject` for error reporting.
The command return objects were populated with errors but never
displayed. With this patch they're at least logged.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use `llvm::Error` instead of `CommandReturnObject` for error reporting.
The command return objects were populated with errors but never
displayed. With this patch they're at least logged.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Use StringRef::{starts,ends}_with (NFC)</title>
<updated>2023-12-16T22:39:37+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-12-16T22:39:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=744f38913fa380580431df0ae89ef5fb3df30240'/>
<id>744f38913fa380580431df0ae89ef5fb3df30240</id>
<content type='text'>
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Part 1 of 2 - Refactor `CommandObject::Execute(...)` return `void` (not `bool`) (#69989)</title>
<updated>2023-10-25T22:55:27+00:00</updated>
<author>
<name>Pete Lawrence</name>
<email>plawrence@apple.com</email>
</author>
<published>2023-10-25T22:55:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=463a02bc2260d01ac9e8457792bb455e48097ce5'/>
<id>463a02bc2260d01ac9e8457792bb455e48097ce5</id>
<content type='text'>
[lldb] Part 1 of 2 - Refactor `CommandObject::Execute(...)` 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 2 refactors the `CommandObject::DoExecute(...)` method.
- See
[https://github.com/llvm/llvm-project/pull/69991](https://github.com/llvm/llvm-project/pull/69991)

rdar://117378957</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[lldb] Part 1 of 2 - Refactor `CommandObject::Execute(...)` 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 2 refactors the `CommandObject::DoExecute(...)` method.
- See
[https://github.com/llvm/llvm-project/pull/69991](https://github.com/llvm/llvm-project/pull/69991)

rdar://117378957</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Prevent mutation of CommandAlias::GetOptionArguments</title>
<updated>2023-05-08T16:45:26+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2023-05-07T23:51:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=765237779ce4dbb60f4faf9ebc91386ce5218e15'/>
<id>765237779ce4dbb60f4faf9ebc91386ce5218e15</id>
<content type='text'>
Fix a mutation of `CommandAlias::m_option_args_sp`, which resulted in cases where
aliases would fail to run on second, and subsequent times.

For example, an alias such as:

```
command alias p1 p 1
```

When run the second time, the following error would be reported to the user:

```
error: expression failed to parse:
error: &lt;user expression 1&gt;:1:1: expression is not assignable
--  1
^   ~
```

To fix this, `CommandAlias::Desugar` now constructs options to a freshly constructed
vector, rather than by appending to the results of `GetOptionArguments`.

rdar://107770836

Differential Revision: https://reviews.llvm.org/D150078
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a mutation of `CommandAlias::m_option_args_sp`, which resulted in cases where
aliases would fail to run on second, and subsequent times.

For example, an alias such as:

```
command alias p1 p 1
```

When run the second time, the following error would be reported to the user:

```
error: expression failed to parse:
error: &lt;user expression 1&gt;:1:1: expression is not assignable
--  1
^   ~
```

To fix this, `CommandAlias::Desugar` now constructs options to a freshly constructed
vector, rather than by appending to the results of `GetOptionArguments`.

rdar://107770836

Differential Revision: https://reviews.llvm.org/D150078
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Revert "Be more careful to maintain quoting information when parsing commands.""</title>
<updated>2022-09-14T21:49:51+00:00</updated>
<author>
<name>Jim Ingham</name>
<email>jingham@apple.com</email>
</author>
<published>2022-09-14T19:45:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f3d0bda5344e8429121cb50aba5502c1b399e5cd'/>
<id>f3d0bda5344e8429121cb50aba5502c1b399e5cd</id>
<content type='text'>
    This reverts commit ac05bc0524c66c74278b26742896a4c634c034cf.

I had incorrectly removed one set of checks in the option handling in
Options::ParseAlias because I couldn't see what it is for.  It was a
bit obscure, but it handled the case where you pass "-something=other --"
as the input_line, which caused the built-in "run" alias not to return
the right value for IsDashDashCommand, causing TestHelp.py to fail.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    This reverts commit ac05bc0524c66c74278b26742896a4c634c034cf.

I had incorrectly removed one set of checks in the option handling in
Options::ParseAlias because I couldn't see what it is for.  It was a
bit obscure, but it handled the case where you pass "-something=other --"
as the input_line, which caused the built-in "run" alias not to return
the right value for IsDashDashCommand, causing TestHelp.py to fail.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Be more careful to maintain quoting information when parsing commands."</title>
<updated>2022-09-13T21:59:21+00:00</updated>
<author>
<name>Jim Ingham</name>
<email>jingham@apple.com</email>
</author>
<published>2022-09-13T21:59:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ac05bc0524c66c74278b26742896a4c634c034cf'/>
<id>ac05bc0524c66c74278b26742896a4c634c034cf</id>
<content type='text'>
This reverts commit 6c089b2af5d8d98f66b27b67f70958f520820a76.

This was causing the test test_help_run_hides_options from TestHelp.py to
fail on Linux and Windows (but the test succeeds on macOS).  The decision
to print option information is determined by CommandObjectAlias::IsDashDashCommand
which was changed, but only by replacing an inline string constant with a const char *
CommandInterpreter::g_argument which has the same string value.  I can't see why this
would fail, I'll have to spin up a vm to see if I can repo there.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 6c089b2af5d8d98f66b27b67f70958f520820a76.

This was causing the test test_help_run_hides_options from TestHelp.py to
fail on Linux and Windows (but the test succeeds on macOS).  The decision
to print option information is determined by CommandObjectAlias::IsDashDashCommand
which was changed, but only by replacing an inline string constant with a const char *
CommandInterpreter::g_argument which has the same string value.  I can't see why this
would fail, I'll have to spin up a vm to see if I can repo there.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Trying to understand the TestHelp.py failure from 6c089b2."</title>
<updated>2022-09-13T21:58:27+00:00</updated>
<author>
<name>Jim Ingham</name>
<email>jingham@apple.com</email>
</author>
<published>2022-09-13T21:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3f23eb6591bb1eecae38019e8ab1fdf5e2951ae9'/>
<id>3f23eb6591bb1eecae38019e8ab1fdf5e2951ae9</id>
<content type='text'>
It didn't help.

This reverts commit 81f8788528886ee611041e1f4ee54eea8bbfa277.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It didn't help.

This reverts commit 81f8788528886ee611041e1f4ee54eea8bbfa277.
</pre>
</div>
</content>
</entry>
<entry>
<title>Trying to understand the TestHelp.py failure from 6c089b2.</title>
<updated>2022-09-13T21:09:44+00:00</updated>
<author>
<name>Jim Ingham</name>
<email>jingham@apple.com</email>
</author>
<published>2022-09-13T21:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=81f8788528886ee611041e1f4ee54eea8bbfa277'/>
<id>81f8788528886ee611041e1f4ee54eea8bbfa277</id>
<content type='text'>
Sadly, the test passes on macOS, but fails on Ubuntu &amp; Win.  The
extra option printing is supposed to be suppressed by the return
from CommandObjectAlias::IsDashDashCommand.  That was changed, but just
by replacing an inline string compare with a const string from
CommandInterpreter.  Putting the old version back temporarily to
see if that is really the problem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sadly, the test passes on macOS, but fails on Ubuntu &amp; Win.  The
extra option printing is supposed to be suppressed by the return
from CommandObjectAlias::IsDashDashCommand.  That was changed, but just
by replacing an inline string compare with a const string from
CommandInterpreter.  Putting the old version back temporarily to
see if that is really the problem.
</pre>
</div>
</content>
</entry>
<entry>
<title>Be more careful to maintain quoting information when parsing commands.</title>
<updated>2022-09-13T18:02:47+00:00</updated>
<author>
<name>Jim Ingham</name>
<email>jingham@apple.com</email>
</author>
<published>2022-08-31T17:13:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6c089b2af5d8d98f66b27b67f70958f520820a76'/>
<id>6c089b2af5d8d98f66b27b67f70958f520820a76</id>
<content type='text'>
This is particularly a problem for alias construction, where you might
want to have a backtick surrounded option in the alias.  Before this
patch:

command alias expression -Z \`argc\` -- argv

for instance would be rendered as:

expression -Z argc -- argv

and would fail to work.

Differential Revision: https://reviews.llvm.org/D133045
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is particularly a problem for alias construction, where you might
want to have a backtick surrounded option in the alias.  Before this
patch:

command alias expression -Z \`argc\` -- argv

for instance would be rendered as:

expression -Z argc -- argv

and would fail to work.

Differential Revision: https://reviews.llvm.org/D133045
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove redundant calls to set eReturnStatusFailed</title>
<updated>2021-06-17T11:21:54+00:00</updated>
<author>
<name>David Spickett</name>
<email>david.spickett@linaro.org</email>
</author>
<published>2021-06-16T12:56:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd'/>
<id>7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd</id>
<content type='text'>
Since https://reviews.llvm.org/D103701 AppendError&lt;...&gt;
sets this for you.

This change includes all of the non-command uses.

Some uses remain where it's either tricky to reason about
the logic, or they aren't paired with AppendError calls.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104379
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since https://reviews.llvm.org/D103701 AppendError&lt;...&gt;
sets this for you.

This change includes all of the non-command uses.

Some uses remain where it's either tricky to reason about
the logic, or they aren't paired with AppendError calls.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104379
</pre>
</div>
</content>
</entry>
</feed>
