<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.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][DataFormatter][NFC] LibCxxUnorderedMap: remove unused variable (#163226)</title>
<updated>2025-10-14T17:26:02+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-10-14T17:26:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=04d2b5da1ab326fb3fd5220dfefc22a8917c4f0c'/>
<id>04d2b5da1ab326fb3fd5220dfefc22a8917c4f0c</id>
<content type='text'>
Unused since its introduction in
`e2e220a805b143d9bc8544abedff30204dcf6629`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unused since its introduction in
`e2e220a805b143d9bc8544abedff30204dcf6629`.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Fix unordered-map data formatter for const types (#156033)</title>
<updated>2025-09-15T14:19:55+00:00</updated>
<author>
<name>Ebuka Ezike</name>
<email>yerimyah1@gmail.com</email>
</author>
<published>2025-09-15T14:19:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f1a02c681f0d092bb28ac3ff2e79eff11ecb95dc'/>
<id>f1a02c681f0d092bb28ac3ff2e79eff11ecb95dc</id>
<content type='text'>
The test was failing because the const qualifier is not removed when checking if the type is an `unordered_map`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test was failing because the const qualifier is not removed when checking if the type is an `unordered_map`</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DataFormatters] Support newer _LIBCPP_COMPRESSED_PAIR layout (#155153)</title>
<updated>2025-08-25T16:17:55+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-08-25T16:17:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=20dd053160f7d933037aacb69067ef4d77996ba1'/>
<id>20dd053160f7d933037aacb69067ef4d77996ba1</id>
<content type='text'>
Starting with https://github.com/llvm/llvm-project/pull/154686 the
compressed_pair children are now wrapped in an anonymous structure.

This patch adjusts the LLDB data-formatters to support that.

Outstanding questions:
1. Should GetChildMemberWithName look through anonymous structures? That
will break users most likely. But maybe introducing a new API is worth
it? Then we wouldnt have to do this awkward passing around of
`anon_struct_index`
2. Do we support the layout without the anonymous structure? It's not
too much added complexity. And we did release that version of libc++, so
there is code out there compiled against it. But there is no great way
of testing it (some of our macOS matrix bots do test it i suppose, but
not in a targeted way). We have the layout "simulator" tests for some of
the STL types which I will adjust.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Starting with https://github.com/llvm/llvm-project/pull/154686 the
compressed_pair children are now wrapped in an anonymous structure.

This patch adjusts the LLDB data-formatters to support that.

Outstanding questions:
1. Should GetChildMemberWithName look through anonymous structures? That
will break users most likely. But maybe introducing a new API is worth
it? Then we wouldnt have to do this awkward passing around of
`anon_struct_index`
2. Do we support the layout without the anonymous structure? It's not
too much added complexity. And we did release that version of libc++, so
there is code out there compiled against it. But there is no great way
of testing it (some of our macOS matrix bots do test it i suppose, but
not in a targeted way). We have the layout "simulator" tests for some of
the STL types which I will adjust.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DataFormatter] Unwrap reference type when formatting std::unordered_map (#145872)</title>
<updated>2025-06-26T16:10:12+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-06-26T16:10:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aeea062dd43e164889f35c24b98cb1994ead50cb'/>
<id>aeea062dd43e164889f35c24b98cb1994ead50cb</id>
<content type='text'>
Desugar any potential references/typedefs before checking
`isStdTemplate`. Previously, the typename might've been:
```
const std::unordered_map&lt;...&gt; &amp;
```
for references. This patch gets the pointee type before grabbing the
canonical type. `GetNonReferenceType` will unwrap typedefs too, so we
should always end up with a non-reference before we get to
`GetCanonicalType`.

https://github.com/llvm/llvm-project/issues/145847</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Desugar any potential references/typedefs before checking
`isStdTemplate`. Previously, the typename might've been:
```
const std::unordered_map&lt;...&gt; &amp;
```
for references. This patch gets the pointee type before grabbing the
canonical type. `GetNonReferenceType` will unwrap typedefs too, so we
should always end up with a non-reference before we get to
`GetCanonicalType`.

https://github.com/llvm/llvm-project/issues/145847</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][Formatter] Get element type for unordered_maps from __hash_table::value_type (#144517)</title>
<updated>2025-06-17T16:37:27+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-06-17T16:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=382e3fdbb476a5d5771b315daedcd05a15883fbc'/>
<id>382e3fdbb476a5d5771b315daedcd05a15883fbc</id>
<content type='text'>
https://github.com/llvm/llvm-project/pull/143501 changes usage of
`__hash_value_type` in libcxx to an empty tag type. This type will no
longer have a definition in DWARF. Currently the LLDB unordered_map
formatter deduces the map's `element_type` by looking at the `__cc_`
member of `__hash_value_type`. But that will no longer work because we
only have its forward declaration. Since what we're really after is the
type that `__hash_value_type` is wrapping, we can just look at the
`__hash_table::value_type` typedef. With
https://github.com/llvm/llvm-project/pull/143501 that will now point to
the `std::pair` element type (which used to be what we got from
`__cc_`).

TBD: need to double-check this works for older layouts. Quick glance at
the code makes me suspicious of cases like `unordered_map&lt;std::pair&lt;int,
int&gt;, int&gt;`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/pull/143501 changes usage of
`__hash_value_type` in libcxx to an empty tag type. This type will no
longer have a definition in DWARF. Currently the LLDB unordered_map
formatter deduces the map's `element_type` by looking at the `__cc_`
member of `__hash_value_type`. But that will no longer work because we
only have its forward declaration. Since what we're really after is the
type that `__hash_value_type` is wrapping, we can just look at the
`__hash_table::value_type` typedef. With
https://github.com/llvm/llvm-project/pull/143501 that will now point to
the `std::pair` element type (which used to be what we got from
`__cc_`).

TBD: need to double-check this works for older layouts. Quick glance at
the code makes me suspicious of cases like `unordered_map&lt;std::pair&lt;int,
int&gt;, int&gt;`</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DataFormatters] Adjust retrieval of unordered_map element type (#140256)</title>
<updated>2025-05-20T08:44:26+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-05-20T08:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=034eaeddc30cbaf273744580f15325514d5fb928'/>
<id>034eaeddc30cbaf273744580f15325514d5fb928</id>
<content type='text'>
A user ran into an issue where the libc++ `std::unordered_map` formatter
fails because it can't deduce the `element_type`. That happens because
the `node_type` is a forwad declaration. And, in fact, dsymutil stripped
the definition for `std::__1::__hash_node&lt;...&gt;` for a particular
instantiation. While I'm still unclear whether this is a dsymutil bug,
this patch works around said issue by getting the element type from the
`__table_` member.

Drive-by:
- Set the `m_element_type` in `Update`, which is where the other members
are initialized

I don't have a reduced example of this unfortunately. But the crux of
the issue is that `std::__1::__hash_node&lt;...&gt;` only has a forward
declaration in the dsym. Then trying to call `GetTypeTemplateArgument`
on that `CompilerType` fails. And even if the definition was present in
the dsym it seems like we're stopped in a context where the CU only had
a forward declaration DIE for that type and the `node_type` never ends
up being completed with the definition that lives in another CU.

rdar://150813798</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A user ran into an issue where the libc++ `std::unordered_map` formatter
fails because it can't deduce the `element_type`. That happens because
the `node_type` is a forwad declaration. And, in fact, dsymutil stripped
the definition for `std::__1::__hash_node&lt;...&gt;` for a particular
instantiation. While I'm still unclear whether this is a dsymutil bug,
this patch works around said issue by getting the element type from the
`__table_` member.

Drive-by:
- Set the `m_element_type` in `Update`, which is where the other members
are initialized

I don't have a reduced example of this unfortunately. But the crux of
the issue is that `std::__1::__hash_node&lt;...&gt;` only has a forward
declaration in the dsym. Then trying to call `GetTypeTemplateArgument`
on that `CompilerType` fails. And even if the definition was present in
the dsym it seems like we're stopped in a context where the CU only had
a forward declaration DIE for that type and the `node_type` never ends
up being completed with the definition that lives in another CU.

rdar://150813798</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DataFormatters] Change ExtractIndexFromString to return std::optional (#138297)</title>
<updated>2025-05-08T11:21:26+00:00</updated>
<author>
<name>Charles Zablit</name>
<email>c_zablit@apple.com</email>
</author>
<published>2025-05-08T11:21:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0d47a4548c17b320e02e33a1e250792626652e59'/>
<id>0d47a4548c17b320e02e33a1e250792626652e59</id>
<content type='text'>
This PR is in continuation of
https://github.com/llvm/llvm-project/pull/136693.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR is in continuation of
https://github.com/llvm/llvm-project/pull/136693.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Upgrade `GetIndexOfChildWithName` to use `llvm::Expected` (#136693)</title>
<updated>2025-04-30T10:44:19+00:00</updated>
<author>
<name>Charles Zablit</name>
<email>c_zablit@apple.com</email>
</author>
<published>2025-04-30T10:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b3d130279f5c59a82d48d4647bef626ac4e202cf'/>
<id>b3d130279f5c59a82d48d4647bef626ac4e202cf</id>
<content type='text'>
This patch replaces the use of `UINT32_MAX` as the error return value of
`GetIndexOfChildWithName` with `llvm::Expected`.


# Tasks to do in another PR

1. Replace `CalculateNumChildrenIgnoringErrors` with
`CalculateNumChildren`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056319358).
2. Update `lldb_private::formatters::ExtractIndexFromString` to use
`llvm::Expected`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2054217536).
3. Create a new class which carries both user and internal errors. See
[this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056439608).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces the use of `UINT32_MAX` as the error return value of
`GetIndexOfChildWithName` with `llvm::Expected`.


