<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/API/SBTypeSummary.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][Formatters] Add --pointer-match-depth option to `type summary add` command. (#138209)</title>
<updated>2025-05-28T20:04:24+00:00</updated>
<author>
<name>Zequan Wu</name>
<email>zequanwu@google.com</email>
</author>
<published>2025-05-28T20:04:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=02916a432ca6465e2e45f67be94f1c89c9cd425d'/>
<id>02916a432ca6465e2e45f67be94f1c89c9cd425d</id>
<content type='text'>
Currently, the type `T`'s summary formatter will be matched for `T`,
`T*`, `T**` and so on. This is unexpected in many data formatters. Such
unhandled cases could cause the data formatter to crash. An example
would be the lldb's built-in data formatter for `std::optional`:
```
$ cat main.cpp
#include &lt;optional&gt;

int main() {
  std::optional&lt;int&gt; o_null;
  auto po_null = &amp;o_null;
  auto ppo_null = &amp;po_null;
  auto pppo_null = &amp;ppo_null;
  return 0;
}
$ clang++ -g main.cpp &amp;&amp; lldb -o "b 8" -o "r" -o "v pppo_null"
[lldb crash]
```

This change adds an options `--pointer-match-depth` to `type summary
add` command to allow users to specify how many layer of pointers can be
dereferenced at most when matching a summary formatter of type `T`, as
Jim suggested
[here](https://github.com/llvm/llvm-project/pull/124048/#issuecomment-2611164133).
By default, this option has value 1 which means summary formatter for
`T` could also be used for `T*` but not `T**` nor beyond. This option is
no-op when `--skip-pointers` is set as well.

I didn't add such option for `type synthetic add`, `type format add`,
`type filter add`, because it useful for those command. Instead, they
all have the pointer match depth of 1. When printing a type `T*`, lldb
never print the children of `T` even if there is a synthetic formatter
registered for `T`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the type `T`'s summary formatter will be matched for `T`,
`T*`, `T**` and so on. This is unexpected in many data formatters. Such
unhandled cases could cause the data formatter to crash. An example
would be the lldb's built-in data formatter for `std::optional`:
```
$ cat main.cpp
#include &lt;optional&gt;

int main() {
  std::optional&lt;int&gt; o_null;
  auto po_null = &amp;o_null;
  auto ppo_null = &amp;po_null;
  auto pppo_null = &amp;ppo_null;
  return 0;
}
$ clang++ -g main.cpp &amp;&amp; lldb -o "b 8" -o "r" -o "v pppo_null"
[lldb crash]
```

This change adds an options `--pointer-match-depth` to `type summary
add` command to allow users to specify how many layer of pointers can be
dereferenced at most when matching a summary formatter of type `T`, as
Jim suggested
[here](https://github.com/llvm/llvm-project/pull/124048/#issuecomment-2611164133).
By default, this option has value 1 which means summary formatter for
`T` could also be used for `T*` but not `T**` nor beyond. This option is
no-op when `--skip-pointers` is set as well.

I didn't add such option for `type synthetic add`, `type format add`,
`type filter add`, because it useful for those command. Instead, they
all have the pointer match depth of 1. When printing a type `T*`, lldb
never print the children of `T` even if there is a synthetic formatter
registered for `T`.</pre>
</div>
</content>
</entry>
<entry>
<title>Reland: [lldb] Implement a formatter bytecode interpreter in C++</title>
<updated>2024-12-11T00:37:53+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2024-12-11T00:37:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=87659a17d0703c1244211d9f8d1f0c21e816f0e1'/>
<id>87659a17d0703c1244211d9f8d1f0c21e816f0e1</id>
<content type='text'>
Compared to the python version, this also does type checking and error
handling, so it's slightly longer, however, it's still comfortably
under 500 lines.

Relanding with more explicit type conversions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compared to the python version, this also does type checking and error
handling, so it's slightly longer, however, it's still comfortably
under 500 lines.

Relanding with more explicit type conversions.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb] Add cast to fix compile error on 32-bit platforms"</title>
<updated>2024-12-10T23:00:44+00:00</updated>
<author>
<name>Sylvestre Ledru</name>
<email>sylvestre@debian.org</email>
</author>
<published>2024-12-10T22:59:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a2fb70523ac310af6d8a4d9663dfe7c9cd370c53'/>
<id>a2fb70523ac310af6d8a4d9663dfe7c9cd370c53</id>
<content type='text'>
This reverts commit f6012a209dca6b1866d00e6b4f96279469884320.

Revert "[lldb] Add cast to fix compile error on 32-but platforms"

This reverts commit d300337e93da4ed96b044557e4b0a30001967cf0.

Revert "[lldb] Improve log message to include missing strings"

This reverts commit 0be33484853557bc0fd9dfb94e0b6c15dda136ce.

Revert "[lldb] Add comment"

This reverts commit e2bb47443d2e5c022c7851dd6029e3869fc8835c.

Revert "[lldb] Implement a formatter bytecode interpreter in C++"

This reverts commit 9a9c1d4a6155a96ce9be494cec7e25731d36b33e.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit f6012a209dca6b1866d00e6b4f96279469884320.

Revert "[lldb] Add cast to fix compile error on 32-but platforms"

This reverts commit d300337e93da4ed96b044557e4b0a30001967cf0.

Revert "[lldb] Improve log message to include missing strings"

This reverts commit 0be33484853557bc0fd9dfb94e0b6c15dda136ce.

Revert "[lldb] Add comment"

This reverts commit e2bb47443d2e5c022c7851dd6029e3869fc8835c.

Revert "[lldb] Implement a formatter bytecode interpreter in C++"

This reverts commit 9a9c1d4a6155a96ce9be494cec7e25731d36b33e.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Implement a formatter bytecode interpreter in C++</title>
<updated>2024-12-10T17:36:38+00:00</updated>
<author>
<name>Adrian Prantl</name>
<email>aprantl@apple.com</email>
</author>
<published>2024-10-29T00:18:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9a9c1d4a6155a96ce9be494cec7e25731d36b33e'/>
<id>9a9c1d4a6155a96ce9be494cec7e25731d36b33e</id>
<content type='text'>
Compared to the python version, this also does type checking and error
handling, so it's slightly longer, however, it's still comfortably
under 500 lines.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compared to the python version, this also does type checking and error
handling, so it's slightly longer, however, it's still comfortably
under 500 lines.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Replace deprecated `std::unique_ptr::unique()` to silence a warning with MS-STL. NFC.</title>
<updated>2024-01-17T12:23:57+00:00</updated>
<author>
<name>Alexandre Ganea</name>
<email>alex_toresh@yahoo.fr</email>
</author>
<published>2024-01-05T14:17:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=47bd76d80fefdcef13a764dbc4c1f7e8320252dd'/>
<id>47bd76d80fefdcef13a764dbc4c1f7e8320252dd</id>
<content type='text'>
MS-STL warns about this with `warning STL4016: std::shared_ptr::unique() is deprecated in C++17`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MS-STL warns about this with `warning STL4016: std::shared_ptr::unique() is deprecated in C++17`.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Guarantee the lifetimes of all strings returned from SBAPI</title>
<updated>2023-05-18T22:13:36+00:00</updated>
<author>
<name>Alex Langford</name>
<email>alangford@apple.com</email>
</author>
<published>2023-05-17T17:44:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=41714c959d65ff1dd842bc0a0d44f90b06440c39'/>
<id>41714c959d65ff1dd842bc0a0d44f90b06440c39</id>
<content type='text'>
LLDB should guarantee that the strings returned by SBAPI methods
live forever. I went through every method that returns a string and made
sure that it was added to the ConstString StringPool before returning if
it wasn't obvious that it was already doing so.
I've also updated the docs to document this behavior.

Differential Revision: https://reviews.llvm.org/D150804
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLDB should guarantee that the strings returned by SBAPI methods
live forever. I went through every method that returns a string and made
sure that it was added to the ConstString StringPool before returning if
it wasn't obvious that it was already doing so.
I've also updated the docs to document this behavior.

Differential Revision: https://reviews.llvm.org/D150804
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Decouple instrumentation from the reproducers</title>
<updated>2022-01-21T02:06:14+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-01-19T19:38:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1755f5b1d7b7871672abdf0fde5ccd091b8dbc04'/>
<id>1755f5b1d7b7871672abdf0fde5ccd091b8dbc04</id>
<content type='text'>
Remove the last remaining references to the reproducers from the
instrumentation. This patch renames the relevant files and macros.

Differential revision: https://reviews.llvm.org/D117712
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the last remaining references to the reproducers from the
instrumentation. This patch renames the relevant files and macros.

Differential revision: https://reviews.llvm.org/D117712
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove LLDB_RECORD_DUMMY_* macros</title>
<updated>2022-01-10T20:05:54+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-01-10T20:05:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da4b7437f932570227b9debecc031a40875445fa'/>
<id>da4b7437f932570227b9debecc031a40875445fa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove LLDB_RECORD_RESULT macro</title>
<updated>2022-01-10T06:54:17+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-01-10T06:54:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d232abc33b707d2da8ca4e4c84d8287ce0e1a47a'/>
<id>d232abc33b707d2da8ca4e4c84d8287ce0e1a47a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove reproducer instrumentation</title>
<updated>2022-01-10T05:40:55+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-01-08T00:26:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d51402ac6b802dbc17402135067d302853b34252'/>
<id>d51402ac6b802dbc17402135067d302853b34252</id>
<content type='text'>
This patch removes most of the reproducer instrumentation. It keeps
around the LLDB_RECORD_* macros for logging. See [1] for more details.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html

Differential revision: https://reviews.llvm.org/D116847
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes most of the reproducer instrumentation. It keeps
around the LLDB_RECORD_* macros for logging. See [1] for more details.

[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html

Differential revision: https://reviews.llvm.org/D116847
</pre>
</div>
</content>
</entry>
</feed>
