<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.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] Add libstdcpp initializer_list formatter (#167515)</title>
<updated>2025-11-13T14:57:23+00:00</updated>
<author>
<name>Ebuka Ezike</name>
<email>yerimyah1@gmail.com</email>
</author>
<published>2025-11-13T14:57:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=94fb85646daf2b4cea55410ba15960339d2d58b5'/>
<id>94fb85646daf2b4cea55410ba15960339d2d58b5</id>
<content type='text'>
Make the existing libc++ formatter generic
Add initializer_list summary provider.
Add test for `libstdcpp`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the existing libc++ formatter generic
Add initializer_list summary provider.
Add test for `libstdcpp`</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][Language] Pass SymbolNameFitsToLanguage parameter by const-ref (#167684)</title>
<updated>2025-11-12T14:05:59+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-11-12T14:05:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0f4dc93608059469df7606b4bd0b2834f9035d54'/>
<id>0f4dc93608059469df7606b4bd0b2834f9035d54</id>
<content type='text'>
We've been seeing (rare) crashes from both
`CPlusPlusLanguage::SymbolNameFitsToLanguage` and
`ObjCLanguage::SymbolNameFitsToLanguage` when we try to read contents of
the `ConstString`s of the `Mangled` parameter. I'm not entirely sure how
that can happen (current theory is corrupted stack somehow which
overwrites `ConstString::m_string` to an invalid pointer) but I'm not
able to confirm that.

One thing these crashes had in common is that they operate on the
`Mangled` object we copied into `SymbolNameFitsToLanguage` by value.
While I can't see off the top why that would cause it to contain
unintiailized/corrupt `ConstString`s, the class is sufficiently large
enough to probably pass it by `const &amp;` anyway. This is what this patch
does.

rdar://164519648</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've been seeing (rare) crashes from both
`CPlusPlusLanguage::SymbolNameFitsToLanguage` and
`ObjCLanguage::SymbolNameFitsToLanguage` when we try to read contents of
the `ConstString`s of the `Mangled` parameter. I'm not entirely sure how
that can happen (current theory is corrupted stack somehow which
overwrites `ConstString::m_string` to an invalid pointer) but I'm not
able to confirm that.

One thing these crashes had in common is that they operate on the
`Mangled` object we copied into `SymbolNameFitsToLanguage` by value.
While I can't see off the top why that would cause it to contain
unintiailized/corrupt `ConstString`s, the class is sufficiently large
enough to probably pass it by `const &amp;` anyway. This is what this patch
does.

rdar://164519648</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][CPlusPlusLanguage] Avoid redundant const char* -&gt; StringRef roundtrip (#161499)</title>
<updated>2025-10-01T12:07:21+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-10-01T12:07:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a96d19ab01a4b5d992f492233f6a21d1e7cc4e0'/>
<id>2a96d19ab01a4b5d992f492233f6a21d1e7cc4e0</id>
<content type='text'>
We've been seen (very sporadic) lifetime issues around this area. Here's
an example backtrace:
```
[  8] 0x0000000188e56743 libsystem_platform.dylib`_sigtramp + 55
[  9] 0x00000001181e041f LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] unsigned long std::1::constexpr_strlen[abi:nn200100]&lt;char&gt;(char const*) + 7 at constexpr_c_functions.h:63:10
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] std::__1::char_traits&lt;char&gt;::length[abi:nn200100](char const*) at char_traits.h:232:12
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] llvm::StringRef::StringRef(char const*) at StringRef.h:90:33
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] llvm::StringRef::StringRef(char const*) at StringRef.h:92:38
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const + 20 at CPlusPlusLanguage.cpp:68:62
```

Looks like we're calling `strlen` on a nullptr. I stared at this
codepath for a while but am still not sure how that could happen unless
the underlying `ConstString` somehow pointed to corrupted data.

But `SymbolNameFitsToLanguage` does some roundtripping through a `const
char*` before calling `GetManglingScheme`. No other callsite does this
and it just seems redundant.

This patch cleans this up.

rdar://161128180</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've been seen (very sporadic) lifetime issues around this area. Here's
an example backtrace:
```
[  8] 0x0000000188e56743 libsystem_platform.dylib`_sigtramp + 55
[  9] 0x00000001181e041f LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] unsigned long std::1::constexpr_strlen[abi:nn200100]&lt;char&gt;(char const*) + 7 at constexpr_c_functions.h:63:10
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] std::__1::char_traits&lt;char&gt;::length[abi:nn200100](char const*) at char_traits.h:232:12
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] llvm::StringRef::StringRef(char const*) at StringRef.h:90:33
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const [inlined] llvm::StringRef::StringRef(char const*) at StringRef.h:92:38
[  9] 0x00000001181e0418 LLDB`lldb_private::CPlusPlusLanguage::SymbolNameFitsToLanguage(lldb_private::Mangled) const + 20 at CPlusPlusLanguage.cpp:68:62
```

Looks like we're calling `strlen` on a nullptr. I stared at this
codepath for a while but am still not sure how that could happen unless
the underlying `ConstString` somehow pointed to corrupted data.

But `SymbolNameFitsToLanguage` does some roundtripping through a `const
char*` before calling `GetManglingScheme`. No other callsite does this
and it just seems redundant.

This patch cleans this up.

rdar://161128180</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Add unreachable after fully covered switches, avoid GCC warnings. NFC. (#159327)</title>
<updated>2025-09-17T17:34:30+00:00</updated>
<author>
<name>Martin Storsjö</name>
<email>martin@martin.st</email>
</author>
<published>2025-09-17T17:34:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4ff113f0aa906b130cd19d2a2a61a477c336c315'/>
<id>4ff113f0aa906b130cd19d2a2a61a477c336c315</id>
<content type='text'>
This avoids the following kind of warning with GCC:

    warning: control reaches end of non-void function [-Wreturn-type]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This avoids the following kind of warning with GCC:

    warning: control reaches end of non-void function [-Wreturn-type]</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Fixed UB in CPlusPlusLanguage plug-in (#158304)</title>
<updated>2025-09-12T16:56:21+00:00</updated>
<author>
<name>Dmitry Vasilyev</name>
<email>dvassiliev@accesssoftek.com</email>
</author>
<published>2025-09-12T16:56:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a848008e1996f8934dee0a297975ac0e6b4200ec'/>
<id>a848008e1996f8934dee0a297975ac0e6b4200ec</id>
<content type='text'>
C++11 allows the use of Universal Character Names (UCNs) in identifiers,
including function names.

According to the spec the behavior of std::isalpha(ch) and
std::isalnum(ch) is undefined if the argument's value is neither
representable as unsigned char nor equal to EOF. To use these functions
safely with plain chars (or signed chars), the argument should first be
converted to unsigned char.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C++11 allows the use of Universal Character Names (UCNs) in identifiers,
including function names.

According to the spec the behavior of std::isalpha(ch) and
std::isalnum(ch) is undefined if the argument's value is neither
representable as unsigned char nor equal to EOF. To use these functions
safely with plain chars (or signed chars), the argument should first be
converted to unsigned char.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DataFormatter] Allow std::string formatters to match against custom allocators (#156050)</title>
<updated>2025-09-05T08:24:50+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-09-05T08:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4b362f152e58abd6aeed5d603a6dfc10115ed1ab'/>
<id>4b362f152e58abd6aeed5d603a6dfc10115ed1ab</id>
<content type='text'>
This came up in https://github.com/llvm/llvm-project/issues/155691.

For `std::basic_string` our formatter matching logic required the
allocator template parameter to be a `std::allocator`. There is no
compelling reason (that I know of) why this would be required for us to
apply the existing formatter to the string. We don't check the
`allocator` parameter for other STL containers either. This meant that
`std::string` that used custom allocators wouldn't be formatted. This
patch relaxes the regex for `basic_string`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This came up in https://github.com/llvm/llvm-project/issues/155691.

For `std::basic_string` our formatter matching logic required the
allocator template parameter to be a `std::allocator`. There is no
compelling reason (that I know of) why this would be required for us to
apply the existing formatter to the string. We don't check the
`allocator` parameter for other STL containers either. This meant that
`std::string` that used custom allocators wouldn't be formatted. This
patch relaxes the regex for `basic_string`.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][CPlusPlusLanguage] Expose ManglingSubstitutor as static helpers (#155483)</title>
<updated>2025-08-27T12:46:39+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-08-27T12:46:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9dd38b0ed06db1da46b142fe9e0a142b5c11ac58'/>
<id>9dd38b0ed06db1da46b142fe9e0a142b5c11ac58</id>
<content type='text'>
Part of https://github.com/llvm/llvm-project/pull/149827

Allows us to use the mangling substitution facilities in
CPlusPlusLanguage but also SymbolFileDWARF.

Added tests now that they're "public".</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part of https://github.com/llvm/llvm-project/pull/149827

Allows us to use the mangling substitution facilities in
CPlusPlusLanguage but also SymbolFileDWARF.

Added tests now that they're "public".</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Fix CXX's SymbolNameFitsToLanguage matching other languages (#153685)</title>
<updated>2025-08-15T19:30:21+00:00</updated>
<author>
<name>Augusto Noronha</name>
<email>anoronha@apple.com</email>
</author>
<published>2025-08-15T19:30:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c6ea7d72d12073c63681bca998a87b4a436a9dff'/>
<id>c6ea7d72d12073c63681bca998a87b4a436a9dff</id>
<content type='text'>
The current implementation of
CPlusPlusLanguage::SymbolNameFitsToLanguage will return true if the
symbol is mangled for any language that lldb knows about.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current implementation of
CPlusPlusLanguage::SymbolNameFitsToLanguage will return true if the
symbol is mangled for any language that lldb knows about.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][Mangled] Move SuffixRange computation into TrackingOutputBuffer (#152483)</title>
<updated>2025-08-07T13:39:52+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-08-07T13:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fac7453d2ca7ebe33dec3d60211c0374a2bb69cd'/>
<id>fac7453d2ca7ebe33dec3d60211c0374a2bb69cd</id>
<content type='text'>
This way all the tracking is self-contained in `TrackingOutputBuffer`
and we can test the `SuffixRange` properly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This way all the tracking is self-contained in `TrackingOutputBuffer`
and we can test the `SuffixRange` properly.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][CPlusPlusLanguage] Create public accessors for getting DemangledNameInfo components and use them in tests (#152134)</title>
<updated>2025-08-05T17:12:22+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-08-05T17:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=406f61fd3a28b9628f50cf009c6e65562f93a2cc'/>
<id>406f61fd3a28b9628f50cf009c6e65562f93a2cc</id>
<content type='text'>
This way we make sure that the logic to reconstruct demangled names in
the tests is the same as the logic when reconstructing the actual
frame-format variable.

`DemangledNameInfo::SuffixRange` is currently the only one which we
can't test in the same way until we set it from inside the
`TrackingOutputBuffer`. I added TODOs to track this.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This way we make sure that the logic to reconstruct demangled names in
the tests is the same as the logic when reconstructing the actual
frame-format variable.

`DemangledNameInfo::SuffixRange` is currently the only one which we
can't test in the same way until we set it from inside the
`TrackingOutputBuffer`. I added TODOs to track this.</pre>
</div>
</content>
</entry>
</feed>
