<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Commands/CommandCompletions.cpp, branch users/jrtc27/spr/nfcielfmips-refactor-mipsgotsection-to-avoid-explicit-writes</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][NFC] Use IterationAction for ModuleList::ForEach callbacks (#150930)</title>
<updated>2025-07-28T13:35:39+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-07-28T13:35:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c8a091e1b65bcb523c3327b85a2442be61659a87'/>
<id>c8a091e1b65bcb523c3327b85a2442be61659a87</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Add completions for plugin list/enable/disable (#147775)</title>
<updated>2025-07-15T19:44:00+00:00</updated>
<author>
<name>David Peixotto</name>
<email>peix@meta.com</email>
</author>
<published>2025-07-15T19:44:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fccae859bc949ba390184614e07234267a734b86'/>
<id>fccae859bc949ba390184614e07234267a734b86</id>
<content type='text'>
This commit adds completion support for the plugin commands. It will try
to complete partial namespaces to the full namespace string. If the
completion input is already a full namespace string then it will add all
the matching plugins in that namespace as completions.

This lets the user complete to the namespace first and then tab-complete
to the next level if desired.

```
(lldb) plugin list a&lt;tab&gt;
Available completions:
        abi
        architecture
(lldb) plugin list ab&lt;tab&gt;
(lldb) plugin list abi&lt;tab&gt;
(lldb) plugin list abi.&lt;tab&gt;
Available completions:
        abi.SysV-arm64
        abi.ABIMacOSX_arm64
        abi.SysV-arm
        ...
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds completion support for the plugin commands. It will try
to complete partial namespaces to the full namespace string. If the
completion input is already a full namespace string then it will add all
the matching plugins in that namespace as completions.

This lets the user complete to the namespace first and then tab-complete
to the next level if desired.

```
(lldb) plugin list a&lt;tab&gt;
Available completions:
        abi
        architecture
(lldb) plugin list ab&lt;tab&gt;
(lldb) plugin list abi&lt;tab&gt;
(lldb) plugin list abi.&lt;tab&gt;
Available completions:
        abi.SysV-arm64
        abi.ABIMacOSX_arm64
        abi.SysV-arm
        ...
```</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] returning command completions up to a maximum (#135565)</title>
<updated>2025-04-23T22:01:03+00:00</updated>
<author>
<name>Ely Ronnen</name>
<email>elyronnen@gmail.com</email>
</author>
<published>2025-04-23T22:01:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6f5b98b3247969eb85135141bdae4a2d6aeb284a'/>
<id>6f5b98b3247969eb85135141bdae4a2d6aeb284a</id>
<content type='text'>
- Adding `max_return_elements` field to `CompletionRequest`.
- adding maximum checks to `SymbolCompleter` and `SourceFileCompleter`.

Fixes #135553</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Adding `max_return_elements` field to `CompletionRequest`.
- adding maximum checks to `SymbolCompleter` and `SourceFileCompleter`.

Fixes #135553</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Revert "[lldb] Extend frame recognizers to hide frames from backtraces (#104523)""</title>
<updated>2024-08-23T18:06:01+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2024-08-23T16:55:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c0fba4f2471cacb27d787c7d8f54f21d9dcafae'/>
<id>3c0fba4f2471cacb27d787c7d8f54f21d9dcafae</id>
<content type='text'>
This reverts commit 547917aebd1e79a8929b53f0ddf3b5185ee4df74.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 547917aebd1e79a8929b53f0ddf3b5185ee4df74.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb] Extend frame recognizers to hide frames from backtraces (#104523)"</title>
<updated>2024-08-22T11:24:57+00:00</updated>
<author>
<name>Dmitri Gribenko</name>
<email>gribozavr@gmail.com</email>
</author>
<published>2024-08-22T09:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=547917aebd1e79a8929b53f0ddf3b5185ee4df74'/>
<id>547917aebd1e79a8929b53f0ddf3b5185ee4df74</id>
<content type='text'>
This reverts commit f01f80ce6ca7640bb0e267b84b1ed0e89b57e2d9.

This commit introduces an msan violation. See the discussion on https://github.com/llvm/llvm-project/pull/104523.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit f01f80ce6ca7640bb0e267b84b1ed0e89b57e2d9.

This commit introduces an msan violation. See the discussion on https://github.com/llvm/llvm-project/pull/104523.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Extend frame recognizers to hide frames from backtraces (#104523)</title>
<updated>2024-08-20T23:01:22+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2024-08-20T23:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f01f80ce6ca7640bb0e267b84b1ed0e89b57e2d9'/>
<id>f01f80ce6ca7640bb0e267b84b1ed0e89b57e2d9</id>
<content type='text'>
Compilers and language runtimes often use helper functions that are
fundamentally uninteresting when debugging anything but the
compiler/runtime itself. This patch introduces a user-extensible
mechanism that allows for these frames to be hidden from backtraces and
automatically skipped over when navigating the stack with `up` and
`down`.

This does not affect the numbering of frames, so `f &lt;N&gt;` will still
provide access to the hidden frames. The `bt` output will also print a
hint that frames have been hidden.

My primary motivation for this feature is to hide thunks in the Swift
programming language, but I'm including an example recognizer for
`std::function::operator()` that I wished for myself many times while
debugging LLDB.

rdar://126629381


Example output. (Yes, my proof-of-concept recognizer could hide even
more frames if we had a method that returned the function name without
the return type or I used something that isn't based off regex, but it's
really only meant as an example).

before:
```
(lldb) thread backtrace --filtered=false
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x0000000100001f04 a.out`foo(x=1, y=1) at main.cpp:4:10
    frame #1: 0x0000000100003a00 a.out`decltype(std::declval&lt;int (*&amp;)(int, int)&gt;()(std::declval&lt;int&gt;(), std::declval&lt;int&gt;())) std::__1::__invoke[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__f=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:149:25
    frame #2: 0x000000010000399c a.out`int std::__1::__invoke_void_return_wrapper&lt;int, false&gt;::__call[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__args=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:216:12
    frame #3: 0x0000000100003968 a.out`std::__1::__function::__alloc_func&lt;int (*)(int, int), std::__1::allocator&lt;int (*)(int, int)&gt;, int (int, int)&gt;::operator()[abi:se200000](this=0x000000016fdff280, __arg=0x000000016fdff224, __arg=0x000000016fdff220) at function.h:171:12
    frame #4: 0x00000001000026bc a.out`std::__1::__function::__func&lt;int (*)(int, int), std::__1::allocator&lt;int (*)(int, int)&gt;, int (int, int)&gt;::operator()(this=0x000000016fdff278, __arg=0x000000016fdff224, __arg=0x000000016fdff220) at function.h:313:10
    frame #5: 0x0000000100003c38 a.out`std::__1::__function::__value_func&lt;int (int, int)&gt;::operator()[abi:se200000](this=0x000000016fdff278, __args=0x000000016fdff224, __args=0x000000016fdff220) const at function.h:430:12
    frame #6: 0x0000000100002038 a.out`std::__1::function&lt;int (int, int)&gt;::operator()(this= Function = foo(int, int) , __arg=1, __arg=1) const at function.h:989:10
    frame #7: 0x0000000100001f64 a.out`main(argc=1, argv=0x000000016fdff4f8) at main.cpp:9:10
    frame #8: 0x0000000183cdf154 dyld`start + 2476
(lldb) 
```

after

```
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x0000000100001f04 a.out`foo(x=1, y=1) at main.cpp:4:10
    frame #1: 0x0000000100003a00 a.out`decltype(std::declval&lt;int (*&amp;)(int, int)&gt;()(std::declval&lt;int&gt;(), std::declval&lt;int&gt;())) std::__1::__invoke[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__f=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:149:25
    frame #2: 0x000000010000399c a.out`int std::__1::__invoke_void_return_wrapper&lt;int, false&gt;::__call[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__args=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:216:12
    frame #6: 0x0000000100002038 a.out`std::__1::function&lt;int (int, int)&gt;::operator()(this= Function = foo(int, int) , __arg=1, __arg=1) const at function.h:989:10
    frame #7: 0x0000000100001f64 a.out`main(argc=1, argv=0x000000016fdff4f8) at main.cpp:9:10
    frame #8: 0x0000000183cdf154 dyld`start + 2476
Note: Some frames were hidden by frame recognizers
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compilers and language runtimes often use helper functions that are
fundamentally uninteresting when debugging anything but the
compiler/runtime itself. This patch introduces a user-extensible
mechanism that allows for these frames to be hidden from backtraces and
automatically skipped over when navigating the stack with `up` and
`down`.

This does not affect the numbering of frames, so `f &lt;N&gt;` will still
provide access to the hidden frames. The `bt` output will also print a
hint that frames have been hidden.

My primary motivation for this feature is to hide thunks in the Swift
programming language, but I'm including an example recognizer for
`std::function::operator()` that I wished for myself many times while
debugging LLDB.

rdar://126629381


Example output. (Yes, my proof-of-concept recognizer could hide even
more frames if we had a method that returned the function name without
the return type or I used something that isn't based off regex, but it's
really only meant as an example).

before:
```
(lldb) thread backtrace --filtered=false
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x0000000100001f04 a.out`foo(x=1, y=1) at main.cpp:4:10
    frame #1: 0x0000000100003a00 a.out`decltype(std::declval&lt;int (*&amp;)(int, int)&gt;()(std::declval&lt;int&gt;(), std::declval&lt;int&gt;())) std::__1::__invoke[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__f=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:149:25
    frame #2: 0x000000010000399c a.out`int std::__1::__invoke_void_return_wrapper&lt;int, false&gt;::__call[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__args=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:216:12
    frame #3: 0x0000000100003968 a.out`std::__1::__function::__alloc_func&lt;int (*)(int, int), std::__1::allocator&lt;int (*)(int, int)&gt;, int (int, int)&gt;::operator()[abi:se200000](this=0x000000016fdff280, __arg=0x000000016fdff224, __arg=0x000000016fdff220) at function.h:171:12
    frame #4: 0x00000001000026bc a.out`std::__1::__function::__func&lt;int (*)(int, int), std::__1::allocator&lt;int (*)(int, int)&gt;, int (int, int)&gt;::operator()(this=0x000000016fdff278, __arg=0x000000016fdff224, __arg=0x000000016fdff220) at function.h:313:10
    frame #5: 0x0000000100003c38 a.out`std::__1::__function::__value_func&lt;int (int, int)&gt;::operator()[abi:se200000](this=0x000000016fdff278, __args=0x000000016fdff224, __args=0x000000016fdff220) const at function.h:430:12
    frame #6: 0x0000000100002038 a.out`std::__1::function&lt;int (int, int)&gt;::operator()(this= Function = foo(int, int) , __arg=1, __arg=1) const at function.h:989:10
    frame #7: 0x0000000100001f64 a.out`main(argc=1, argv=0x000000016fdff4f8) at main.cpp:9:10
    frame #8: 0x0000000183cdf154 dyld`start + 2476
(lldb) 
```

after

```
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x0000000100001f04 a.out`foo(x=1, y=1) at main.cpp:4:10
    frame #1: 0x0000000100003a00 a.out`decltype(std::declval&lt;int (*&amp;)(int, int)&gt;()(std::declval&lt;int&gt;(), std::declval&lt;int&gt;())) std::__1::__invoke[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__f=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:149:25
    frame #2: 0x000000010000399c a.out`int std::__1::__invoke_void_return_wrapper&lt;int, false&gt;::__call[abi:se200000]&lt;int (*&amp;)(int, int), int, int&gt;(__args=0x000000016fdff280, __args=0x000000016fdff224, __args=0x000000016fdff220) at invoke.h:216:12
    frame #6: 0x0000000100002038 a.out`std::__1::function&lt;int (int, int)&gt;::operator()(this= Function = foo(int, int) , __arg=1, __arg=1) const at function.h:989:10
    frame #7: 0x0000000100001f64 a.out`main(argc=1, argv=0x000000016fdff4f8) at main.cpp:9:10
    frame #8: 0x0000000183cdf154 dyld`start + 2476
Note: Some frames were hidden by frame recognizers
```</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Fix module name tab completion (#93458)</title>
<updated>2024-05-30T07:57:13+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2024-05-30T07:57:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d554f2379b427505907ba52b8b9270c0b436224f'/>
<id>d554f2379b427505907ba52b8b9270c0b436224f</id>
<content type='text'>
Module names can be matched either by a full path or just their
basename. The completion machinery tried to do both, but had several
bugs:
- it always inserted the basename as a completion candidate, even if the
string being completed was a full path
- due to FileSpec canonicalization, it lost information about trailing
slashes (it treated "lib/&lt;TAB&gt;" as "lib&lt;TAB&gt;", even though it's clear
the former was trying to complete a directory name)
- due to both of the previous issues, the completion candidates could
end up being shorter than the string being completed, which caused
crashes (string out of range errors) when attempting to substitute the
results.

This patch rewrites to logic to remove these kinds of issues:
- basename and full path completion are handled separately
- full path completion is attempted always, basename only if the input
string does not contain a slash
- the code remembers both the canonical and original spelling or the
completed argument. The canonical arg is used for matching, while the
original spelling is used for completion. This way "/foo///.//b&lt;TAB&gt;"
can still match "/foo/bar", but it will complete to "/foo///.//bar".</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Module names can be matched either by a full path or just their
basename. The completion machinery tried to do both, but had several
bugs:
- it always inserted the basename as a completion candidate, even if the
string being completed was a full path
- due to FileSpec canonicalization, it lost information about trailing
slashes (it treated "lib/&lt;TAB&gt;" as "lib&lt;TAB&gt;", even though it's clear
the former was trying to complete a directory name)
- due to both of the previous issues, the completion candidates could
end up being shorter than the string being completed, which caused
crashes (string out of range errors) when attempting to substitute the
results.

This patch rewrites to logic to remove these kinds of issues:
- basename and full path completion are handled separately
- full path completion is attempted always, basename only if the input
string does not contain a slash
- the code remembers both the canonical and original spelling or the
completed argument. The canonical arg is used for matching, while the
original spelling is used for completion. This way "/foo///.//b&lt;TAB&gt;"
can still match "/foo/bar", but it will complete to "/foo///.//bar".</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>Add option to pass thread ID to thread select command (#73596)</title>
<updated>2023-12-14T23:19:38+00:00</updated>
<author>
<name>Michael Christensen</name>
<email>chmdko@gmail.com</email>
</author>
<published>2023-12-14T23:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=405194257506685ca11848fbaff79c4333c18c3b'/>
<id>405194257506685ca11848fbaff79c4333c18c3b</id>
<content type='text'>
We'd like a way to select the current thread by its thread ID (rather
than its internal LLDB thread index).

This PR adds a `-t` option (`--thread_id` long option) that tells the
`thread select` command to interpret the `&lt;thread-index&gt;` argument as a
thread ID.

Here's an example of it working:
```
michristensen@devbig356 llvm/llvm-project (thread-select-tid) » ../Debug/bin/lldb ~/scratch/cpp/threading/a.out
(lldb) target create "/home/michristensen/scratch/cpp/threading/a.out"
Current executable set to '/home/michristensen/scratch/cpp/threading/a.out' (x86_64).
(lldb) b 18
Breakpoint 1: where = a.out`main + 80 at main.cpp:18:12, address = 0x0000000000000850
(lldb) run
Process 215715 launched: '/home/michristensen/scratch/cpp/threading/a.out' (x86_64)
This is a thread, i=1
This is a thread, i=2
This is a thread, i=3
This is a thread, i=4
This is a thread, i=5
Process 215715 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555400850 a.out`main at main.cpp:18:12
   15     for (int i = 0; i &lt; 5; i++) {
   16       pthread_create(&amp;thread_ids[i], NULL, foo, NULL);
   17     }
-&gt; 18     for (int i = 0; i &lt; 5; i++) {
   19       pthread_join(thread_ids[i], NULL);
   20     }
   21     return 0;
(lldb) thread select 2
* thread #2, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread info
thread #2: tid = 216047, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'

(lldb) thread list
Process 215715 stopped
  thread #1: tid = 215715, 0x0000555555400850 a.out`main at main.cpp:18:12, name = 'a.out', stop reason = breakpoint 1.1
* thread #2: tid = 216047, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #3: tid = 216048, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #4: tid = 216049, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #5: tid = 216050, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #6: tid = 216051, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
(lldb) thread select 215715
error: invalid thread #215715.
(lldb) thread select -t 215715
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555400850 a.out`main at main.cpp:18:12
   15     for (int i = 0; i &lt; 5; i++) {
   16       pthread_create(&amp;thread_ids[i], NULL, foo, NULL);
   17     }
-&gt; 18     for (int i = 0; i &lt; 5; i++) {
   19       pthread_join(thread_ids[i], NULL);
   20     }
   21     return 0;
(lldb) thread select -t 216051
* thread #6, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread select 3
* thread #3, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread select -t 216048
* thread #3, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread select --thread_id 216048
* thread #3, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) help thread select
Change the currently selected thread.

Syntax: thread select &lt;cmd-options&gt; &lt;thread-index&gt;

Command Options Usage:
  thread select [-t] &lt;thread-index&gt;

       -t ( --thread_id )
            Provide a thread ID instead of a thread index.

     This command takes options and free-form arguments.  If your arguments
     resemble option specifiers (i.e., they start with a - or --), you must use
     ' -- ' between the end of the command options and the beginning of the
     arguments.
(lldb) c
Process 215715 resuming
Process 215715 exited with status = 0 (0x00000000)
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We'd like a way to select the current thread by its thread ID (rather
than its internal LLDB thread index).

This PR adds a `-t` option (`--thread_id` long option) that tells the
`thread select` command to interpret the `&lt;thread-index&gt;` argument as a
thread ID.

Here's an example of it working:
```
michristensen@devbig356 llvm/llvm-project (thread-select-tid) » ../Debug/bin/lldb ~/scratch/cpp/threading/a.out
(lldb) target create "/home/michristensen/scratch/cpp/threading/a.out"
Current executable set to '/home/michristensen/scratch/cpp/threading/a.out' (x86_64).
(lldb) b 18
Breakpoint 1: where = a.out`main + 80 at main.cpp:18:12, address = 0x0000000000000850
(lldb) run
Process 215715 launched: '/home/michristensen/scratch/cpp/threading/a.out' (x86_64)
This is a thread, i=1
This is a thread, i=2
This is a thread, i=3
This is a thread, i=4
This is a thread, i=5
Process 215715 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555400850 a.out`main at main.cpp:18:12
   15     for (int i = 0; i &lt; 5; i++) {
   16       pthread_create(&amp;thread_ids[i], NULL, foo, NULL);
   17     }
-&gt; 18     for (int i = 0; i &lt; 5; i++) {
   19       pthread_join(thread_ids[i], NULL);
   20     }
   21     return 0;
(lldb) thread select 2
* thread #2, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread info
thread #2: tid = 216047, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'

(lldb) thread list
Process 215715 stopped
  thread #1: tid = 215715, 0x0000555555400850 a.out`main at main.cpp:18:12, name = 'a.out', stop reason = breakpoint 1.1
* thread #2: tid = 216047, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #3: tid = 216048, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #4: tid = 216049, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #5: tid = 216050, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
  thread #6: tid = 216051, 0x00007ffff68f9918 libc.so.6`__nanosleep + 72, name = 'a.out'
(lldb) thread select 215715
error: invalid thread #215715.
(lldb) thread select -t 215715
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555400850 a.out`main at main.cpp:18:12
   15     for (int i = 0; i &lt; 5; i++) {
   16       pthread_create(&amp;thread_ids[i], NULL, foo, NULL);
   17     }
-&gt; 18     for (int i = 0; i &lt; 5; i++) {
   19       pthread_join(thread_ids[i], NULL);
   20     }
   21     return 0;
(lldb) thread select -t 216051
* thread #6, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread select 3
* thread #3, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread select -t 216048
* thread #3, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) thread select --thread_id 216048
* thread #3, name = 'a.out'
    frame #0: 0x00007ffff68f9918 libc.so.6`__nanosleep + 72
libc.so.6`__nanosleep:
-&gt;  0x7ffff68f9918 &lt;+72&gt;: cmpq   $-0x1000, %rax ; imm = 0xF000
    0x7ffff68f991e &lt;+78&gt;: ja     0x7ffff68f9952 ; &lt;+130&gt;
    0x7ffff68f9920 &lt;+80&gt;: movl   %edx, %edi
    0x7ffff68f9922 &lt;+82&gt;: movl   %eax, 0xc(%rsp)
(lldb) help thread select
Change the currently selected thread.

Syntax: thread select &lt;cmd-options&gt; &lt;thread-index&gt;

Command Options Usage:
  thread select [-t] &lt;thread-index&gt;

       -t ( --thread_id )
            Provide a thread ID instead of a thread index.

     This command takes options and free-form arguments.  If your arguments
     resemble option specifiers (i.e., they start with a - or --), you must use
     ' -- ' between the end of the command options and the beginning of the
     arguments.
(lldb) c
Process 215715 resuming
Process 215715 exited with status = 0 (0x00000000)
```</pre>
</div>
</content>
</entry>
<entry>
<title>[ADT] Rename SmallString::{starts,ends}with to {starts,ends}_with (#74916)</title>
<updated>2023-12-09T22:28:45+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-12-09T22:28:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cc4ecfd68b79a44f101fe9924d088a83477797c0'/>
<id>cc4ecfd68b79a44f101fe9924d088a83477797c0</id>
<content type='text'>
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20.  Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch renames {starts,ends}with to {starts,ends}_with for
consistency with std::{string,string_view}::{starts,ends}_with in
C++20.  Since there are only a handful of occurrences, this patch
skips the deprecation phase and simply renames them.</pre>
</div>
</content>
</entry>
</feed>