# Tasks to do in another PR

1. Replace `CalculateNumChildrenIgnoringErrors` with
`CalculateNumChildren`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056319358).
2. Update `lldb_private::formatters::ExtractIndexFromString` to use
`llvm::Expected`. See [this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2054217536).
3. Create a new class which carries both user and internal errors. See
[this
comment](https://github.com/llvm/llvm-project/pull/136693#discussion_r2056439608).</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Provide default impl for MightHaveChildren (NFC) (#119977)</title>
<updated>2025-02-17T19:19:14+00:00</updated>
<author>
<name>Dave Lee</name>
<email>davelee.com@gmail.com</email>
</author>
<published>2025-02-17T19:19:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6fde8fe9adc835df50ea57b710781ffe8a6657e8'/>
<id>6fde8fe9adc835df50ea57b710781ffe8a6657e8</id>
<content type='text'>
The vast majority of `SyntheticChildrenFrontEnd` subclasses provide
children, and as such implement `MightHaveChildren` with a constant
value of `true`. This change makes `true` the default value. With this
change, `MightHaveChildren` only needs to be implemented by synthetic
providers that can return `false`, which is only 3 subclasses.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The vast majority of `SyntheticChildrenFrontEnd` subclasses provide
children, and as such implement `MightHaveChildren` with a constant
value of `true`. This change makes `true` the default value. With this
change, `MightHaveChildren` only needs to be implemented by synthetic
providers that can return `false`, which is only 3 subclasses.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Fix std::unordered_* synthetic children when typedefs are used. (#123125)</title>
<updated>2025-01-16T00:30:45+00:00</updated>
<author>
<name>Greg Clayton</name>
<email>gclayton@fb.com</email>
</author>
<published>2025-01-16T00:30:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b7722fbcab4d769be54ae3001f311b2955ef6134'/>
<id>b7722fbcab4d769be54ae3001f311b2955ef6134</id>
<content type='text'>
There was a bug in both the GNU and libc++ library synthetic child
providers when a typedef was used in the type of the variable. Previous
code was looking at the top level typename to try and determine if
std::unordered_ was a map or set and this failed when typedefs were
being used. This patch fixes both C++ library synthetic child providers
with updated tests.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was a bug in both the GNU and libc++ library synthetic child
providers when a typedef was used in the type of the variable. Previous
code was looking at the top level typename to try and determine if
std::unordered_ was a map or set and this failed when typedefs were
being used. This patch fixes both C++ library synthetic child providers
with updated tests.</pre>
</div>
</content>
</entry>
</feed>
