LLDB mainline
CPlusPlusLanguage.cpp
Go to the documentation of this file.
1//===-- CPlusPlusLanguage.cpp ---------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "CPlusPlusLanguage.h"
10
11#include <cctype>
12#include <cstring>
13
14#include <functional>
15#include <memory>
16#include <mutex>
17#include <set>
18
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Demangle/ItaniumDemangle.h"
21
22#include "lldb/Core/Mangled.h"
23#include "lldb/Core/Module.h"
35#include "lldb/Utility/Log.h"
37
38#include "BlockPointer.h"
39#include "CPlusPlusNameParser.h"
40#include "Coroutines.h"
41#include "CxxStringTypes.h"
42#include "Generic.h"
43#include "LibCxx.h"
44#include "LibCxxAtomic.h"
45#include "LibCxxVariant.h"
46#include "LibStdcpp.h"
49
50using namespace lldb;
51using namespace lldb_private;
52using namespace lldb_private::formatters;
53
55
56void CPlusPlusLanguage::Initialize() {
57 PluginManager::RegisterPlugin(GetPluginNameStatic(), "C++ Language",
58 CreateInstance);
59}
60
63}
64
66 const char *mangled_name = mangled.GetMangledName().GetCString();
67 return mangled_name && CPlusPlusLanguage::IsCPPMangledName(mangled_name);
68}
69
71 Mangled mangled) const {
72 const char *mangled_name_cstr = mangled.GetMangledName().GetCString();
73 ConstString demangled_name = mangled.GetDemangledName();
74 if (demangled_name && mangled_name_cstr && mangled_name_cstr[0]) {
75 if (mangled_name_cstr[0] == '_' && mangled_name_cstr[1] == 'Z' &&
76 (mangled_name_cstr[2] != 'T' && // avoid virtual table, VTT structure,
77 // typeinfo structure, and typeinfo
78 // mangled_name
79 mangled_name_cstr[2] != 'G' && // avoid guard variables
80 mangled_name_cstr[2] != 'Z')) // named local entities (if we
81 // eventually handle eSymbolTypeData,
82 // we will want this back)
83 {
84 CPlusPlusLanguage::MethodName cxx_method(demangled_name);
85 if (!cxx_method.GetBasename().empty()) {
86 std::string shortname;
87 if (!cxx_method.GetContext().empty())
88 shortname = cxx_method.GetContext().str() + "::";
89 shortname += cxx_method.GetBasename().str();
90 return ConstString(shortname);
91 }
92 }
93 }
94 if (demangled_name)
95 return demangled_name;
96 return mangled.GetMangledName();
97}
98
99// Static Functions
100
102 // Use plugin for C++ but not for Objective-C++ (which has its own plugin).
103 if (Language::LanguageIsCPlusPlus(language) &&
104 language != eLanguageTypeObjC_plus_plus)
105 return new CPlusPlusLanguage();
106 return nullptr;
107}
108
110 m_full.Clear();
111 m_basename = llvm::StringRef();
112 m_context = llvm::StringRef();
113 m_arguments = llvm::StringRef();
114 m_qualifiers = llvm::StringRef();
115 m_return_type = llvm::StringRef();
116 m_parsed = false;
117 m_parse_error = false;
118}
119
120static bool ReverseFindMatchingChars(const llvm::StringRef &s,
121 const llvm::StringRef &left_right_chars,
122 size_t &left_pos, size_t &right_pos,
123 size_t pos = llvm::StringRef::npos) {
124 assert(left_right_chars.size() == 2);
125 left_pos = llvm::StringRef::npos;
126 const char left_char = left_right_chars[0];
127 const char right_char = left_right_chars[1];
128 pos = s.find_last_of(left_right_chars, pos);
129 if (pos == llvm::StringRef::npos || s[pos] == left_char)
130 return false;
131 right_pos = pos;
132 uint32_t depth = 1;
133 while (pos > 0 && depth > 0) {
134 pos = s.find_last_of(left_right_chars, pos);
135 if (pos == llvm::StringRef::npos)
136 return false;
137 if (s[pos] == left_char) {
138 if (--depth == 0) {
139 left_pos = pos;
140 return left_pos < right_pos;
141 }
142 } else if (s[pos] == right_char) {
143 ++depth;
144 }
145 }
146 return false;
147}
148
149static bool IsTrivialBasename(const llvm::StringRef &basename) {
150 // Check that the basename matches with the following regular expression
151 // "^~?([A-Za-z_][A-Za-z_0-9]*)$" We are using a hand written implementation
152 // because it is significantly more efficient then using the general purpose
153 // regular expression library.
154 size_t idx = 0;
155 if (basename.size() > 0 && basename[0] == '~')
156 idx = 1;
157
158 if (basename.size() <= idx)
159 return false; // Empty string or "~"
160
161 if (!std::isalpha(basename[idx]) && basename[idx] != '_')
162 return false; // First character (after removing the possible '~'') isn't in
163 // [A-Za-z_]
164
165 // Read all characters matching [A-Za-z_0-9]
166 ++idx;
167 while (idx < basename.size()) {
168 if (!std::isalnum(basename[idx]) && basename[idx] != '_')
169 break;
170 ++idx;
171 }
172
173 // We processed all characters. It is a vaild basename.
174 return idx == basename.size();
175}
176
177/// Writes out the function name in 'full_name' to 'out_stream'
178/// but replaces each argument type with the variable name
179/// and the corresponding pretty-printed value
181 char const *full_name,
182 ExecutionContextScope *exe_scope,
183 VariableList const &args) {
184 CPlusPlusLanguage::MethodName cpp_method{ConstString(full_name)};
185
186 if (!cpp_method.IsValid())
187 return false;
188
189 llvm::StringRef return_type = cpp_method.GetReturnType();
190 if (!return_type.empty()) {
191 out_stream.PutCString(return_type);
192 out_stream.PutChar(' ');
193 }
194
195 out_stream.PutCString(cpp_method.GetScopeQualifiedName());
196 out_stream.PutChar('(');
197
198 FormatEntity::PrettyPrintFunctionArguments(out_stream, args, exe_scope);
199
200 out_stream.PutChar(')');
201
202 llvm::StringRef qualifiers = cpp_method.GetQualifiers();
203 if (!qualifiers.empty()) {
204 out_stream.PutChar(' ');
205 out_stream.PutCString(qualifiers);
206 }
207
208 return true;
209}
210
212 // This method tries to parse simple method definitions which are presumably
213 // most comman in user programs. Definitions that can be parsed by this
214 // function don't have return types and templates in the name.
215 // A::B::C::fun(std::vector<T> &) const
216 size_t arg_start, arg_end;
217 llvm::StringRef full(m_full.GetCString());
218 llvm::StringRef parens("()", 2);
219 if (ReverseFindMatchingChars(full, parens, arg_start, arg_end)) {
220 m_arguments = full.substr(arg_start, arg_end - arg_start + 1);
221 if (arg_end + 1 < full.size())
222 m_qualifiers = full.substr(arg_end + 1).ltrim();
223
224 if (arg_start == 0)
225 return false;
226 size_t basename_end = arg_start;
227 size_t context_start = 0;
228 size_t context_end = full.rfind(':', basename_end);
229 if (context_end == llvm::StringRef::npos)
230 m_basename = full.substr(0, basename_end);
231 else {
232 if (context_start < context_end)
233 m_context = full.substr(context_start, context_end - 1 - context_start);
234 const size_t basename_begin = context_end + 1;
235 m_basename = full.substr(basename_begin, basename_end - basename_begin);
236 }
237
238 if (IsTrivialBasename(m_basename)) {
239 return true;
240 } else {
241 // The C++ basename doesn't match our regular expressions so this can't
242 // be a valid C++ method, clear everything out and indicate an error
243 m_context = llvm::StringRef();
244 m_basename = llvm::StringRef();
245 m_arguments = llvm::StringRef();
246 m_qualifiers = llvm::StringRef();
247 m_return_type = llvm::StringRef();
248 return false;
249 }
250 }
251 return false;
252}
253
255 if (!m_parsed && m_full) {
256 if (TrySimplifiedParse()) {
257 m_parse_error = false;
258 } else {
259 CPlusPlusNameParser parser(m_full.GetStringRef());
260 if (auto function = parser.ParseAsFunctionDefinition()) {
261 m_basename = function->name.basename;
262 m_context = function->name.context;
263 m_arguments = function->arguments;
264 m_qualifiers = function->qualifiers;
265 m_return_type = function->return_type;
266 m_parse_error = false;
267 } else {
268 m_parse_error = true;
269 }
270 }
271 m_parsed = true;
272 }
273}
274
276 if (!m_parsed)
277 Parse();
278 return m_basename;
279}
280
282 if (!m_parsed)
283 Parse();
284 return m_context;
285}
286
288 if (!m_parsed)
289 Parse();
290 return m_arguments;
291}
292
294 if (!m_parsed)
295 Parse();
296 return m_qualifiers;
297}
298
300 if (!m_parsed)
301 Parse();
302 return m_return_type;
303}
304
306 if (!m_parsed)
307 Parse();
308 if (m_context.empty())
309 return std::string(m_basename);
310
311 std::string res;
312 res += m_context;
313 res += "::";
314 res += m_basename;
315 return res;
316}
317
318llvm::StringRef
320 llvm::StringRef basename = GetBasename();
321 size_t arg_start, arg_end;
322 llvm::StringRef parens("<>", 2);
323 if (ReverseFindMatchingChars(basename, parens, arg_start, arg_end))
324 return basename.substr(0, arg_start);
325
326 return basename;
327}
328
330 if (!m_parsed)
331 Parse();
332
333 // If we can't parse the incoming name, then just check that it contains path.
334 if (m_parse_error)
335 return m_full.GetStringRef().contains(path);
336
337 llvm::StringRef identifier;
338 llvm::StringRef context;
339 std::string path_str = path.str();
341 path_str.c_str(), context, identifier);
342 if (!success)
343 return m_full.GetStringRef().contains(path);
344
345 // Basename may include template arguments.
346 // E.g.,
347 // GetBaseName(): func<int>
348 // identifier : func
349 //
350 // ...but we still want to account for identifiers with template parameter
351 // lists, e.g., when users set breakpoints on template specializations.
352 //
353 // E.g.,
354 // GetBaseName(): func<uint32_t>
355 // identifier : func<int32_t*>
356 //
357 // Try to match the basename with or without template parameters.
358 if (GetBasename() != identifier &&
359 GetBasenameNoTemplateParameters() != identifier)
360 return false;
361
362 // Incoming path only had an identifier, so we match.
363 if (context.empty())
364 return true;
365 // Incoming path has context but this method does not, no match.
366 if (m_context.empty())
367 return false;
368
369 llvm::StringRef haystack = m_context;
370 if (!haystack.consume_back(context))
371 return false;
372 if (haystack.empty() || !isalnum(haystack.back()))
373 return true;
374
375 return false;
376}
377
378bool CPlusPlusLanguage::IsCPPMangledName(llvm::StringRef name) {
379 // FIXME!! we should really run through all the known C++ Language plugins
380 // and ask each one if this is a C++ mangled name
381
383
384 if (scheme == Mangled::eManglingSchemeNone)
385 return false;
386
387 return true;
388}
389
391 ConstString demangled) const {
392 MethodName demangled_name(demangled);
393 return demangled_name.ContainsPath(path);
394}
395
397 const char *name, llvm::StringRef &context, llvm::StringRef &identifier) {
400 identifier);
401
402 CPlusPlusNameParser parser(name);
403 if (auto full_name = parser.ParseAsFullName()) {
404 identifier = full_name->basename;
405 context = full_name->context;
406 return true;
407 }
408 return false;
409}
410
411namespace {
412class NodeAllocator {
413 llvm::BumpPtrAllocator Alloc;
414
415public:
416 void reset() { Alloc.Reset(); }
417
418 template <typename T, typename... Args> T *makeNode(Args &&... args) {
419 return new (Alloc.Allocate(sizeof(T), alignof(T)))
420 T(std::forward<Args>(args)...);
421 }
422
423 void *allocateNodeArray(size_t sz) {
424 return Alloc.Allocate(sizeof(llvm::itanium_demangle::Node *) * sz,
425 alignof(llvm::itanium_demangle::Node *));
426 }
427};
428
429template <typename Derived>
430class ManglingSubstitutor
431 : public llvm::itanium_demangle::AbstractManglingParser<Derived,
432 NodeAllocator> {
433 using Base =
434 llvm::itanium_demangle::AbstractManglingParser<Derived, NodeAllocator>;
435
436public:
437 ManglingSubstitutor() : Base(nullptr, nullptr) {}
438
439 template <typename... Ts>
440 ConstString substitute(llvm::StringRef Mangled, Ts &&... Vals) {
441 this->getDerived().reset(Mangled, std::forward<Ts>(Vals)...);
442 return substituteImpl(Mangled);
443 }
444
445protected:
446 void reset(llvm::StringRef Mangled) {
447 Base::reset(Mangled.begin(), Mangled.end());
448 Written = Mangled.begin();
449 Result.clear();
450 Substituted = false;
451 }
452
453 ConstString substituteImpl(llvm::StringRef Mangled) {
454 Log *log = GetLog(LLDBLog::Language);
455 if (this->parse() == nullptr) {
456 LLDB_LOG(log, "Failed to substitute mangling in {0}", Mangled);
457 return ConstString();
458 }
459 if (!Substituted)
460 return ConstString();
461
462 // Append any trailing unmodified input.
463 appendUnchangedInput();
464 LLDB_LOG(log, "Substituted mangling {0} -> {1}", Mangled, Result);
465 return ConstString(Result);
466 }
467
468 void trySubstitute(llvm::StringRef From, llvm::StringRef To) {
469 if (!llvm::StringRef(currentParserPos(), this->numLeft()).starts_with(From))
470 return;
471
472 // We found a match. Append unmodified input up to this point.
473 appendUnchangedInput();
474
475 // And then perform the replacement.
476 Result += To;
477 Written += From.size();
478 Substituted = true;
479 }
480
481private:
482 /// Input character until which we have constructed the respective output
483 /// already.
484 const char *Written = "";
485
486 llvm::SmallString<128> Result;
487
488 /// Whether we have performed any substitutions.
489 bool Substituted = false;
490
491 const char *currentParserPos() const { return this->First; }
492
493 void appendUnchangedInput() {
494 Result +=
495 llvm::StringRef(Written, std::distance(Written, currentParserPos()));
496 Written = currentParserPos();
497 }
498};
499
500/// Given a mangled function `Mangled`, replace all the primitive function type
501/// arguments of `Search` with type `Replace`.
502class TypeSubstitutor : public ManglingSubstitutor<TypeSubstitutor> {
503 llvm::StringRef Search;
504 llvm::StringRef Replace;
505
506public:
507 void reset(llvm::StringRef Mangled, llvm::StringRef Search,
508 llvm::StringRef Replace) {
509 ManglingSubstitutor::reset(Mangled);
510 this->Search = Search;
511 this->Replace = Replace;
512 }
513
514 llvm::itanium_demangle::Node *parseType() {
515 trySubstitute(Search, Replace);
516 return ManglingSubstitutor::parseType();
517 }
518};
519
520class CtorDtorSubstitutor : public ManglingSubstitutor<CtorDtorSubstitutor> {
521public:
522 llvm::itanium_demangle::Node *
523 parseCtorDtorName(llvm::itanium_demangle::Node *&SoFar, NameState *State) {
524 trySubstitute("C1", "C2");
525 trySubstitute("D1", "D2");
526 return ManglingSubstitutor::parseCtorDtorName(SoFar, State);
527 }
528};
529} // namespace
530
532 const ConstString mangled_name) const {
533 std::vector<ConstString> alternates;
534
535 /// Get a basic set of alternative manglings for the given symbol `name`, by
536 /// making a few basic possible substitutions on basic types, storage duration
537 /// and `const`ness for the given symbol. The output parameter `alternates`
538 /// is filled with a best-guess, non-exhaustive set of different manglings
539 /// for the given name.
540
541 // Maybe we're looking for a const symbol but the debug info told us it was
542 // non-const...
543 if (!strncmp(mangled_name.GetCString(), "_ZN", 3) &&
544 strncmp(mangled_name.GetCString(), "_ZNK", 4)) {
545 std::string fixed_scratch("_ZNK");
546 fixed_scratch.append(mangled_name.GetCString() + 3);
547 alternates.push_back(ConstString(fixed_scratch));
548 }
549
550 // Maybe we're looking for a static symbol but we thought it was global...
551 if (!strncmp(mangled_name.GetCString(), "_Z", 2) &&
552 strncmp(mangled_name.GetCString(), "_ZL", 3)) {
553 std::string fixed_scratch("_ZL");
554 fixed_scratch.append(mangled_name.GetCString() + 2);
555 alternates.push_back(ConstString(fixed_scratch));
556 }
557
558 TypeSubstitutor TS;
559 // `char` is implementation defined as either `signed` or `unsigned`. As a
560 // result a char parameter has 3 possible manglings: 'c'-char, 'a'-signed
561 // char, 'h'-unsigned char. If we're looking for symbols with a signed char
562 // parameter, try finding matches which have the general case 'c'.
563 if (ConstString char_fixup =
564 TS.substitute(mangled_name.GetStringRef(), "a", "c"))
565 alternates.push_back(char_fixup);
566
567 // long long parameter mangling 'x', may actually just be a long 'l' argument
568 if (ConstString long_fixup =
569 TS.substitute(mangled_name.GetStringRef(), "x", "l"))
570 alternates.push_back(long_fixup);
571
572 // unsigned long long parameter mangling 'y', may actually just be unsigned
573 // long 'm' argument
574 if (ConstString ulong_fixup =
575 TS.substitute(mangled_name.GetStringRef(), "y", "m"))
576 alternates.push_back(ulong_fixup);
577
578 if (ConstString ctor_fixup =
579 CtorDtorSubstitutor().substitute(mangled_name.GetStringRef()))
580 alternates.push_back(ctor_fixup);
581
582 return alternates;
583}
584
586 const Mangled mangled, const SymbolContext &sym_ctx) const {
587 ConstString demangled = mangled.GetDemangledName();
588 if (!demangled)
589 return ConstString();
590
591 CPlusPlusLanguage::MethodName cpp_name(demangled);
592 std::string scope_qualified_name = cpp_name.GetScopeQualifiedName();
593
594 if (!scope_qualified_name.size())
595 return ConstString();
596
597 if (!sym_ctx.module_sp)
598 return ConstString();
599
600 lldb_private::SymbolFile *sym_file = sym_ctx.module_sp->GetSymbolFile();
601 if (!sym_file)
602 return ConstString();
603
604 std::vector<ConstString> alternates;
605 sym_file->GetMangledNamesForFunction(scope_qualified_name, alternates);
606
607 std::vector<ConstString> param_and_qual_matches;
608 std::vector<ConstString> param_matches;
609 for (size_t i = 0; i < alternates.size(); i++) {
610 ConstString alternate_mangled_name = alternates[i];
611 Mangled mangled(alternate_mangled_name);
612 ConstString demangled = mangled.GetDemangledName();
613
614 CPlusPlusLanguage::MethodName alternate_cpp_name(demangled);
615 if (!cpp_name.IsValid())
616 continue;
617
618 if (alternate_cpp_name.GetArguments() == cpp_name.GetArguments()) {
619 if (alternate_cpp_name.GetQualifiers() == cpp_name.GetQualifiers())
620 param_and_qual_matches.push_back(alternate_mangled_name);
621 else
622 param_matches.push_back(alternate_mangled_name);
623 }
624 }
625
626 if (param_and_qual_matches.size())
627 return param_and_qual_matches[0]; // It is assumed that there will be only
628 // one!
629 else if (param_matches.size())
630 return param_matches[0]; // Return one of them as a best match
631 else
632 return ConstString();
633}
634
635static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
636 if (!cpp_category_sp)
637 return;
638
639 TypeSummaryImpl::Flags stl_summary_flags;
640 stl_summary_flags.SetCascades(true)
641 .SetSkipPointers(false)
642 .SetSkipReferences(false)
644 .SetDontShowValue(true)
646 .SetHideItemNames(false);
647
648 AddCXXSummary(cpp_category_sp,
650 "std::string summary provider", "^std::__[[:alnum:]]+::string$",
651 stl_summary_flags, true);
652 AddCXXSummary(cpp_category_sp,
654 "std::string summary provider",
655 "^std::__[[:alnum:]]+::basic_string<char, "
656 "std::__[[:alnum:]]+::char_traits<char>, "
657 "std::__[[:alnum:]]+::allocator<char> >$",
658 stl_summary_flags, true);
659 AddCXXSummary(cpp_category_sp,
661 "std::string summary provider",
662 "^std::__[[:alnum:]]+::basic_string<unsigned char, "
663 "std::__[[:alnum:]]+::char_traits<unsigned char>, "
664 "std::__[[:alnum:]]+::allocator<unsigned char> >$",
665 stl_summary_flags, true);
666
667 AddCXXSummary(cpp_category_sp,
669 "std::u16string summary provider",
670 "^std::__[[:alnum:]]+::basic_string<char16_t, "
671 "std::__[[:alnum:]]+::char_traits<char16_t>, "
672 "std::__[[:alnum:]]+::allocator<char16_t> >$",
673 stl_summary_flags, true);
674
675 AddCXXSummary(cpp_category_sp,
677 "std::u32string summary provider",
678 "^std::__[[:alnum:]]+::basic_string<char32_t, "
679 "std::__[[:alnum:]]+::char_traits<char32_t>, "
680 "std::__[[:alnum:]]+::allocator<char32_t> >$",
681 stl_summary_flags, true);
682
683 AddCXXSummary(cpp_category_sp,
685 "std::wstring summary provider",
686 "^std::__[[:alnum:]]+::wstring$", stl_summary_flags, true);
687 AddCXXSummary(cpp_category_sp,
689 "std::wstring summary provider",
690 "^std::__[[:alnum:]]+::basic_string<wchar_t, "
691 "std::__[[:alnum:]]+::char_traits<wchar_t>, "
692 "std::__[[:alnum:]]+::allocator<wchar_t> >$",
693 stl_summary_flags, true);
694
695 AddCXXSummary(cpp_category_sp,
697 "std::string_view summary provider",
698 "^std::__[[:alnum:]]+::string_view$", stl_summary_flags, true);
699 AddCXXSummary(cpp_category_sp,
701 "std::string_view summary provider",
702 "^std::__[[:alnum:]]+::basic_string_view<char, "
703 "std::__[[:alnum:]]+::char_traits<char> >$",
704 stl_summary_flags, true);
705 AddCXXSummary(cpp_category_sp,
707 "std::string_view summary provider",
708 "^std::__[[:alnum:]]+::basic_string_view<unsigned char, "
709 "std::__[[:alnum:]]+::char_traits<unsigned char> >$",
710 stl_summary_flags, true);
711
712 AddCXXSummary(cpp_category_sp,
714 "std::u16string_view summary provider",
715 "^std::__[[:alnum:]]+::basic_string_view<char16_t, "
716 "std::__[[:alnum:]]+::char_traits<char16_t> >$",
717 stl_summary_flags, true);
718
719 AddCXXSummary(cpp_category_sp,
721 "std::u32string_view summary provider",
722 "^std::__[[:alnum:]]+::basic_string_view<char32_t, "
723 "std::__[[:alnum:]]+::char_traits<char32_t> >$",
724 stl_summary_flags, true);
725
726 AddCXXSummary(cpp_category_sp,
728 "std::wstring_view summary provider",
729 "^std::__[[:alnum:]]+::wstring_view$", stl_summary_flags, true);
730 AddCXXSummary(cpp_category_sp,
732 "std::wstring_view summary provider",
733 "^std::__[[:alnum:]]+::basic_string_view<wchar_t, "
734 "std::__[[:alnum:]]+::char_traits<wchar_t> >$",
735 stl_summary_flags, true);
736
737 SyntheticChildren::Flags stl_synth_flags;
738 stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(
739 false);
740 SyntheticChildren::Flags stl_deref_flags = stl_synth_flags;
741 stl_deref_flags.SetFrontEndWantsDereference();
742
744 cpp_category_sp,
746 "libc++ std::bitset synthetic children",
747 "^std::__[[:alnum:]]+::bitset<.+>$", stl_deref_flags, true);
749 cpp_category_sp,
751 "libc++ std::vector synthetic children",
752 "^std::__[[:alnum:]]+::vector<.+>$", stl_deref_flags, true);
754 cpp_category_sp,
756 "libc++ std::valarray synthetic children",
757 "^std::__[[:alnum:]]+::valarray<.+>$", stl_deref_flags, true);
759 cpp_category_sp,
761 "libc++ std::forward_list synthetic children",
762 "^std::__[[:alnum:]]+::forward_list<.+>$", stl_synth_flags, true);
764 cpp_category_sp,
766 "libc++ std::list synthetic children",
767 // A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>$"
768 // so that it does not clash with: "^std::(__cxx11::)?list<.+>$"
769 "^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
770 "cxx11[[:alnum:]])[[:alnum:]]*::list<.+>$",
771 stl_deref_flags, true);
773 cpp_category_sp,
775 "libc++ std::map synthetic children", "^std::__[[:alnum:]]+::map<.+> >$",
776 stl_synth_flags, true);
778 cpp_category_sp,
780 "libc++ std::set synthetic children", "^std::__[[:alnum:]]+::set<.+> >$",
781 stl_deref_flags, true);
783 cpp_category_sp,
785 "libc++ std::multiset synthetic children",
786 "^std::__[[:alnum:]]+::multiset<.+> >$", stl_deref_flags, true);
788 cpp_category_sp,
790 "libc++ std::multimap synthetic children",
791 "^std::__[[:alnum:]]+::multimap<.+> >$", stl_synth_flags, true);
793 cpp_category_sp,
795 "libc++ std::unordered containers synthetic children",
796 "^std::__[[:alnum:]]+::unordered_(multi)?(map|set)<.+> >$",
797 stl_synth_flags, true);
799 cpp_category_sp,
801 "libc++ std::initializer_list synthetic children",
802 "^std::initializer_list<.+>$", stl_synth_flags, true);
804 "libc++ std::queue synthetic children",
805 "^std::__[[:alnum:]]+::queue<.+>$", stl_synth_flags, true);
807 "libc++ std::tuple synthetic children",
808 "^std::__[[:alnum:]]+::tuple<.*>$", stl_synth_flags, true);
810 "libc++ std::optional synthetic children",
811 "^std::__[[:alnum:]]+::optional<.+>$", stl_synth_flags, true);
813 "libc++ std::variant synthetic children",
814 "^std::__[[:alnum:]]+::variant<.+>$", stl_synth_flags, true);
816 cpp_category_sp,
818 "libc++ std::atomic synthetic children",
819 "^std::__[[:alnum:]]+::atomic<.+>$", stl_synth_flags, true);
821 cpp_category_sp,
823 "libc++ std::span synthetic children", "^std::__[[:alnum:]]+::span<.+>$",
824 stl_deref_flags, true);
826 cpp_category_sp,
828 "libc++ std::ranges::ref_view synthetic children",
829 "^std::__[[:alnum:]]+::ranges::ref_view<.+>$", stl_deref_flags, true);
830
831 cpp_category_sp->AddTypeSynthetic(
832 "^std::__[[:alnum:]]+::deque<.+>$", eFormatterMatchRegex,
834 stl_synth_flags,
835 "lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));
836
838 cpp_category_sp,
840 "shared_ptr synthetic children", "^std::__[[:alnum:]]+::shared_ptr<.+>$",
841 stl_synth_flags, true);
842
843 static constexpr const char *const libcxx_std_unique_ptr_regex =
844 "^std::__[[:alnum:]]+::unique_ptr<.+>$";
846 cpp_category_sp,
848 "unique_ptr synthetic children", libcxx_std_unique_ptr_regex,
849 stl_synth_flags, true);
850
852 cpp_category_sp,
854 "weak_ptr synthetic children", "^std::__[[:alnum:]]+::weak_ptr<.+>$",
855 stl_synth_flags, true);
856 AddCXXSummary(cpp_category_sp,
858 "libc++ std::function summary provider",
859 "^std::__[[:alnum:]]+::function<.+>$", stl_summary_flags, true);
860
861 static constexpr const char *const libcxx_std_coroutine_handle_regex =
862 "^std::__[[:alnum:]]+::coroutine_handle<.+>$";
864 cpp_category_sp,
866 "coroutine_handle synthetic children", libcxx_std_coroutine_handle_regex,
867 stl_deref_flags, true);
868
869 stl_summary_flags.SetDontShowChildren(false);
870 stl_summary_flags.SetSkipPointers(false);
871 AddCXXSummary(cpp_category_sp,
873 "libc++ std::bitset summary provider",
874 "^std::__[[:alnum:]]+::bitset<.+>$", stl_summary_flags, true);
875 AddCXXSummary(cpp_category_sp,
877 "libc++ std::vector summary provider",
878 "^std::__[[:alnum:]]+::vector<.+>$", stl_summary_flags, true);
879 AddCXXSummary(cpp_category_sp,
881 "libc++ std::valarray summary provider",
882 "^std::__[[:alnum:]]+::valarray<.+>$", stl_summary_flags, true);
885 "libc++ std::list summary provider",
886 "^std::__[[:alnum:]]+::forward_list<.+>$", stl_summary_flags, true);
889 "libc++ std::list summary provider",
890 // A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>$"
891 // so that it does not clash with: "^std::(__cxx11::)?list<.+>$"
892 "^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
893 "cxx11[[:alnum:]])[[:alnum:]]*::list<.+>$",
894 stl_summary_flags, true);
895 AddCXXSummary(cpp_category_sp,
897 "libc++ std::map summary provider",
898 "^std::__[[:alnum:]]+::map<.+>$", stl_summary_flags, true);
899 AddCXXSummary(cpp_category_sp,
901 "libc++ std::deque summary provider",
902 "^std::__[[:alnum:]]+::deque<.+>$", stl_summary_flags, true);
903 AddCXXSummary(cpp_category_sp,
905 "libc++ std::queue summary provider",
906 "^std::__[[:alnum:]]+::queue<.+>$", stl_summary_flags, true);
907 AddCXXSummary(cpp_category_sp,
909 "libc++ std::set summary provider",
910 "^std::__[[:alnum:]]+::set<.+>$", stl_summary_flags, true);
911 AddCXXSummary(cpp_category_sp,
913 "libc++ std::multiset summary provider",
914 "^std::__[[:alnum:]]+::multiset<.+>$", stl_summary_flags, true);
915 AddCXXSummary(cpp_category_sp,
917 "libc++ std::multimap summary provider",
918 "^std::__[[:alnum:]]+::multimap<.+>$", stl_summary_flags, true);
919 AddCXXSummary(cpp_category_sp,
921 "libc++ std::unordered containers summary provider",
922 "^std::__[[:alnum:]]+::unordered_(multi)?(map|set)<.+> >$",
923 stl_summary_flags, true);
925 "libc++ std::tuple summary provider",
926 "^std::__[[:alnum:]]+::tuple<.*>$", stl_summary_flags, true);
927 AddCXXSummary(cpp_category_sp,
929 "libc++ std::atomic summary provider",
930 "^std::__[[:alnum:]]+::atomic<.+>$", stl_summary_flags, true);
931 AddCXXSummary(cpp_category_sp,
933 "libc++ std::optional summary provider",
934 "^std::__[[:alnum:]]+::optional<.+>$", stl_summary_flags, true);
935 AddCXXSummary(cpp_category_sp,
937 "libc++ std::variant summary provider",
938 "^std::__[[:alnum:]]+::variant<.+>$", stl_summary_flags, true);
939 AddCXXSummary(cpp_category_sp,
941 "libc++ std::span summary provider",
942 "^std::__[[:alnum:]]+::span<.+>$", stl_summary_flags, true);
943
944 stl_summary_flags.SetSkipPointers(true);
945
946 AddCXXSummary(cpp_category_sp,
948 "libc++ std::shared_ptr summary provider",
949 "^std::__[[:alnum:]]+::shared_ptr<.+>$", stl_summary_flags,
950 true);
951 AddCXXSummary(cpp_category_sp,
953 "libc++ std::weak_ptr summary provider",
954 "^std::__[[:alnum:]]+::weak_ptr<.+>$", stl_summary_flags, true);
955 AddCXXSummary(cpp_category_sp,
957 "libc++ std::unique_ptr summary provider",
958 libcxx_std_unique_ptr_regex, stl_summary_flags, true);
959
960 AddCXXSummary(cpp_category_sp,
962 "libc++ std::coroutine_handle summary provider",
963 libcxx_std_coroutine_handle_regex, stl_summary_flags, true);
964
966 cpp_category_sp,
968 "std::vector iterator synthetic children",
969 "^std::__[[:alnum:]]+::__wrap_iter<.+>$", stl_synth_flags, true);
970
972 cpp_category_sp,
974 "std::map iterator synthetic children",
975 "^std::__[[:alnum:]]+::__map_(const_)?iterator<.+>$", stl_synth_flags,
976 true);
977
978 AddCXXSynthetic(cpp_category_sp,
981 "std::unordered_map iterator synthetic children",
982 "^std::__[[:alnum:]]+::__hash_map_(const_)?iterator<.+>$",
983 stl_synth_flags, true);
984 // Chrono duration typedefs
985 cpp_category_sp->AddTypeSummary(
986 "^std::__[[:alnum:]]+::chrono::nanoseconds", eFormatterMatchRegex,
988 eTypeOptionHideChildren | eTypeOptionHideValue, "${var.__rep_} ns")));
989 cpp_category_sp->AddTypeSummary(
990 "^std::__[[:alnum:]]+::chrono::microseconds", eFormatterMatchRegex,
992 eTypeOptionHideChildren | eTypeOptionHideValue, "${var.__rep_} ┬Ás")));
993 cpp_category_sp->AddTypeSummary(
994 "^std::__[[:alnum:]]+::chrono::milliseconds", eFormatterMatchRegex,
996 eTypeOptionHideChildren | eTypeOptionHideValue, "${var.__rep_} ms")));
997 cpp_category_sp->AddTypeSummary(
998 "^std::__[[:alnum:]]+::chrono::seconds", eFormatterMatchRegex,
1000 eTypeOptionHideChildren | eTypeOptionHideValue, "${var.__rep_} s")));
1001 cpp_category_sp->AddTypeSummary(
1002 "^std::__[[:alnum:]]+::chrono::minutes", eFormatterMatchRegex,
1003 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1004 eTypeOptionHideValue,
1005 "${var.__rep_} min")));
1006 cpp_category_sp->AddTypeSummary(
1007 "^std::__[[:alnum:]]+::chrono::hours", eFormatterMatchRegex,
1009 eTypeOptionHideChildren | eTypeOptionHideValue, "${var.__rep_} h")));
1010
1011 cpp_category_sp->AddTypeSummary(
1012 "^std::__[[:alnum:]]+::chrono::days", eFormatterMatchRegex,
1013 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1014 eTypeOptionHideValue,
1015 "${var.__rep_} days")));
1016 cpp_category_sp->AddTypeSummary(
1017 "^std::__[[:alnum:]]+::chrono::weeks", eFormatterMatchRegex,
1018 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1019 eTypeOptionHideValue,
1020 "${var.__rep_} weeks")));
1021 cpp_category_sp->AddTypeSummary(
1022 "^std::__[[:alnum:]]+::chrono::months", eFormatterMatchRegex,
1023 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1024 eTypeOptionHideValue,
1025 "${var.__rep_} months")));
1026 cpp_category_sp->AddTypeSummary(
1027 "^std::__[[:alnum:]]+::chrono::years", eFormatterMatchRegex,
1028 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1029 eTypeOptionHideValue,
1030 "${var.__rep_} years")));
1031 cpp_category_sp->AddTypeSummary(
1032 "^std::__[[:alnum:]]+::chrono::seconds", eFormatterMatchRegex,
1034 eTypeOptionHideChildren | eTypeOptionHideValue, "${var.__rep_} s")));
1035
1036 // Chrono time point types
1037
1038 AddCXXSummary(cpp_category_sp,
1040 "libc++ std::chrono::sys_seconds summary provider",
1041 "^std::__[[:alnum:]]+::chrono::time_point<"
1042 "std::__[[:alnum:]]+::chrono::system_clock, "
1043 "std::__[[:alnum:]]+::chrono::duration<long long, "
1044 "std::__[[:alnum:]]+::ratio<1, 1> "
1045 "> >$",
1046 eTypeOptionHideChildren | eTypeOptionHideValue |
1047 eTypeOptionCascade,
1048 true);
1049 AddCXXSummary(cpp_category_sp,
1051 "libc++ std::chrono::sys_seconds summary provider",
1052 "^std::__[[:alnum:]]+::chrono::time_point<"
1053 "std::__[[:alnum:]]+::chrono::system_clock, "
1054 "std::__[[:alnum:]]+::chrono::duration<int, "
1055 "std::__[[:alnum:]]+::ratio<86400, 1> "
1056 "> >$",
1057 eTypeOptionHideChildren | eTypeOptionHideValue |
1058 eTypeOptionCascade,
1059 true);
1060
1061 // Chrono calendar types
1062
1063 cpp_category_sp->AddTypeSummary(
1064 "^std::__[[:alnum:]]+::chrono::day$", eFormatterMatchRegex,
1065 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1066 eTypeOptionHideValue,
1067 "day=${var.__d_%u}")));
1068
1069 AddCXXSummary(cpp_category_sp,
1071 "libc++ std::chrono::month summary provider",
1072 "^std::__[[:alnum:]]+::chrono::month$",
1073 eTypeOptionHideChildren | eTypeOptionHideValue, true);
1074
1075 cpp_category_sp->AddTypeSummary(
1076 "^std::__[[:alnum:]]+::chrono::year$", eFormatterMatchRegex,
1078 eTypeOptionHideChildren | eTypeOptionHideValue, "year=${var.__y_}")));
1079
1080 AddCXXSummary(cpp_category_sp,
1082 "libc++ std::chrono::weekday summary provider",
1083 "^std::__[[:alnum:]]+::chrono::weekday$",
1084 eTypeOptionHideChildren | eTypeOptionHideValue, true);
1085
1086 cpp_category_sp->AddTypeSummary(
1087 "^std::__[[:alnum:]]+::chrono::weekday_indexed$", eFormatterMatchRegex,
1089 eTypeOptionHideChildren | eTypeOptionHideValue,
1090 "${var.__wd_} index=${var.__idx_%u}")));
1091
1092 cpp_category_sp->AddTypeSummary(
1093 "^std::__[[:alnum:]]+::chrono::weekday_last$", eFormatterMatchRegex,
1094 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1095 eTypeOptionHideValue,
1096 "${var.__wd_} index=last")));
1097 cpp_category_sp->AddTypeSummary(
1098 "^std::__[[:alnum:]]+::chrono::month_day$", eFormatterMatchRegex,
1099 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1100 eTypeOptionHideValue,
1101 "${var.__m_} ${var.__d_}")));
1102 cpp_category_sp->AddTypeSummary(
1103 "^std::__[[:alnum:]]+::chrono::month_day_last$", eFormatterMatchRegex,
1104 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1105 eTypeOptionHideValue,
1106 "${var.__m_} day=last")));
1107
1108 cpp_category_sp->AddTypeSummary(
1109 "^std::__[[:alnum:]]+::chrono::month_weekday$", eFormatterMatchRegex,
1110 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1111 eTypeOptionHideValue,
1112 "${var.__m_} ${var.__wdi_}")));
1113
1114 cpp_category_sp->AddTypeSummary(
1115 "^std::__[[:alnum:]]+::chrono::month_weekday_last$", eFormatterMatchRegex,
1116 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1117 eTypeOptionHideValue,
1118 "${var.__m_} ${var.__wdl_}")));
1119
1120 cpp_category_sp->AddTypeSummary(
1121 "^std::__[[:alnum:]]+::chrono::year_month$", eFormatterMatchRegex,
1122 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1123 eTypeOptionHideValue,
1124 "${var.__y_} ${var.__m_}")));
1125
1127 cpp_category_sp,
1129 "libc++ std::chrono::year_month_day summary provider",
1130 "^std::__[[:alnum:]]+::chrono::year_month_day$",
1131 eTypeOptionHideChildren | eTypeOptionHideValue, true);
1132
1133 cpp_category_sp->AddTypeSummary(
1134 "^std::__[[:alnum:]]+::chrono::year_month_day_last$",
1136 TypeSummaryImplSP(new StringSummaryFormat(eTypeOptionHideChildren |
1137 eTypeOptionHideValue,
1138 "${var.__y_} ${var.__mdl_}")));
1139
1140 cpp_category_sp->AddTypeSummary(
1141 "^std::__[[:alnum:]]+::chrono::year_month_weekday$", eFormatterMatchRegex,
1143 eTypeOptionHideChildren | eTypeOptionHideValue,
1144 "${var.__y_} ${var.__m_} ${var.__wdi_}")));
1145
1146 cpp_category_sp->AddTypeSummary(
1147 "^std::__[[:alnum:]]+::chrono::year_month_weekday_last$",
1150 eTypeOptionHideChildren | eTypeOptionHideValue,
1151 "${var.__y_} ${var.__m_} ${var.__wdl_}")));
1152}
1153
1155 if (!cpp_category_sp)
1156 return;
1157
1158 TypeSummaryImpl::Flags stl_summary_flags;
1159 stl_summary_flags.SetCascades(true)
1160 .SetSkipPointers(false)
1161 .SetSkipReferences(false)
1162 .SetDontShowChildren(true)
1163 .SetDontShowValue(true)
1165 .SetHideItemNames(false);
1166
1167 lldb::TypeSummaryImplSP std_string_summary_sp(
1168 new StringSummaryFormat(stl_summary_flags, "${var._M_dataplus._M_p}"));
1169
1170 lldb::TypeSummaryImplSP cxx11_string_summary_sp(new CXXFunctionSummaryFormat(
1171 stl_summary_flags, LibStdcppStringSummaryProvider,
1172 "libstdc++ c++11 std::string summary provider"));
1173 lldb::TypeSummaryImplSP cxx11_wstring_summary_sp(new CXXFunctionSummaryFormat(
1174 stl_summary_flags, LibStdcppWStringSummaryProvider,
1175 "libstdc++ c++11 std::wstring summary provider"));
1176
1177 cpp_category_sp->AddTypeSummary("std::string", eFormatterMatchExact,
1178 std_string_summary_sp);
1179 cpp_category_sp->AddTypeSummary("std::basic_string<char>",
1180 eFormatterMatchExact, std_string_summary_sp);
1181 cpp_category_sp->AddTypeSummary(
1182 "std::basic_string<char,std::char_traits<char>,std::allocator<char> >",
1183 eFormatterMatchExact, std_string_summary_sp);
1184 cpp_category_sp->AddTypeSummary(
1185 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >",
1186 eFormatterMatchExact, std_string_summary_sp);
1187
1188 cpp_category_sp->AddTypeSummary("std::__cxx11::string", eFormatterMatchExact,
1189 cxx11_string_summary_sp);
1190 cpp_category_sp->AddTypeSummary(
1191 "std::__cxx11::basic_string<char, std::char_traits<char>, "
1192 "std::allocator<char> >",
1193 eFormatterMatchExact, cxx11_string_summary_sp);
1194 cpp_category_sp->AddTypeSummary("std::__cxx11::basic_string<unsigned char, "
1195 "std::char_traits<unsigned char>, "
1196 "std::allocator<unsigned char> >",
1198 cxx11_string_summary_sp);
1199
1200 // making sure we force-pick the summary for printing wstring (_M_p is a
1201 // wchar_t*)
1202 lldb::TypeSummaryImplSP std_wstring_summary_sp(
1203 new StringSummaryFormat(stl_summary_flags, "${var._M_dataplus._M_p%S}"));
1204
1205 cpp_category_sp->AddTypeSummary("std::wstring", eFormatterMatchExact,
1206 std_wstring_summary_sp);
1207 cpp_category_sp->AddTypeSummary("std::basic_string<wchar_t>",
1208 eFormatterMatchExact, std_wstring_summary_sp);
1209 cpp_category_sp->AddTypeSummary("std::basic_string<wchar_t,std::char_traits<"
1210 "wchar_t>,std::allocator<wchar_t> >",
1211 eFormatterMatchExact, std_wstring_summary_sp);
1212 cpp_category_sp->AddTypeSummary(
1213 "std::basic_string<wchar_t, std::char_traits<wchar_t>, "
1214 "std::allocator<wchar_t> >",
1215 eFormatterMatchExact, std_wstring_summary_sp);
1216
1217 cpp_category_sp->AddTypeSummary("std::__cxx11::wstring", eFormatterMatchExact,
1218 cxx11_wstring_summary_sp);
1219 cpp_category_sp->AddTypeSummary(
1220 "std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, "
1221 "std::allocator<wchar_t> >",
1222 eFormatterMatchExact, cxx11_wstring_summary_sp);
1223
1224 SyntheticChildren::Flags stl_synth_flags;
1225 stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(
1226 false);
1227 SyntheticChildren::Flags stl_deref_flags = stl_synth_flags;
1228 stl_deref_flags.SetFrontEndWantsDereference();
1229
1230 cpp_category_sp->AddTypeSynthetic(
1231 "^std::vector<.+>(( )?&)?$", eFormatterMatchRegex,
1233 stl_synth_flags,
1234 "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));
1235 cpp_category_sp->AddTypeSynthetic(
1236 "^std::map<.+> >(( )?&)?$", eFormatterMatchRegex,
1238 stl_synth_flags,
1239 "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
1240 cpp_category_sp->AddTypeSynthetic(
1241 "^std::deque<.+>(( )?&)?$", eFormatterMatchRegex,
1243 stl_deref_flags,
1244 "lldb.formatters.cpp.gnu_libstdcpp.StdDequeSynthProvider")));
1245 cpp_category_sp->AddTypeSynthetic(
1246 "^std::set<.+> >(( )?&)?$", eFormatterMatchRegex,
1248 stl_deref_flags,
1249 "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
1250 cpp_category_sp->AddTypeSynthetic(
1251 "^std::multimap<.+> >(( )?&)?$", eFormatterMatchRegex,
1253 stl_deref_flags,
1254 "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
1255 cpp_category_sp->AddTypeSynthetic(
1256 "^std::multiset<.+> >(( )?&)?$", eFormatterMatchRegex,
1258 stl_deref_flags,
1259 "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
1260 cpp_category_sp->AddTypeSynthetic(
1261 "^std::unordered_(multi)?(map|set)<.+> >$", eFormatterMatchRegex,
1263 stl_deref_flags,
1264 "lldb.formatters.cpp.gnu_libstdcpp.StdUnorderedMapSynthProvider")));
1265 cpp_category_sp->AddTypeSynthetic(
1266 "^std::(__cxx11::)?list<.+>(( )?&)?$", eFormatterMatchRegex,
1268 stl_deref_flags,
1269 "lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));
1270 cpp_category_sp->AddTypeSynthetic(
1271 "^std::(__cxx11::)?forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
1273 stl_synth_flags,
1274 "lldb.formatters.cpp.gnu_libstdcpp.StdForwardListSynthProvider")));
1275 cpp_category_sp->AddTypeSynthetic(
1276 "^std::variant<.+>$", eFormatterMatchRegex,
1278 stl_synth_flags,
1279 "lldb.formatters.cpp.gnu_libstdcpp.VariantSynthProvider")));
1280
1281 stl_summary_flags.SetDontShowChildren(false);
1282 stl_summary_flags.SetSkipPointers(false);
1283 cpp_category_sp->AddTypeSummary("^std::bitset<.+>(( )?&)?$",
1286 stl_summary_flags, "size=${svar%#}")));
1287 cpp_category_sp->AddTypeSummary("^std::vector<.+>(( )?&)?$",
1290 stl_summary_flags, "size=${svar%#}")));
1291 cpp_category_sp->AddTypeSummary("^std::map<.+> >(( )?&)?$",
1294 stl_summary_flags, "size=${svar%#}")));
1295 cpp_category_sp->AddTypeSummary("^std::set<.+> >(( )?&)?$",
1298 stl_summary_flags, "size=${svar%#}")));
1299 cpp_category_sp->AddTypeSummary("^std::deque<.+>(( )?&)?$",
1302 stl_summary_flags, "size=${svar%#}")));
1303 cpp_category_sp->AddTypeSummary("^std::multimap<.+> >(( )?&)?$",
1306 stl_summary_flags, "size=${svar%#}")));
1307 cpp_category_sp->AddTypeSummary("^std::multiset<.+> >(( )?&)?$",
1310 stl_summary_flags, "size=${svar%#}")));
1311 cpp_category_sp->AddTypeSummary("^std::unordered_(multi)?(map|set)<.+> >$",
1314 stl_summary_flags, "size=${svar%#}")));
1315 cpp_category_sp->AddTypeSummary("^std::(__cxx11::)?list<.+>(( )?&)?$",
1318 stl_summary_flags, "size=${svar%#}")));
1319 cpp_category_sp->AddTypeSummary(
1320 "^std::(__cxx11::)?forward_list<.+>(( )?&)?$", eFormatterMatchRegex,
1322 stl_summary_flags,
1323 "lldb.formatters.cpp.gnu_libstdcpp.ForwardListSummaryProvider")));
1324 cpp_category_sp->AddTypeSummary(
1325 "^std::variant<.+>$", eFormatterMatchRegex,
1327 stl_summary_flags,
1328 "lldb.formatters.cpp.gnu_libstdcpp.VariantSummaryProvider")));
1329
1331 cpp_category_sp,
1333 "std::vector iterator synthetic children",
1334 "^__gnu_cxx::__normal_iterator<.+>$", stl_synth_flags, true);
1335
1337 cpp_category_sp,
1339 "std::map iterator synthetic children", "^std::_Rb_tree_iterator<.+>$",
1340 stl_synth_flags, true);
1341
1343 cpp_category_sp,
1345 "std::unique_ptr synthetic children", "^std::unique_ptr<.+>(( )?&)?$",
1346 stl_synth_flags, true);
1348 cpp_category_sp,
1350 "std::shared_ptr synthetic children", "^std::shared_ptr<.+>(( )?&)?$",
1351 stl_synth_flags, true);
1353 cpp_category_sp,
1355 "std::weak_ptr synthetic children", "^std::weak_ptr<.+>(( )?&)?$",
1356 stl_synth_flags, true);
1358 cpp_category_sp,
1360 "std::tuple synthetic children", "^std::tuple<.+>(( )?&)?$",
1361 stl_synth_flags, true);
1362
1363 static constexpr const char *const libstdcpp_std_coroutine_handle_regex =
1364 "^std::coroutine_handle<.+>(( )?&)?$";
1366 cpp_category_sp,
1368 "std::coroutine_handle synthetic children",
1369 libstdcpp_std_coroutine_handle_regex, stl_deref_flags, true);
1370
1372 cpp_category_sp,
1374 "std::bitset synthetic child", "^std::bitset<.+>(( )?&)?$",
1375 stl_deref_flags, true);
1376
1378 cpp_category_sp,
1380 "std::optional synthetic child", "^std::optional<.+>(( )?&)?$",
1381 stl_deref_flags, true);
1382
1383 AddCXXSummary(cpp_category_sp,
1385 "libstdc++ std::unique_ptr summary provider",
1386 "^std::unique_ptr<.+>(( )?&)?$", stl_summary_flags, true);
1387 AddCXXSummary(cpp_category_sp,
1389 "libstdc++ std::shared_ptr summary provider",
1390 "^std::shared_ptr<.+>(( )?&)?$", stl_summary_flags, true);
1391 AddCXXSummary(cpp_category_sp,
1393 "libstdc++ std::weak_ptr summary provider",
1394 "^std::weak_ptr<.+>(( )?&)?$", stl_summary_flags, true);
1395 AddCXXSummary(cpp_category_sp,
1397 "libstdc++ std::coroutine_handle summary provider",
1398 libstdcpp_std_coroutine_handle_regex, stl_summary_flags, true);
1399 AddCXXSummary(cpp_category_sp,
1401 "libstd++ std::optional summary provider",
1402 "^std::optional<.+>(( )?&)?$", stl_summary_flags, true);
1403}
1404
1406 if (!cpp_category_sp)
1407 return;
1408
1409 TypeSummaryImpl::Flags string_flags;
1410 string_flags.SetCascades(true)
1411 .SetSkipPointers(true)
1412 .SetSkipReferences(false)
1413 .SetDontShowChildren(true)
1414 .SetDontShowValue(false)
1416 .SetHideItemNames(false);
1417
1418 TypeSummaryImpl::Flags string_array_flags;
1419 string_array_flags.SetCascades(true)
1420 .SetSkipPointers(true)
1421 .SetSkipReferences(false)
1422 .SetDontShowChildren(true)
1423 .SetDontShowValue(true)
1425 .SetHideItemNames(false);
1426
1427 AddCXXSummary(cpp_category_sp,
1429 "char8_t * summary provider", "char8_t *", string_flags);
1430 AddCXXSummary(cpp_category_sp,
1432 "char8_t [] summary provider", "char8_t ?\\[[0-9]+\\]",
1433 string_array_flags, true);
1434
1435 AddCXXSummary(cpp_category_sp,
1437 "char16_t * summary provider", "char16_t *", string_flags);
1438 AddCXXSummary(cpp_category_sp,
1440 "char16_t [] summary provider", "char16_t ?\\[[0-9]+\\]",
1441 string_array_flags, true);
1442
1443 AddCXXSummary(cpp_category_sp,
1445 "char32_t * summary provider", "char32_t *", string_flags);
1446 AddCXXSummary(cpp_category_sp,
1448 "char32_t [] summary provider", "char32_t ?\\[[0-9]+\\]",
1449 string_array_flags, true);
1450
1451 AddCXXSummary(cpp_category_sp,
1453 "wchar_t * summary provider", "wchar_t *", string_flags);
1454 AddCXXSummary(cpp_category_sp,
1456 "wchar_t * summary provider", "wchar_t ?\\[[0-9]+\\]",
1457 string_array_flags, true);
1458
1459 AddCXXSummary(cpp_category_sp,
1461 "unichar * summary provider", "unichar *", string_flags);
1462
1463 TypeSummaryImpl::Flags widechar_flags;
1464 widechar_flags.SetDontShowValue(true)
1465 .SetSkipPointers(true)
1466 .SetSkipReferences(false)
1467 .SetCascades(true)
1468 .SetDontShowChildren(true)
1469 .SetHideItemNames(true)
1470 .SetShowMembersOneLiner(false);
1471
1473 "char8_t summary provider", "char8_t", widechar_flags);
1474 AddCXXSummary(cpp_category_sp,
1476 "char16_t summary provider", "char16_t", widechar_flags);
1477 AddCXXSummary(cpp_category_sp,
1479 "char32_t summary provider", "char32_t", widechar_flags);
1481 "wchar_t summary provider", "wchar_t", widechar_flags);
1482
1483 AddCXXSummary(cpp_category_sp,
1485 "unichar summary provider", "unichar", widechar_flags);
1486}
1487
1488std::unique_ptr<Language::TypeScavenger> CPlusPlusLanguage::GetTypeScavenger() {
1489 class CPlusPlusTypeScavenger : public Language::ImageListTypeScavenger {
1490 public:
1491 CompilerType AdjustForInclusion(CompilerType &candidate) override {
1492 LanguageType lang_type(candidate.GetMinimumLanguage());
1493 if (!Language::LanguageIsC(lang_type) &&
1495 return CompilerType();
1496 if (candidate.IsTypedefType())
1497 return candidate.GetTypedefedType();
1498 return candidate;
1499 }
1500 };
1501
1502 return std::unique_ptr<TypeScavenger>(new CPlusPlusTypeScavenger());
1503}
1504
1506 static llvm::once_flag g_initialize;
1507 static TypeCategoryImplSP g_category;
1508
1509 llvm::call_once(g_initialize, [this]() -> void {
1511 g_category);
1512 if (g_category) {
1513 LoadLibStdcppFormatters(g_category);
1514 LoadLibCxxFormatters(g_category);
1515 LoadSystemFormatters(g_category);
1516 }
1517 });
1518 return g_category;
1519}
1520
1523 static llvm::once_flag g_initialize;
1524 static ConstString g_vectortypes("VectorTypes");
1526
1527 llvm::call_once(g_initialize, []() -> void {
1528 g_formatters.push_back(
1531 static CXXFunctionSummaryFormat::SharedPointer formatter_sp(
1535 "Function pointer summary provider"));
1536 if (CompilerType CT = valobj.GetCompilerType();
1537 CT.IsFunctionPointerType() || CT.IsMemberFunctionPointerType() ||
1539 return formatter_sp;
1540 }
1541 return nullptr;
1542 });
1543 g_formatters.push_back(
1546 static CXXFunctionSummaryFormat::SharedPointer formatter_sp(
1549 .SetCascades(true)
1550 .SetDontShowChildren(true)
1551 .SetHideItemNames(true)
1552 .SetShowMembersOneLiner(true)
1553 .SetSkipPointers(true)
1554 .SetSkipReferences(false),
1556 "vector_type pointer summary provider"));
1557 if (valobj.GetCompilerType().IsVectorType()) {
1558 if (fmt_mgr.GetCategory(g_vectortypes)->IsEnabled())
1559 return formatter_sp;
1560 }
1561 return nullptr;
1562 });
1563 g_formatters.push_back(
1566 static CXXFunctionSummaryFormat::SharedPointer formatter_sp(
1569 .SetCascades(true)
1570 .SetDontShowChildren(true)
1571 .SetHideItemNames(true)
1572 .SetShowMembersOneLiner(true)
1573 .SetSkipPointers(true)
1574 .SetSkipReferences(false),
1576 "block pointer summary provider"));
1577 if (valobj.GetCompilerType().IsBlockPointerType()) {
1578 return formatter_sp;
1579 }
1580 return nullptr;
1581 });
1582 });
1583
1584 return g_formatters;
1585}
1586
1589 static llvm::once_flag g_initialize;
1590 static ConstString g_vectortypes("VectorTypes");
1592
1593 llvm::call_once(g_initialize, []() -> void {
1594 g_formatters.push_back([](lldb_private::ValueObject &valobj,
1597 static CXXSyntheticChildren::SharedPointer formatter_sp(
1600 .SetCascades(true)
1601 .SetSkipPointers(true)
1602 .SetSkipReferences(true)
1603 .SetNonCacheable(true),
1604 "vector_type synthetic children",
1606 if (valobj.GetCompilerType().IsVectorType()) {
1607 if (fmt_mgr.GetCategory(g_vectortypes)->IsEnabled())
1608 return formatter_sp;
1609 }
1610 return nullptr;
1611 });
1612 g_formatters.push_back([](lldb_private::ValueObject &valobj,
1615 static CXXSyntheticChildren::SharedPointer formatter_sp(
1618 .SetCascades(true)
1619 .SetSkipPointers(true)
1620 .SetSkipReferences(true)
1621 .SetNonCacheable(true),
1622 "block pointer synthetic children",
1624 if (valobj.GetCompilerType().IsBlockPointerType()) {
1625 return formatter_sp;
1626 }
1627 return nullptr;
1628 });
1629 });
1630
1631 return g_formatters;
1632}
1633
1636 !valobj.IsPointerType())
1637 return false;
1638 bool canReadValue = true;
1639 bool isZero = valobj.GetValueAsUnsigned(0, &canReadValue) == 0;
1640 return canReadValue && isZero;
1641}
1642
1643bool CPlusPlusLanguage::IsSourceFile(llvm::StringRef file_path) const {
1644 const auto suffixes = {".cpp", ".cxx", ".c++", ".cc", ".c",
1645 ".h", ".hh", ".hpp", ".hxx", ".h++"};
1646 for (auto suffix : suffixes) {
1647 if (file_path.ends_with_insensitive(suffix))
1648 return true;
1649 }
1650
1651 // Check if we're in a STL path (where the files usually have no extension
1652 // that we could check for.
1653 return file_path.contains("/usr/include/c++/");
1654}
1655
1657 const SymbolContext *sc, const ExecutionContext *exe_ctx,
1658 FunctionNameRepresentation representation, Stream &s) {
1659 switch (representation) {
1661 // Print the function name with arguments in it
1662 if (sc->function) {
1663 ExecutionContextScope *exe_scope =
1664 exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr;
1665 const char *cstr = sc->function->GetName().AsCString(nullptr);
1666 if (cstr) {
1667 const InlineFunctionInfo *inline_info = nullptr;
1668 VariableListSP variable_list_sp;
1669 bool get_function_vars = true;
1670 if (sc->block) {
1671 Block *inline_block = sc->block->GetContainingInlinedBlock();
1672
1673 if (inline_block) {
1674 get_function_vars = false;
1675 inline_info = inline_block->GetInlinedFunctionInfo();
1676 if (inline_info)
1677 variable_list_sp = inline_block->GetBlockVariableList(true);
1678 }
1679 }
1680
1681 if (get_function_vars) {
1682 variable_list_sp =
1683 sc->function->GetBlock(true).GetBlockVariableList(true);
1684 }
1685
1686 if (inline_info) {
1687 s.PutCString(cstr);
1688 s.PutCString(" [inlined] ");
1689 cstr = inline_info->GetName().GetCString();
1690 }
1691
1692 VariableList args;
1693 if (variable_list_sp)
1695 args);
1696 if (args.GetSize() > 0) {
1697 if (!PrettyPrintFunctionNameWithArgs(s, cstr, exe_scope, args))
1698 return false;
1699 } else {
1700 s.PutCString(cstr);
1701 }
1702 return true;
1703 }
1704 } else if (sc->symbol) {
1705 const char *cstr = sc->symbol->GetName().AsCString(nullptr);
1706 if (cstr) {
1707 s.PutCString(cstr);
1708 return true;
1709 }
1710 }
1711 } break;
1712 default:
1713 return false;
1714 }
1715
1716 return false;
1717}
static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp)
static bool IsTrivialBasename(const llvm::StringRef &basename)
static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp)
static bool ReverseFindMatchingChars(const llvm::StringRef &s, const llvm::StringRef &left_right_chars, size_t &left_pos, size_t &right_pos, size_t pos=llvm::StringRef::npos)
static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp)
static void PrettyPrintFunctionNameWithArgs(Stream &out_stream, char const *full_name, ExecutionContextScope *exe_scope, VariableList const &args)
Writes out the function name in 'full_name' to 'out_stream' but replaces each argument type with the ...
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:342
#define LLDB_PLUGIN_DEFINE(PluginName)
Definition: PluginManager.h:31
static bool IsMSVCUndecoratedName(llvm::StringRef name)
static bool ExtractContextAndIdentifier(llvm::StringRef name, llvm::StringRef &context, llvm::StringRef &identifier)
A command line argument class.
Definition: Args.h:33
A class that describes a single lexical block.
Definition: Block.h:41
lldb::VariableListSP GetBlockVariableList(bool can_create)
Get the variable list for this block only.
Definition: Block.cpp:399
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
Definition: Block.cpp:208
const InlineFunctionInfo * GetInlinedFunctionInfo() const
Get const accessor for any inlined function information.
Definition: Block.h:276
llvm::StringRef GetReturnType()
Returns the methods return-type.
llvm::StringRef GetBasenameNoTemplateParameters()
Returns the Basename of this method without a template parameter list, if any.
bool GetFunctionDisplayName(const SymbolContext *sc, const ExecutionContext *exe_ctx, FunctionNameRepresentation representation, Stream &s) override
bool IsNilReference(ValueObject &valobj) override
bool IsSourceFile(llvm::StringRef file_path) const override
ConstString GetDemangledFunctionNameWithoutArguments(Mangled mangled) const override
lldb::TypeCategoryImplSP GetFormatters() override
bool SymbolNameFitsToLanguage(Mangled mangled) const override
Returns true iff the given symbol name is compatible with the mangling scheme of this language.
HardcodedFormatters::HardcodedSyntheticFinder GetHardcodedSynthetics() override
static bool IsCPPMangledName(llvm::StringRef name)
llvm::StringRef GetPluginName() override
std::vector< ConstString > GenerateAlternateFunctionManglings(const ConstString mangled) const override
bool DemangledNameContainsPath(llvm::StringRef path, ConstString demangled) const override
ConstString FindBestAlternateFunctionMangledName(const Mangled mangled, const SymbolContext &sym_ctx) const override
static bool ExtractContextAndIdentifier(const char *name, llvm::StringRef &context, llvm::StringRef &identifier)
std::unique_ptr< TypeScavenger > GetTypeScavenger() override
HardcodedFormatters::HardcodedSummaryFinder GetHardcodedSummaries() override
static lldb_private::Language * CreateInstance(lldb::LanguageType language)
std::optional< ParsedFunction > ParseAsFunctionDefinition()
std::optional< ParsedName > ParseAsFullName()
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
lldb::LanguageType GetMinimumLanguage()
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr=nullptr) const
CompilerType GetTypedefedType() const
If the current object represents a typedef type, get the underlying type.
bool IsFunctionPointerType() const
bool IsVectorType(CompilerType *element_type=nullptr, uint64_t *size=nullptr) const
A uniqued constant string class.
Definition: ConstString.h:40
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:188
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:197
void Clear()
Clear this object's state.
Definition: ConstString.h:230
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:214
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
lldb::TypeCategoryImplSP GetCategory(const char *category_name=nullptr, bool can_create=true)
Definition: FormatManager.h:99
ConstString GetName() const
Definition: Function.cpp:692
Block & GetBlock(bool can_create)
Get accessor for the block list.
Definition: Function.cpp:370
HardcodedFormatterFinders< SyntheticChildren > HardcodedSyntheticFinder
Definition: FormatClasses.h:42
HardcodedFormatterFinders< TypeSummaryImpl > HardcodedSummaryFinder
Definition: FormatClasses.h:41
A class that describes information for an inlined function.
Definition: Function.h:125
ConstString GetName() const
Definition: Function.cpp:96
static bool LanguageIsC(lldb::LanguageType language)
Definition: Language.cpp:293
static bool LanguageIsCPlusPlus(lldb::LanguageType language)
Definition: Language.cpp:268
A class that handles mangled names.
Definition: Mangled.h:33
static Mangled::ManglingScheme GetManglingScheme(llvm::StringRef const name)
Try to identify the mangling scheme used.
Definition: Mangled.cpp:41
ConstString GetDemangledName() const
Demangled name get accessor.
Definition: Mangled.cpp:260
ConstString & GetMangledName()
Mangled name get accessor.
Definition: Mangled.h:145
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:65
size_t PutChar(char ch)
Definition: Stream.cpp:131
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:34
Function * function
The Function for a given query.
Block * block
The Block for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
Symbol * symbol
The Symbol for a given query.
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
virtual void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
Definition: SymbolFile.cpp:133
ConstString GetName() const
Definition: Symbol.cpp:552
Flags & SetSkipReferences(bool value=true)
Flags & SetFrontEndWantsDereference(bool value=true)
Flags & SetSkipPointers(bool value=true)
Flags & SetCascades(bool value=true)
std::shared_ptr< SyntheticChildren > SharedPointer
Flags & SetCascades(bool value=true)
Definition: TypeSummary.h:82
Flags & SetSkipPointers(bool value=true)
Definition: TypeSummary.h:95
Flags & SetHideItemNames(bool value=true)
Definition: TypeSummary.h:173
Flags & SetDontShowChildren(bool value=true)
Definition: TypeSummary.h:121
Flags & SetSkipReferences(bool value=true)
Definition: TypeSummary.h:108
Flags & SetShowMembersOneLiner(bool value=true)
Definition: TypeSummary.h:160
Flags & SetDontShowValue(bool value=true)
Definition: TypeSummary.h:147
std::shared_ptr< TypeSummaryImpl > SharedPointer
Definition: TypeSummary.h:263
CompilerType GetCompilerType()
Definition: ValueObject.h:352
virtual uint64_t GetValueAsUnsigned(uint64_t fail_value, bool *success=nullptr)
virtual lldb::ValueType GetValueType() const =0
lldb::LanguageType GetObjectRuntimeLanguage()
Definition: ValueObject.h:373
size_t AppendVariablesWithScope(lldb::ValueType type, VariableList &var_list, bool if_unique=true)
void PrettyPrintFunctionArguments(Stream &out_stream, VariableList const &args, ExecutionContextScope *exe_scope)
For each variable in 'args' this function writes the variable name and it's pretty-printed value repr...
SyntheticChildrenFrontEnd * LibCxxUnorderedMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:539
SyntheticChildrenFrontEnd * LibStdcppOptionalSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxStdSpanSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxSpan.cpp:142
bool Char32StringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibcxxChronoSysSecondsSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1090
bool LibcxxChronoMonthSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1161
SyntheticChildrenFrontEnd * LibcxxUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:658
bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:169
SyntheticChildrenFrontEnd * LibStdcppUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool WCharSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibcxxSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:127
bool LibcxxStringViewSummaryProviderASCII(ValueObject &valueObj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1051
bool LibcxxStringViewSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1058
SyntheticChildrenFrontEnd * LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:555
bool VectorTypeSummaryProvider(ValueObject &, Stream &, const TypeSummaryOptions &)
Definition: VectorType.cpp:284
SyntheticChildrenFrontEnd * LibStdcppTupleSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxStringViewSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1065
SyntheticChildrenFrontEnd * VectorTypeSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: VectorType.cpp:322
bool LibStdcppSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcpp.cpp:430
SyntheticChildrenFrontEnd * LibcxxQueueFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxQueue.cpp:60
bool LibStdcppStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcpp.cpp:240
SyntheticChildrenFrontEnd * BlockPointerSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
void AddCXXSummary(TypeCategoryImpl::SharedPointer category_sp, CXXFunctionSummaryFormat::Callback funct, const char *description, llvm::StringRef type_name, TypeSummaryImpl::Flags flags, bool regex=false)
Add a summary that is implemented by a C++ callback.
bool LibcxxChronoYearMonthDaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1203
bool LibStdcppUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibcxxWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:904
SyntheticChildrenFrontEnd * LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxTuple.cpp:88
bool LibcxxStringSummaryProviderASCII(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:991
SyntheticChildrenFrontEnd * StdlibCoroutineHandleSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: Coroutines.cpp:221
SyntheticChildrenFrontEnd * LibcxxStdRangesRefViewSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxWStringViewSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1072
bool Char8SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibStdcppWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcpp.cpp:296
bool LibcxxChronoWeekdaySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1182
SyntheticChildrenFrontEnd * LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxOptionalSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
SyntheticChildrenFrontEnd * LibStdcppVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcpp.cpp:180
bool LibcxxStringSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:998
bool Char16SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibcxxFunctionSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:79
bool LibcxxStringSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:1005
SyntheticChildrenFrontEnd * LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:417
void AddCXXSynthetic(TypeCategoryImpl::SharedPointer category_sp, CXXSyntheticChildren::CreateFrontEndCallback generator, const char *description, llvm::StringRef type_name, ScriptedSyntheticChildren::Flags flags, bool regex=false)
Add a synthetic that is implemented by a C++ callback.
SyntheticChildrenFrontEnd * LibcxxStdValarraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibstdcppMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcpp.cpp:163
bool Char8StringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
SyntheticChildrenFrontEnd * LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxMap.cpp:431
SyntheticChildrenFrontEnd * LibStdcppBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
SyntheticChildrenFrontEnd * LibcxxVariantFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
SyntheticChildrenFrontEnd * LibStdcppSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcpp.cpp:424
bool StdlibCoroutineHandleSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Summary provider for std::coroutine_handle<T> from libc++, libstdc++ and MSVC STL.
Definition: Coroutines.cpp:81
bool LibcxxVariantSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool LibCxxAtomicSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool Char16StringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
SyntheticChildrenFrontEnd * LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool WCharStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
SyntheticChildrenFrontEnd * LibcxxAtomicSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool GenericOptionalSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
SyntheticChildrenFrontEnd * LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:733
bool BlockPointerSummaryProvider(ValueObject &, Stream &, const TypeSummaryOptions &)
SyntheticChildrenFrontEnd * LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:423
SyntheticChildrenFrontEnd * LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:641
SyntheticChildrenFrontEnd * LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:390
bool LibcxxChronoSysDaysSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:1126
bool Char32SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
bool CXXFunctionPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:314
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
Definition: lldb-forward.h:463
LanguageType
Programming language type.
@ eLanguageTypeObjC_plus_plus
Objective-C++.
@ eFormatterMatchExact
@ eFormatterMatchRegex
std::shared_ptr< lldb_private::VariableList > VariableListSP
Definition: lldb-forward.h:475
std::shared_ptr< lldb_private::SyntheticChildren > SyntheticChildrenSP
Definition: lldb-forward.h:433
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
Definition: lldb-forward.h:451
@ eValueTypeVTableEntry
function pointer in virtual function table
@ eValueTypeVariableArgument
function argument variables
std::shared_ptr< CXXFunctionSummaryFormat > SharedPointer
Definition: TypeSummary.h:343