Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] Fix stdcpp type summary mistakenly marked as regex (NFC) #66949

Conversation

kastiglione
Copy link
Contributor

std::basic_string<char> is not a regex, and treating it as such could unintentionally
cause a formatter to substring match a template type parameter, for example:
std::vector<std::basic_string<char>>.

Differential Revision: https://reviews.llvm.org/D158663

`std::basic_string<char>` is not a regex, and treating it as such could unintentionally
cause a formatter to substring match a template type parameter, for example:
`std::vector<std::basic_string<char>>`.

Differential Revision: https://reviews.llvm.org/D158663
@llvmbot
Copy link
Member

llvmbot commented Sep 20, 2023

@llvm/pr-subscribers-lldb

Changes

std::basic_string&lt;char&gt; is not a regex, and treating it as such could unintentionally
cause a formatter to substring match a template type parameter, for example:
std::vector&lt;std::basic_string&lt;char&gt;&gt;.

Differential Revision: https://reviews.llvm.org/D158663


Full diff: https://github.com/llvm/llvm-project/pull/66949.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (+1-1)
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index 3d709e3d6759556..c1743a5e0a418dd 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -1009,7 +1009,7 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
   cpp_category_sp->AddTypeSummary("std::string", eFormatterMatchExact,
                                   std_string_summary_sp);
   cpp_category_sp->AddTypeSummary("std::basic_string<char>",
-                                  eFormatterMatchRegex, std_string_summary_sp);
+                                  eFormatterMatchExact, std_string_summary_sp);
   cpp_category_sp->AddTypeSummary(
       "std::basic_string<char,std::char_traits<char>,std::allocator<char> >",
       eFormatterMatchExact, std_string_summary_sp);

Copy link
Member

@walter-erquinigo walter-erquinigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I think I have suffered because of this at some point.

@jimingham
Copy link
Collaborator

jimingham commented Sep 20, 2023 via email

@kastiglione kastiglione merged commit 56b148a into llvm:main Sep 20, 2023
@kastiglione kastiglione deleted the lldb-Fix-stdcpp-type-summary-mistakenly-marked-as-regex-NFC branch September 20, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants