[Lldb-commits] [lldb] 56b148a - [lldb] Fix stdcpp type summary mistakenly marked as regex (NFC) (#66949)

via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 20 14:24:08 PDT 2023


Author: Dave Lee
Date: 2023-09-20T14:24:04-07:00
New Revision: 56b148aa8d6fcc61f0619d74cf5edcabbbb4d842

URL: https://github.com/llvm/llvm-project/commit/56b148aa8d6fcc61f0619d74cf5edcabbbb4d842
DIFF: https://github.com/llvm/llvm-project/commit/56b148aa8d6fcc61f0619d74cf5edcabbbb4d842.diff

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

`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

Added: 
    

Modified: 
    lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp

Removed: 
    


################################################################################
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);


        


More information about the lldb-commits mailing list