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"
30 #include "lldb/Symbol/SymbolFile.h"
32 #include "lldb/Utility/Log.h"
34 
35 #include "BlockPointer.h"
36 #include "CPlusPlusNameParser.h"
37 #include "CxxStringTypes.h"
38 #include "LibCxx.h"
39 #include "LibCxxAtomic.h"
40 #include "LibCxxVariant.h"
41 #include "LibStdcpp.h"
43 
44 using namespace lldb;
45 using namespace lldb_private;
46 using namespace lldb_private::formatters;
47 
49 
50 void CPlusPlusLanguage::Initialize() {
51  PluginManager::RegisterPlugin(GetPluginNameStatic(), "C++ Language",
52  CreateInstance);
53 }
54 
55 void CPlusPlusLanguage::Terminate() {
56  PluginManager::UnregisterPlugin(CreateInstance);
57 }
58 
59 bool CPlusPlusLanguage::SymbolNameFitsToLanguage(Mangled mangled) const {
60  const char *mangled_name = mangled.GetMangledName().GetCString();
61  return mangled_name && CPlusPlusLanguage::IsCPPMangledName(mangled_name);
62 }
63 
64 ConstString CPlusPlusLanguage::GetDemangledFunctionNameWithoutArguments(
65  Mangled mangled) const {
66  const char *mangled_name_cstr = mangled.GetMangledName().GetCString();
67  ConstString demangled_name = mangled.GetDemangledName();
68  if (demangled_name && mangled_name_cstr && mangled_name_cstr[0]) {
69  if (mangled_name_cstr[0] == '_' && mangled_name_cstr[1] == 'Z' &&
70  (mangled_name_cstr[2] != 'T' && // avoid virtual table, VTT structure,
71  // typeinfo structure, and typeinfo
72  // mangled_name
73  mangled_name_cstr[2] != 'G' && // avoid guard variables
74  mangled_name_cstr[2] != 'Z')) // named local entities (if we
75  // eventually handle eSymbolTypeData,
76  // we will want this back)
77  {
78  CPlusPlusLanguage::MethodName cxx_method(demangled_name);
79  if (!cxx_method.GetBasename().empty()) {
80  std::string shortname;
81  if (!cxx_method.GetContext().empty())
82  shortname = cxx_method.GetContext().str() + "::";
83  shortname += cxx_method.GetBasename().str();
84  return ConstString(shortname);
85  }
86  }
87  }
88  if (demangled_name)
89  return demangled_name;
90  return mangled.GetMangledName();
91 }
92 
93 // Static Functions
94 
95 Language *CPlusPlusLanguage::CreateInstance(lldb::LanguageType language) {
96  // Use plugin for C++ but not for Objective-C++ (which has its own plugin).
97  if (Language::LanguageIsCPlusPlus(language) &&
98  language != eLanguageTypeObjC_plus_plus)
99  return new CPlusPlusLanguage();
100  return nullptr;
101 }
102 
103 void CPlusPlusLanguage::MethodName::Clear() {
104  m_full.Clear();
105  m_basename = llvm::StringRef();
106  m_context = llvm::StringRef();
107  m_arguments = llvm::StringRef();
108  m_qualifiers = llvm::StringRef();
109  m_parsed = false;
110  m_parse_error = false;
111 }
112 
113 static bool ReverseFindMatchingChars(const llvm::StringRef &s,
114  const llvm::StringRef &left_right_chars,
115  size_t &left_pos, size_t &right_pos,
116  size_t pos = llvm::StringRef::npos) {
117  assert(left_right_chars.size() == 2);
118  left_pos = llvm::StringRef::npos;
119  const char left_char = left_right_chars[0];
120  const char right_char = left_right_chars[1];
121  pos = s.find_last_of(left_right_chars, pos);
122  if (pos == llvm::StringRef::npos || s[pos] == left_char)
123  return false;
124  right_pos = pos;
125  uint32_t depth = 1;
126  while (pos > 0 && depth > 0) {
127  pos = s.find_last_of(left_right_chars, pos);
128  if (pos == llvm::StringRef::npos)
129  return false;
130  if (s[pos] == left_char) {
131  if (--depth == 0) {
132  left_pos = pos;
133  return left_pos < right_pos;
134  }
135  } else if (s[pos] == right_char) {
136  ++depth;
137  }
138  }
139  return false;
140 }
141 
142 static bool IsTrivialBasename(const llvm::StringRef &basename) {
143  // Check that the basename matches with the following regular expression
144  // "^~?([A-Za-z_][A-Za-z_0-9]*)$" We are using a hand written implementation
145  // because it is significantly more efficient then using the general purpose
146  // regular expression library.
147  size_t idx = 0;
148  if (basename.size() > 0 && basename[0] == '~')
149  idx = 1;
150 
151  if (basename.size() <= idx)
152  return false; // Empty string or "~"
153 
154  if (!std::isalpha(basename[idx]) && basename[idx] != '_')
155  return false; // First character (after removing the possible '~'') isn't in
156  // [A-Za-z_]
157 
158  // Read all characters matching [A-Za-z_0-9]
159  ++idx;
160  while (idx < basename.size()) {
161  if (!std::isalnum(basename[idx]) && basename[idx] != '_')
162  break;
163  ++idx;
164  }
165 
166  // We processed all characters. It is a vaild basename.
167  return idx == basename.size();
168 }
169 
170 bool CPlusPlusLanguage::MethodName::TrySimplifiedParse() {
171  // This method tries to parse simple method definitions which are presumably
172  // most comman in user programs. Definitions that can be parsed by this
173  // function don't have return types and templates in the name.
174  // A::B::C::fun(std::vector<T> &) const
175  size_t arg_start, arg_end;
176  llvm::StringRef full(m_full.GetCString());
177  llvm::StringRef parens("()", 2);
178  if (ReverseFindMatchingChars(full, parens, arg_start, arg_end)) {
179  m_arguments = full.substr(arg_start, arg_end - arg_start + 1);
180  if (arg_end + 1 < full.size())
181  m_qualifiers = full.substr(arg_end + 1).ltrim();
182 
183  if (arg_start == 0)
184  return false;
185  size_t basename_end = arg_start;
186  size_t context_start = 0;
187  size_t context_end = full.rfind(':', basename_end);
188  if (context_end == llvm::StringRef::npos)
189  m_basename = full.substr(0, basename_end);
190  else {
191  if (context_start < context_end)
192  m_context = full.substr(context_start, context_end - 1 - context_start);
193  const size_t basename_begin = context_end + 1;
194  m_basename = full.substr(basename_begin, basename_end - basename_begin);
195  }
196 
197  if (IsTrivialBasename(m_basename)) {
198  return true;
199  } else {
200  // The C++ basename doesn't match our regular expressions so this can't
201  // be a valid C++ method, clear everything out and indicate an error
202  m_context = llvm::StringRef();
203  m_basename = llvm::StringRef();
204  m_arguments = llvm::StringRef();
205  m_qualifiers = llvm::StringRef();
206  return false;
207  }
208  }
209  return false;
210 }
211 
212 void CPlusPlusLanguage::MethodName::Parse() {
213  if (!m_parsed && m_full) {
214  if (TrySimplifiedParse()) {
215  m_parse_error = false;
216  } else {
217  CPlusPlusNameParser parser(m_full.GetStringRef());
218  if (auto function = parser.ParseAsFunctionDefinition()) {
219  m_basename = function.getValue().name.basename;
220  m_context = function.getValue().name.context;
221  m_arguments = function.getValue().arguments;
222  m_qualifiers = function.getValue().qualifiers;
223  m_parse_error = false;
224  } else {
225  m_parse_error = true;
226  }
227  }
228  m_parsed = true;
229  }
230 }
231 
232 llvm::StringRef CPlusPlusLanguage::MethodName::GetBasename() {
233  if (!m_parsed)
234  Parse();
235  return m_basename;
236 }
237 
238 llvm::StringRef CPlusPlusLanguage::MethodName::GetContext() {
239  if (!m_parsed)
240  Parse();
241  return m_context;
242 }
243 
244 llvm::StringRef CPlusPlusLanguage::MethodName::GetArguments() {
245  if (!m_parsed)
246  Parse();
247  return m_arguments;
248 }
249 
250 llvm::StringRef CPlusPlusLanguage::MethodName::GetQualifiers() {
251  if (!m_parsed)
252  Parse();
253  return m_qualifiers;
254 }
255 
256 std::string CPlusPlusLanguage::MethodName::GetScopeQualifiedName() {
257  if (!m_parsed)
258  Parse();
259  if (m_context.empty())
260  return std::string(m_basename);
261 
262  std::string res;
263  res += m_context;
264  res += "::";
265  res += m_basename;
266  return res;
267 }
268 
269 bool CPlusPlusLanguage::IsCPPMangledName(llvm::StringRef name) {
270  // FIXME!! we should really run through all the known C++ Language plugins
271  // and ask each one if this is a C++ mangled name
272 
273  Mangled::ManglingScheme scheme = Mangled::GetManglingScheme(name);
274 
275  if (scheme == Mangled::eManglingSchemeNone)
276  return false;
277 
278  return true;
279 }
280 
281 bool CPlusPlusLanguage::ExtractContextAndIdentifier(
282  const char *name, llvm::StringRef &context, llvm::StringRef &identifier) {
285  identifier);
286 
287  CPlusPlusNameParser parser(name);
288  if (auto full_name = parser.ParseAsFullName()) {
289  identifier = full_name.getValue().basename;
290  context = full_name.getValue().context;
291  return true;
292  }
293  return false;
294 }
295 
296 namespace {
297 class NodeAllocator {
298  llvm::BumpPtrAllocator Alloc;
299 
300 public:
301  void reset() { Alloc.Reset(); }
302 
303  template <typename T, typename... Args> T *makeNode(Args &&... args) {
304  return new (Alloc.Allocate(sizeof(T), alignof(T)))
305  T(std::forward<Args>(args)...);
306  }
307 
308  void *allocateNodeArray(size_t sz) {
309  return Alloc.Allocate(sizeof(llvm::itanium_demangle::Node *) * sz,
310  alignof(llvm::itanium_demangle::Node *));
311  }
312 };
313 
314 template <typename Derived>
315 class ManglingSubstitutor
316  : public llvm::itanium_demangle::AbstractManglingParser<Derived,
317  NodeAllocator> {
318  using Base =
319  llvm::itanium_demangle::AbstractManglingParser<Derived, NodeAllocator>;
320 
321 public:
322  ManglingSubstitutor() : Base(nullptr, nullptr) {}
323 
324  template <typename... Ts>
325  ConstString substitute(llvm::StringRef Mangled, Ts &&... Vals) {
326  this->getDerived().reset(Mangled, std::forward<Ts>(Vals)...);
327  return substituteImpl(Mangled);
328  }
329 
330 protected:
331  void reset(llvm::StringRef Mangled) {
332  Base::reset(Mangled.begin(), Mangled.end());
333  Written = Mangled.begin();
334  Result.clear();
335  Substituted = false;
336  }
337 
338  ConstString substituteImpl(llvm::StringRef Mangled) {
340  if (this->parse() == nullptr) {
341  LLDB_LOG(log, "Failed to substitute mangling in {0}", Mangled);
342  return ConstString();
343  }
344  if (!Substituted)
345  return ConstString();
346 
347  // Append any trailing unmodified input.
348  appendUnchangedInput();
349  LLDB_LOG(log, "Substituted mangling {0} -> {1}", Mangled, Result);
350  return ConstString(Result);
351  }
352 
353  void trySubstitute(llvm::StringRef From, llvm::StringRef To) {
354  if (!llvm::StringRef(currentParserPos(), this->numLeft()).startswith(From))
355  return;
356 
357  // We found a match. Append unmodified input up to this point.
358  appendUnchangedInput();
359 
360  // And then perform the replacement.
361  Result += To;
362  Written += From.size();
363  Substituted = true;
364  }
365 
366 private:
367  /// Input character until which we have constructed the respective output
368  /// already.
369  const char *Written;
370 
371  llvm::SmallString<128> Result;
372 
373  /// Whether we have performed any substitutions.
374  bool Substituted;
375 
376  const char *currentParserPos() const { return this->First; }
377 
378  void appendUnchangedInput() {
379  Result +=
380  llvm::StringRef(Written, std::distance(Written, currentParserPos()));
381  Written = currentParserPos();
382  }
383 };
384 
385 /// Given a mangled function `Mangled`, replace all the primitive function type
386 /// arguments of `Search` with type `Replace`.
387 class TypeSubstitutor : public ManglingSubstitutor<TypeSubstitutor> {
388  llvm::StringRef Search;
389  llvm::StringRef Replace;
390 
391 public:
392  void reset(llvm::StringRef Mangled, llvm::StringRef Search,
393  llvm::StringRef Replace) {
394  ManglingSubstitutor::reset(Mangled);
395  this->Search = Search;
396  this->Replace = Replace;
397  }
398 
399  llvm::itanium_demangle::Node *parseType() {
400  trySubstitute(Search, Replace);
401  return ManglingSubstitutor::parseType();
402  }
403 };
404 
405 class CtorDtorSubstitutor : public ManglingSubstitutor<CtorDtorSubstitutor> {
406 public:
407  llvm::itanium_demangle::Node *
408  parseCtorDtorName(llvm::itanium_demangle::Node *&SoFar, NameState *State) {
409  trySubstitute("C1", "C2");
410  trySubstitute("D1", "D2");
411  return ManglingSubstitutor::parseCtorDtorName(SoFar, State);
412  }
413 };
414 } // namespace
415 
416 std::vector<ConstString> CPlusPlusLanguage::GenerateAlternateFunctionManglings(
417  const ConstString mangled_name) const {
418  std::vector<ConstString> alternates;
419 
420  /// Get a basic set of alternative manglings for the given symbol `name`, by
421  /// making a few basic possible substitutions on basic types, storage duration
422  /// and `const`ness for the given symbol. The output parameter `alternates`
423  /// is filled with a best-guess, non-exhaustive set of different manglings
424  /// for the given name.
425 
426  // Maybe we're looking for a const symbol but the debug info told us it was
427  // non-const...
428  if (!strncmp(mangled_name.GetCString(), "_ZN", 3) &&
429  strncmp(mangled_name.GetCString(), "_ZNK", 4)) {
430  std::string fixed_scratch("_ZNK");
431  fixed_scratch.append(mangled_name.GetCString() + 3);
432  alternates.push_back(ConstString(fixed_scratch));
433  }
434 
435  // Maybe we're looking for a static symbol but we thought it was global...
436  if (!strncmp(mangled_name.GetCString(), "_Z", 2) &&
437  strncmp(mangled_name.GetCString(), "_ZL", 3)) {
438  std::string fixed_scratch("_ZL");
439  fixed_scratch.append(mangled_name.GetCString() + 2);
440  alternates.push_back(ConstString(fixed_scratch));
441  }
442 
443  TypeSubstitutor TS;
444  // `char` is implementation defined as either `signed` or `unsigned`. As a
445  // result a char parameter has 3 possible manglings: 'c'-char, 'a'-signed
446  // char, 'h'-unsigned char. If we're looking for symbols with a signed char
447  // parameter, try finding matches which have the general case 'c'.
448  if (ConstString char_fixup =
449  TS.substitute(mangled_name.GetStringRef(), "a", "c"))
450  alternates.push_back(char_fixup);
451 
452  // long long parameter mangling 'x', may actually just be a long 'l' argument
453  if (ConstString long_fixup =
454  TS.substitute(mangled_name.GetStringRef(), "x", "l"))
455  alternates.push_back(long_fixup);
456 
457  // unsigned long long parameter mangling 'y', may actually just be unsigned
458  // long 'm' argument
459  if (ConstString ulong_fixup =
460  TS.substitute(mangled_name.GetStringRef(), "y", "m"))
461  alternates.push_back(ulong_fixup);
462 
463  if (ConstString ctor_fixup =
464  CtorDtorSubstitutor().substitute(mangled_name.GetStringRef()))
465  alternates.push_back(ctor_fixup);
466 
467  return alternates;
468 }
469 
470 ConstString CPlusPlusLanguage::FindBestAlternateFunctionMangledName(
471  const Mangled mangled, const SymbolContext &sym_ctx) const {
472  ConstString demangled = mangled.GetDemangledName();
473  if (!demangled)
474  return ConstString();
475 
476  CPlusPlusLanguage::MethodName cpp_name(demangled);
477  std::string scope_qualified_name = cpp_name.GetScopeQualifiedName();
478 
479  if (!scope_qualified_name.size())
480  return ConstString();
481 
482  if (!sym_ctx.module_sp)
483  return ConstString();
484 
485  lldb_private::SymbolFile *sym_file = sym_ctx.module_sp->GetSymbolFile();
486  if (!sym_file)
487  return ConstString();
488 
489  std::vector<ConstString> alternates;
490  sym_file->GetMangledNamesForFunction(scope_qualified_name, alternates);
491 
492  std::vector<ConstString> param_and_qual_matches;
493  std::vector<ConstString> param_matches;
494  for (size_t i = 0; i < alternates.size(); i++) {
495  ConstString alternate_mangled_name = alternates[i];
496  Mangled mangled(alternate_mangled_name);
497  ConstString demangled = mangled.GetDemangledName();
498 
499  CPlusPlusLanguage::MethodName alternate_cpp_name(demangled);
500  if (!cpp_name.IsValid())
501  continue;
502 
503  if (alternate_cpp_name.GetArguments() == cpp_name.GetArguments()) {
504  if (alternate_cpp_name.GetQualifiers() == cpp_name.GetQualifiers())
505  param_and_qual_matches.push_back(alternate_mangled_name);
506  else
507  param_matches.push_back(alternate_mangled_name);
508  }
509  }
510 
511  if (param_and_qual_matches.size())
512  return param_and_qual_matches[0]; // It is assumed that there will be only
513  // one!
514  else if (param_matches.size())
515  return param_matches[0]; // Return one of them as a best match
516  else
517  return ConstString();
518 }
519 
520 static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
521  if (!cpp_category_sp)
522  return;
523 
524  TypeSummaryImpl::Flags stl_summary_flags;
525  stl_summary_flags.SetCascades(true)
526  .SetSkipPointers(false)
527  .SetSkipReferences(false)
528  .SetDontShowChildren(true)
529  .SetDontShowValue(true)
530  .SetShowMembersOneLiner(false)
531  .SetHideItemNames(false);
532 
533  AddCXXSummary(cpp_category_sp,
535  "std::string summary provider",
536  ConstString("^std::__[[:alnum:]]+::string$"), stl_summary_flags,
537  true);
538  AddCXXSummary(cpp_category_sp,
540  "std::string summary provider",
541  ConstString("^std::__[[:alnum:]]+::basic_string<char, "
542  "std::__[[:alnum:]]+::char_traits<char>, "
543  "std::__[[:alnum:]]+::allocator<char> >$"),
544  stl_summary_flags, true);
545  AddCXXSummary(cpp_category_sp,
547  "std::string summary provider",
548  ConstString("^std::__[[:alnum:]]+::basic_string<unsigned char, "
549  "std::__[[:alnum:]]+::char_traits<unsigned char>, "
550  "std::__[[:alnum:]]+::allocator<unsigned char> >$"),
551  stl_summary_flags, true);
552 
553  AddCXXSummary(cpp_category_sp,
555  "std::u16string summary provider",
556  ConstString("^std::__[[:alnum:]]+::basic_string<char16_t, "
557  "std::__[[:alnum:]]+::char_traits<char16_t>, "
558  "std::__[[:alnum:]]+::allocator<char16_t> >$"),
559  stl_summary_flags, true);
560 
561  AddCXXSummary(cpp_category_sp,
563  "std::u32string summary provider",
564  ConstString("^std::__[[:alnum:]]+::basic_string<char32_t, "
565  "std::__[[:alnum:]]+::char_traits<char32_t>, "
566  "std::__[[:alnum:]]+::allocator<char32_t> >$"),
567  stl_summary_flags, true);
568 
571  "std::wstring summary provider",
572  ConstString("^std::__[[:alnum:]]+::wstring$"), stl_summary_flags, true);
573  AddCXXSummary(cpp_category_sp,
575  "std::wstring summary provider",
576  ConstString("^std::__[[:alnum:]]+::basic_string<wchar_t, "
577  "std::__[[:alnum:]]+::char_traits<wchar_t>, "
578  "std::__[[:alnum:]]+::allocator<wchar_t> >$"),
579  stl_summary_flags, true);
580 
581  SyntheticChildren::Flags stl_synth_flags;
582  stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(
583  false);
584  SyntheticChildren::Flags stl_deref_flags = stl_synth_flags;
585  stl_deref_flags.SetFrontEndWantsDereference();
586 
588  cpp_category_sp,
590  "libc++ std::bitset synthetic children",
591  ConstString("^std::__[[:alnum:]]+::bitset<.+>(( )?&)?$"), stl_deref_flags,
592  true);
594  cpp_category_sp,
596  "libc++ std::vector synthetic children",
597  ConstString("^std::__[[:alnum:]]+::vector<.+>(( )?&)?$"), stl_deref_flags,
598  true);
600  cpp_category_sp,
602  "libc++ std::forward_list synthetic children",
603  ConstString("^std::__[[:alnum:]]+::forward_list<.+>(( )?&)?$"),
604  stl_synth_flags, true);
606  cpp_category_sp,
608  "libc++ std::list synthetic children",
609  // A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>(( )?&)?$"
610  // so that it does not clash with: "^std::(__cxx11::)?list<.+>(( )?&)?$"
611  ConstString("^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
612  "cxx11[[:alnum:]])[[:alnum:]]*::list<.+>(( )?&)?$"),
613  stl_deref_flags, true);
615  cpp_category_sp,
617  "libc++ std::map synthetic children",
618  ConstString("^std::__[[:alnum:]]+::map<.+> >(( )?&)?$"), stl_synth_flags,
619  true);
621  cpp_category_sp,
623  "libc++ std::set synthetic children",
624  ConstString("^std::__[[:alnum:]]+::set<.+> >(( )?&)?$"), stl_deref_flags,
625  true);
627  cpp_category_sp,
629  "libc++ std::multiset synthetic children",
630  ConstString("^std::__[[:alnum:]]+::multiset<.+> >(( )?&)?$"),
631  stl_deref_flags, true);
633  cpp_category_sp,
635  "libc++ std::multimap synthetic children",
636  ConstString("^std::__[[:alnum:]]+::multimap<.+> >(( )?&)?$"),
637  stl_synth_flags, true);
639  cpp_category_sp,
641  "libc++ std::unordered containers synthetic children",
642  ConstString("^(std::__[[:alnum:]]+::)unordered_(multi)?(map|set)<.+> >$"),
643  stl_synth_flags, true);
645  cpp_category_sp,
647  "libc++ std::initializer_list synthetic children",
648  ConstString("^std::initializer_list<.+>(( )?&)?$"), stl_synth_flags,
649  true);
651  "libc++ std::queue synthetic children",
652  ConstString("^std::__[[:alnum:]]+::queue<.+>(( )?&)?$"),
653  stl_synth_flags, true);
655  "libc++ std::tuple synthetic children",
656  ConstString("^std::__[[:alnum:]]+::tuple<.*>(( )?&)?$"),
657  stl_synth_flags, true);
659  "libc++ std::optional synthetic children",
660  ConstString("^std::__[[:alnum:]]+::optional<.+>(( )?&)?$"),
661  stl_synth_flags, true);
663  "libc++ std::variant synthetic children",
664  ConstString("^std::__[[:alnum:]]+::variant<.+>(( )?&)?$"),
665  stl_synth_flags, true);
667  cpp_category_sp,
669  "libc++ std::atomic synthetic children",
670  ConstString("^std::__[[:alnum:]]+::atomic<.+>$"), stl_synth_flags, true);
671 
672  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
673  RegularExpression("^(std::__[[:alnum:]]+::)deque<.+>(( )?&)?$"),
674  SyntheticChildrenSP(new ScriptedSyntheticChildren(
675  stl_synth_flags,
676  "lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));
677 
679  cpp_category_sp,
681  "shared_ptr synthetic children",
682  ConstString("^(std::__[[:alnum:]]+::)shared_ptr<.+>(( )?&)?$"),
683  stl_synth_flags, true);
684 
685  ConstString libcxx_std_unique_ptr_regex(
686  "^std::__[[:alnum:]]+::unique_ptr<.+>(( )?&)?$");
688  cpp_category_sp,
690  "unique_ptr synthetic children", libcxx_std_unique_ptr_regex,
691  stl_synth_flags, true);
692 
694  cpp_category_sp,
696  "weak_ptr synthetic children",
697  ConstString("^(std::__[[:alnum:]]+::)weak_ptr<.+>(( )?&)?$"),
698  stl_synth_flags, true);
699  AddCXXSummary(cpp_category_sp,
701  "libc++ std::function summary provider",
702  ConstString("^std::__[[:alnum:]]+::function<.+>$"),
703  stl_summary_flags, true);
704 
705  stl_summary_flags.SetDontShowChildren(false);
706  stl_summary_flags.SetSkipPointers(false);
707  AddCXXSummary(cpp_category_sp,
709  "libc++ std::bitset summary provider",
710  ConstString("^std::__[[:alnum:]]+::bitset<.+>(( )?&)?$"),
711  stl_summary_flags, true);
712  AddCXXSummary(cpp_category_sp,
714  "libc++ std::vector summary provider",
715  ConstString("^std::__[[:alnum:]]+::vector<.+>(( )?&)?$"),
716  stl_summary_flags, true);
717  AddCXXSummary(cpp_category_sp,
719  "libc++ std::list summary provider",
720  ConstString("^std::__[[:alnum:]]+::forward_list<.+>(( )?&)?$"),
721  stl_summary_flags, true);
724  "libc++ std::list summary provider",
725  // A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>(( )?&)?$"
726  // so that it does not clash with: "^std::(__cxx11::)?list<.+>(( )?&)?$"
727  ConstString("^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
728  "cxx11[[:alnum:]])[[:alnum:]]*::list<.+>(( )?&)?$"),
729  stl_summary_flags, true);
730  AddCXXSummary(cpp_category_sp,
732  "libc++ std::map summary provider",
733  ConstString("^std::__[[:alnum:]]+::map<.+>(( )?&)?$"),
734  stl_summary_flags, true);
735  AddCXXSummary(cpp_category_sp,
737  "libc++ std::deque summary provider",
738  ConstString("^std::__[[:alnum:]]+::deque<.+>(( )?&)?$"),
739  stl_summary_flags, true);
740  AddCXXSummary(cpp_category_sp,
742  "libc++ std::queue summary provider",
743  ConstString("^std::__[[:alnum:]]+::queue<.+>(( )?&)?$"),
744  stl_summary_flags, true);
745  AddCXXSummary(cpp_category_sp,
747  "libc++ std::set summary provider",
748  ConstString("^std::__[[:alnum:]]+::set<.+>(( )?&)?$"),
749  stl_summary_flags, true);
750  AddCXXSummary(cpp_category_sp,
752  "libc++ std::multiset summary provider",
753  ConstString("^std::__[[:alnum:]]+::multiset<.+>(( )?&)?$"),
754  stl_summary_flags, true);
755  AddCXXSummary(cpp_category_sp,
757  "libc++ std::multimap summary provider",
758  ConstString("^std::__[[:alnum:]]+::multimap<.+>(( )?&)?$"),
759  stl_summary_flags, true);
762  "libc++ std::unordered containers summary provider",
763  ConstString("^(std::__[[:alnum:]]+::)unordered_(multi)?(map|set)<.+> >$"),
764  stl_summary_flags, true);
766  "libc++ std::tuple summary provider",
767  ConstString("^std::__[[:alnum:]]+::tuple<.*>(( )?&)?$"),
768  stl_summary_flags, true);
769  AddCXXSummary(cpp_category_sp,
771  "libc++ std::atomic summary provider",
772  ConstString("^std::__[[:alnum:]]+::atomic<.+>$"),
773  stl_summary_flags, true);
774  AddCXXSummary(cpp_category_sp,
776  "libc++ std::optional summary provider",
777  ConstString("^std::__[[:alnum:]]+::optional<.+>(( )?&)?$"),
778  stl_summary_flags, true);
779  AddCXXSummary(cpp_category_sp,
781  "libc++ std::variant summary provider",
782  ConstString("^std::__[[:alnum:]]+::variant<.+>(( )?&)?$"),
783  stl_summary_flags, true);
784 
785  stl_summary_flags.SetSkipPointers(true);
786 
787  AddCXXSummary(cpp_category_sp,
789  "libc++ std::shared_ptr summary provider",
790  ConstString("^std::__[[:alnum:]]+::shared_ptr<.+>(( )?&)?$"),
791  stl_summary_flags, true);
792  AddCXXSummary(cpp_category_sp,
794  "libc++ std::weak_ptr summary provider",
795  ConstString("^std::__[[:alnum:]]+::weak_ptr<.+>(( )?&)?$"),
796  stl_summary_flags, true);
797  AddCXXSummary(cpp_category_sp,
799  "libc++ std::unique_ptr summary provider",
800  libcxx_std_unique_ptr_regex, stl_summary_flags, true);
801 
803  cpp_category_sp,
805  "std::vector iterator synthetic children",
806  ConstString("^std::__[[:alnum:]]+::__wrap_iter<.+>$"), stl_synth_flags,
807  true);
808 
810  cpp_category_sp,
812  "std::map iterator synthetic children",
813  ConstString("^std::__[[:alnum:]]+::__map_iterator<.+>$"), stl_synth_flags,
814  true);
815 }
816 
817 static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
818  if (!cpp_category_sp)
819  return;
820 
821  TypeSummaryImpl::Flags stl_summary_flags;
822  stl_summary_flags.SetCascades(true)
823  .SetSkipPointers(false)
824  .SetSkipReferences(false)
825  .SetDontShowChildren(true)
826  .SetDontShowValue(true)
827  .SetShowMembersOneLiner(false)
828  .SetHideItemNames(false);
829 
830  lldb::TypeSummaryImplSP std_string_summary_sp(
831  new StringSummaryFormat(stl_summary_flags, "${var._M_dataplus._M_p}"));
832 
833  lldb::TypeSummaryImplSP cxx11_string_summary_sp(new CXXFunctionSummaryFormat(
834  stl_summary_flags, LibStdcppStringSummaryProvider,
835  "libstdc++ c++11 std::string summary provider"));
836  lldb::TypeSummaryImplSP cxx11_wstring_summary_sp(new CXXFunctionSummaryFormat(
837  stl_summary_flags, LibStdcppWStringSummaryProvider,
838  "libstdc++ c++11 std::wstring summary provider"));
839 
840  cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::string"),
841  std_string_summary_sp);
842  cpp_category_sp->GetTypeSummariesContainer()->Add(
843  ConstString("std::basic_string<char>"), std_string_summary_sp);
844  cpp_category_sp->GetTypeSummariesContainer()->Add(
845  ConstString("std::basic_string<char,std::char_traits<char>,std::"
846  "allocator<char> >"),
847  std_string_summary_sp);
848  cpp_category_sp->GetTypeSummariesContainer()->Add(
849  ConstString("std::basic_string<char, std::char_traits<char>, "
850  "std::allocator<char> >"),
851  std_string_summary_sp);
852 
853  cpp_category_sp->GetTypeSummariesContainer()->Add(
854  ConstString("std::__cxx11::string"), cxx11_string_summary_sp);
855  cpp_category_sp->GetTypeSummariesContainer()->Add(
856  ConstString("std::__cxx11::basic_string<char, std::char_traits<char>, "
857  "std::allocator<char> >"),
858  cxx11_string_summary_sp);
859  cpp_category_sp->GetTypeSummariesContainer()->Add(
860  ConstString("std::__cxx11::basic_string<unsigned char, "
861  "std::char_traits<unsigned char>, "
862  "std::allocator<unsigned char> >"),
863  cxx11_string_summary_sp);
864 
865  // making sure we force-pick the summary for printing wstring (_M_p is a
866  // wchar_t*)
867  lldb::TypeSummaryImplSP std_wstring_summary_sp(
868  new StringSummaryFormat(stl_summary_flags, "${var._M_dataplus._M_p%S}"));
869 
870  cpp_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::wstring"),
871  std_wstring_summary_sp);
872  cpp_category_sp->GetTypeSummariesContainer()->Add(
873  ConstString("std::basic_string<wchar_t>"), std_wstring_summary_sp);
874  cpp_category_sp->GetTypeSummariesContainer()->Add(
875  ConstString("std::basic_string<wchar_t,std::char_traits<wchar_t>,std::"
876  "allocator<wchar_t> >"),
877  std_wstring_summary_sp);
878  cpp_category_sp->GetTypeSummariesContainer()->Add(
879  ConstString("std::basic_string<wchar_t, std::char_traits<wchar_t>, "
880  "std::allocator<wchar_t> >"),
881  std_wstring_summary_sp);
882 
883  cpp_category_sp->GetTypeSummariesContainer()->Add(
884  ConstString("std::__cxx11::wstring"), cxx11_wstring_summary_sp);
885  cpp_category_sp->GetTypeSummariesContainer()->Add(
886  ConstString("std::__cxx11::basic_string<wchar_t, "
887  "std::char_traits<wchar_t>, std::allocator<wchar_t> >"),
888  cxx11_wstring_summary_sp);
889 
890  SyntheticChildren::Flags stl_synth_flags;
891  stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(
892  false);
893  SyntheticChildren::Flags stl_deref_flags = stl_synth_flags;
894  stl_deref_flags.SetFrontEndWantsDereference();
895 
896  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
897  RegularExpression("^std::vector<.+>(( )?&)?$"),
898  SyntheticChildrenSP(new ScriptedSyntheticChildren(
899  stl_synth_flags,
900  "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));
901  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
902  RegularExpression("^std::map<.+> >(( )?&)?$"),
903  SyntheticChildrenSP(new ScriptedSyntheticChildren(
904  stl_synth_flags,
905  "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
906  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
907  RegularExpression("^std::set<.+> >(( )?&)?$"),
908  SyntheticChildrenSP(new ScriptedSyntheticChildren(
909  stl_deref_flags,
910  "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
911  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
912  RegularExpression("^std::multimap<.+> >(( )?&)?$"),
913  SyntheticChildrenSP(new ScriptedSyntheticChildren(
914  stl_deref_flags,
915  "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
916  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
917  RegularExpression("^std::optional<.+>(( )?&)?$"),
918  SyntheticChildrenSP(new ScriptedSyntheticChildren(
919  stl_synth_flags,
920  "lldb.formatters.cpp.gnu_libstdcpp.StdOptionalSynthProvider")));
921  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
922  RegularExpression("^std::multiset<.+> >(( )?&)?$"),
923  SyntheticChildrenSP(new ScriptedSyntheticChildren(
924  stl_deref_flags,
925  "lldb.formatters.cpp.gnu_libstdcpp.StdMapLikeSynthProvider")));
926  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
927  RegularExpression("^std::unordered_(multi)?(map|set)<.+> >$"),
928  SyntheticChildrenSP(new ScriptedSyntheticChildren(
929  stl_deref_flags,
930  "lldb.formatters.cpp.gnu_libstdcpp.StdUnorderedMapSynthProvider")));
931  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
932  RegularExpression("^std::(__cxx11::)?list<.+>(( )?&)?$"),
933  SyntheticChildrenSP(new ScriptedSyntheticChildren(
934  stl_synth_flags,
935  "lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));
936  cpp_category_sp->GetRegexTypeSyntheticsContainer()->Add(
937  RegularExpression("^std::(__cxx11::)?forward_list<.+>(( )?&)?$"),
938  SyntheticChildrenSP(new ScriptedSyntheticChildren(
939  stl_synth_flags,
940  "lldb.formatters.cpp.gnu_libstdcpp.StdForwardListSynthProvider")));
941 
942  stl_summary_flags.SetDontShowChildren(false);
943  stl_summary_flags.SetSkipPointers(false);
944  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
945  RegularExpression("^std::optional<.+>(( )?&)?$"),
946  TypeSummaryImplSP(new ScriptSummaryFormat(
947  stl_summary_flags,
948  "lldb.formatters.cpp.gnu_libstdcpp.StdOptionalSummaryProvider")));
949  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
950  RegularExpression("^std::bitset<.+>(( )?&)?$"),
951  TypeSummaryImplSP(
952  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
953  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
954  RegularExpression("^std::vector<.+>(( )?&)?$"),
955  TypeSummaryImplSP(
956  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
957  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
958  RegularExpression("^std::map<.+> >(( )?&)?$"),
959  TypeSummaryImplSP(
960  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
961  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
962  RegularExpression("^std::set<.+> >(( )?&)?$"),
963  TypeSummaryImplSP(
964  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
965  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
966  RegularExpression("^std::multimap<.+> >(( )?&)?$"),
967  TypeSummaryImplSP(
968  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
969  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
970  RegularExpression("^std::multiset<.+> >(( )?&)?$"),
971  TypeSummaryImplSP(
972  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
973  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
974  RegularExpression("^std::unordered_(multi)?(map|set)<.+> >$"),
975  TypeSummaryImplSP(
976  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
977  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
978  RegularExpression("^std::(__cxx11::)?list<.+>(( )?&)?$"),
979  TypeSummaryImplSP(
980  new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
981  cpp_category_sp->GetRegexTypeSummariesContainer()->Add(
982  RegularExpression("^std::(__cxx11::)?forward_list<.+>(( )?&)?$"),
983  TypeSummaryImplSP(
984  new ScriptSummaryFormat(stl_summary_flags, "lldb.formatters.cpp.gnu_libstdcpp.ForwardListSummaryProvider")));
985 
987  cpp_category_sp,
989  "std::vector iterator synthetic children",
990  ConstString("^__gnu_cxx::__normal_iterator<.+>$"), stl_synth_flags, true);
991 
993  cpp_category_sp,
995  "std::map iterator synthetic children",
996  ConstString("^std::_Rb_tree_iterator<.+>$"), stl_synth_flags, true);
997 
999  cpp_category_sp,
1001  "std::unique_ptr synthetic children",
1002  ConstString("^std::unique_ptr<.+>(( )?&)?$"), stl_synth_flags, true);
1004  cpp_category_sp,
1006  "std::shared_ptr synthetic children",
1007  ConstString("^std::shared_ptr<.+>(( )?&)?$"), stl_synth_flags, true);
1009  cpp_category_sp,
1011  "std::weak_ptr synthetic children",
1012  ConstString("^std::weak_ptr<.+>(( )?&)?$"), stl_synth_flags, true);
1014  cpp_category_sp,
1016  "std::tuple synthetic children", ConstString("^std::tuple<.+>(( )?&)?$"),
1017  stl_synth_flags, true);
1018 
1020  cpp_category_sp,
1022  "std::bitset synthetic child", ConstString("^std::bitset<.+>(( )?&)?$"),
1023  stl_deref_flags, true);
1024 
1025  AddCXXSummary(cpp_category_sp,
1027  "libstdc++ std::unique_ptr summary provider",
1028  ConstString("^std::unique_ptr<.+>(( )?&)?$"), stl_summary_flags,
1029  true);
1030  AddCXXSummary(cpp_category_sp,
1032  "libstdc++ std::shared_ptr summary provider",
1033  ConstString("^std::shared_ptr<.+>(( )?&)?$"), stl_summary_flags,
1034  true);
1035  AddCXXSummary(cpp_category_sp,
1037  "libstdc++ std::weak_ptr summary provider",
1038  ConstString("^std::weak_ptr<.+>(( )?&)?$"), stl_summary_flags,
1039  true);
1040 }
1041 
1042 static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
1043  if (!cpp_category_sp)
1044  return;
1045 
1046  TypeSummaryImpl::Flags string_flags;
1047  string_flags.SetCascades(true)
1048  .SetSkipPointers(true)
1049  .SetSkipReferences(false)
1050  .SetDontShowChildren(true)
1051  .SetDontShowValue(false)
1052  .SetShowMembersOneLiner(false)
1053  .SetHideItemNames(false);
1054 
1055  TypeSummaryImpl::Flags string_array_flags;
1056  string_array_flags.SetCascades(true)
1057  .SetSkipPointers(true)
1058  .SetSkipReferences(false)
1059  .SetDontShowChildren(true)
1060  .SetDontShowValue(true)
1061  .SetShowMembersOneLiner(false)
1062  .SetHideItemNames(false);
1063 
1064  AddCXXSummary(
1066  "char8_t * summary provider", ConstString("char8_t *"), string_flags);
1067  AddCXXSummary(cpp_category_sp,
1069  "char8_t [] summary provider",
1070  ConstString("char8_t ?\\[[0-9]+\\]"), string_array_flags, true);
1071 
1072  AddCXXSummary(
1074  "char16_t * summary provider", ConstString("char16_t *"), string_flags);
1075  AddCXXSummary(cpp_category_sp,
1077  "char16_t [] summary provider",
1078  ConstString("char16_t ?\\[[0-9]+\\]"), string_array_flags, true);
1079 
1080  AddCXXSummary(
1082  "char32_t * summary provider", ConstString("char32_t *"), string_flags);
1083  AddCXXSummary(cpp_category_sp,
1085  "char32_t [] summary provider",
1086  ConstString("char32_t ?\\[[0-9]+\\]"), string_array_flags, true);
1087 
1088  AddCXXSummary(
1090  "wchar_t * summary provider", ConstString("wchar_t *"), string_flags);
1091  AddCXXSummary(cpp_category_sp,
1093  "wchar_t * summary provider",
1094  ConstString("wchar_t ?\\[[0-9]+\\]"), string_array_flags, true);
1095 
1096  AddCXXSummary(
1098  "unichar * summary provider", ConstString("unichar *"), string_flags);
1099 
1100  TypeSummaryImpl::Flags widechar_flags;
1101  widechar_flags.SetDontShowValue(true)
1102  .SetSkipPointers(true)
1103  .SetSkipReferences(false)
1104  .SetCascades(true)
1105  .SetDontShowChildren(true)
1106  .SetHideItemNames(true)
1107  .SetShowMembersOneLiner(false);
1108 
1110  "char8_t summary provider", ConstString("char8_t"),
1111  widechar_flags);
1112  AddCXXSummary(
1114  "char16_t summary provider", ConstString("char16_t"), widechar_flags);
1115  AddCXXSummary(
1117  "char32_t summary provider", ConstString("char32_t"), widechar_flags);
1119  "wchar_t summary provider", ConstString("wchar_t"),
1120  widechar_flags);
1121 
1122  AddCXXSummary(
1124  "unichar summary provider", ConstString("unichar"), widechar_flags);
1125 }
1126 
1127 std::unique_ptr<Language::TypeScavenger> CPlusPlusLanguage::GetTypeScavenger() {
1128  class CPlusPlusTypeScavenger : public Language::ImageListTypeScavenger {
1129  public:
1130  CompilerType AdjustForInclusion(CompilerType &candidate) override {
1131  LanguageType lang_type(candidate.GetMinimumLanguage());
1132  if (!Language::LanguageIsC(lang_type) &&
1133  !Language::LanguageIsCPlusPlus(lang_type))
1134  return CompilerType();
1135  if (candidate.IsTypedefType())
1136  return candidate.GetTypedefedType();
1137  return candidate;
1138  }
1139  };
1140 
1141  return std::unique_ptr<TypeScavenger>(new CPlusPlusTypeScavenger());
1142 }
1143 
1144 lldb::TypeCategoryImplSP CPlusPlusLanguage::GetFormatters() {
1145  static llvm::once_flag g_initialize;
1146  static TypeCategoryImplSP g_category;
1147 
1148  llvm::call_once(g_initialize, [this]() -> void {
1149  DataVisualization::Categories::GetCategory(ConstString(GetPluginName()),
1150  g_category);
1151  if (g_category) {
1152  LoadLibStdcppFormatters(g_category);
1153  LoadLibCxxFormatters(g_category);
1154  LoadSystemFormatters(g_category);
1155  }
1156  });
1157  return g_category;
1158 }
1159 
1161 CPlusPlusLanguage::GetHardcodedSummaries() {
1162  static llvm::once_flag g_initialize;
1163  static ConstString g_vectortypes("VectorTypes");
1164  static HardcodedFormatters::HardcodedSummaryFinder g_formatters;
1165 
1166  llvm::call_once(g_initialize, []() -> void {
1167  g_formatters.push_back(
1170  static CXXFunctionSummaryFormat::SharedPointer formatter_sp(
1174  "Function pointer summary provider"));
1175  if (valobj.GetCompilerType().IsFunctionPointerType()) {
1176  return formatter_sp;
1177  }
1178  return nullptr;
1179  });
1180  g_formatters.push_back(
1183  static CXXFunctionSummaryFormat::SharedPointer formatter_sp(
1186  .SetCascades(true)
1187  .SetDontShowChildren(true)
1188  .SetHideItemNames(true)
1189  .SetShowMembersOneLiner(true)
1190  .SetSkipPointers(true)
1191  .SetSkipReferences(false),
1193  "vector_type pointer summary provider"));
1194  if (valobj.GetCompilerType().IsVectorType()) {
1195  if (fmt_mgr.GetCategory(g_vectortypes)->IsEnabled())
1196  return formatter_sp;
1197  }
1198  return nullptr;
1199  });
1200  g_formatters.push_back(
1203  static CXXFunctionSummaryFormat::SharedPointer formatter_sp(
1206  .SetCascades(true)
1207  .SetDontShowChildren(true)
1208  .SetHideItemNames(true)
1209  .SetShowMembersOneLiner(true)
1210  .SetSkipPointers(true)
1211  .SetSkipReferences(false),
1213  "block pointer summary provider"));
1214  if (valobj.GetCompilerType().IsBlockPointerType()) {
1215  return formatter_sp;
1216  }
1217  return nullptr;
1218  });
1219  });
1220 
1221  return g_formatters;
1222 }
1223 
1225 CPlusPlusLanguage::GetHardcodedSynthetics() {
1226  static llvm::once_flag g_initialize;
1227  static ConstString g_vectortypes("VectorTypes");
1229 
1230  llvm::call_once(g_initialize, []() -> void {
1231  g_formatters.push_back([](lldb_private::ValueObject &valobj,
1234  static CXXSyntheticChildren::SharedPointer formatter_sp(
1237  .SetCascades(true)
1238  .SetSkipPointers(true)
1239  .SetSkipReferences(true)
1240  .SetNonCacheable(true),
1241  "vector_type synthetic children",
1243  if (valobj.GetCompilerType().IsVectorType()) {
1244  if (fmt_mgr.GetCategory(g_vectortypes)->IsEnabled())
1245  return formatter_sp;
1246  }
1247  return nullptr;
1248  });
1249  g_formatters.push_back([](lldb_private::ValueObject &valobj,
1252  static CXXSyntheticChildren::SharedPointer formatter_sp(
1255  .SetCascades(true)
1256  .SetSkipPointers(true)
1257  .SetSkipReferences(true)
1258  .SetNonCacheable(true),
1259  "block pointer synthetic children",
1261  if (valobj.GetCompilerType().IsBlockPointerType()) {
1262  return formatter_sp;
1263  }
1264  return nullptr;
1265  });
1266  });
1267 
1268  return g_formatters;
1269 }
1270 
1271 bool CPlusPlusLanguage::IsNilReference(ValueObject &valobj) {
1272  if (!Language::LanguageIsCPlusPlus(valobj.GetObjectRuntimeLanguage()) ||
1273  !valobj.IsPointerType())
1274  return false;
1275  bool canReadValue = true;
1276  bool isZero = valobj.GetValueAsUnsigned(0, &canReadValue) == 0;
1277  return canReadValue && isZero;
1278 }
1279 
1280 bool CPlusPlusLanguage::IsSourceFile(llvm::StringRef file_path) const {
1281  const auto suffixes = {".cpp", ".cxx", ".c++", ".cc", ".c",
1282  ".h", ".hh", ".hpp", ".hxx", ".h++"};
1283  for (auto suffix : suffixes) {
1284  if (file_path.endswith_insensitive(suffix))
1285  return true;
1286  }
1287 
1288  // Check if we're in a STL path (where the files usually have no extension
1289  // that we could check for.
1290  return file_path.contains("/usr/include/c++/");
1291 }
lldb_private::SyntheticChildren::Flags
Definition: TypeSynthetic.h:134
RegularExpression.h
lldb_private::ScriptedSyntheticChildren
Definition: TypeSynthetic.h:387
lldb_private::SymbolFile
Definition: SymbolFile.h:38
lldb_private::ValueObject::GetValueAsUnsigned
virtual uint64_t GetValueAsUnsigned(uint64_t fail_value, bool *success=nullptr)
Definition: ValueObject.cpp:1090
lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxUnorderedMap.cpp:220
LibCxxVariant.h
lldb_private::formatters::Char32SummaryProvider
bool Char32SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:164
lldb_private::SyntheticChildren::Flags::SetSkipReferences
Flags & SetSkipReferences(bool value=true)
Definition: TypeSynthetic.h:189
Mangled.h
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::formatters::LibcxxStringSummaryProviderUTF16
bool LibcxxStringSummaryProviderUTF16(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:786
lldb_private::formatters::WCharSummaryProvider
bool WCharSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:169
CPlusPlusLanguage.h
VectorType.h
lldb_private::FormatManager
Definition: FormatManager.h:36
lldb_private::formatters::Char16StringSummaryProvider
bool Char16StringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:102
lldb_private::formatters::LibcxxOptionalFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxOptionalFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
Definition: LibCxxOptional.cpp:79
lldb_private::TypeSummaryImpl::Flags::SetDontShowChildren
Flags & SetDontShowChildren(bool value=true)
Definition: TypeSummary.h:121
lldb_private::CXXFunctionSummaryFormat
Definition: TypeSummary.h:306
lldb_private::formatters::LibcxxStringSummaryProviderUTF32
bool LibcxxStringSummaryProviderUTF32(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:793
lldb_private::TypeSummaryImpl::Flags
Definition: TypeSummary.h:53
lldb_private::CompilerType::IsVectorType
bool IsVectorType(CompilerType *element_type=nullptr, uint64_t *size=nullptr) const
Definition: CompilerType.cpp:64
CPlusPlusNameParser.h
lldb_private::CPlusPlusNameParser::ParseAsFunctionDefinition
llvm::Optional< ParsedFunction > ParseAsFunctionDefinition()
Definition: CPlusPlusNameParser.cpp:23
ReverseFindMatchingChars
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)
Definition: CPlusPlusLanguage.cpp:113
lldb_private::formatters::Char8SummaryProvider
bool Char8SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:154
Module.h
lldb_private::CPlusPlusLanguage::MethodName::GetScopeQualifiedName
std::string GetScopeQualifiedName()
Definition: CPlusPlusLanguage.cpp:256
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxMap.cpp:461
lldb_private::CPlusPlusLanguage::MethodName::GetBasename
llvm::StringRef GetBasename()
Definition: CPlusPlusLanguage.cpp:232
lldb_private::CPlusPlusLanguage::MethodName::GetContext
llvm::StringRef GetContext()
Definition: CPlusPlusLanguage.cpp:238
lldb_private::ValueObject::IsPointerType
virtual bool IsPointerType()
Definition: ValueObject.h:382
lldb_private::CompilerType::IsFunctionPointerType
bool IsFunctionPointerType() const
Definition: CompilerType.cpp:128
lldb_private::Args
Definition: Args.h:33
lldb_private::FormatManager::GetCategory
lldb::TypeCategoryImplSP GetCategory(const char *category_name=nullptr, bool can_create=true)
Definition: FormatManager.h:99
lldb_private::CPlusPlusNameParser
Definition: CPlusPlusNameParser.h:23
LoadLibStdcppFormatters
static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp)
Definition: CPlusPlusLanguage.cpp:817
UniqueCStringMap.h
lldb_private::CPlusPlusLanguage::MethodName::GetQualifiers
llvm::StringRef GetQualifiers()
Definition: CPlusPlusLanguage.cpp:250
lldb_private::CPlusPlusLanguage::MethodName::GetArguments
llvm::StringRef GetArguments()
Definition: CPlusPlusLanguage.cpp:244
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::formatters::VectorTypeSummaryProvider
bool VectorTypeSummaryProvider(ValueObject &, Stream &, const TypeSummaryOptions &)
Definition: VectorType.cpp:250
lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:354
lldb_private::HardcodedFormatters::HardcodedSummaryFinder
HardcodedFormatterFinders< TypeSummaryImpl > HardcodedSummaryFinder
Definition: FormatClasses.h:40
lldb_private::formatters::LibStdcppStringSummaryProvider
bool LibStdcppStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcpp.cpp:232
lldb_private::formatters::LibcxxVariantSummaryProvider
bool LibcxxVariantSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxxVariant.cpp:118
lldb_private::formatters::LibcxxWStringSummaryProvider
bool LibcxxWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:646
LIBLLDB_LOG_LANGUAGE
#define LIBLLDB_LOG_LANGUAGE
Definition: Logging.h:42
lldb_private::CXXFunctionSummaryFormat::SharedPointer
std::shared_ptr< CXXFunctionSummaryFormat > SharedPointer
Definition: TypeSummary.h:343
lldb_private::formatters::LibStdcppUniquePointerSummaryProvider
bool LibStdcppUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcppUniquePointer.cpp:178
LoadLibCxxFormatters
static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp)
Definition: CPlusPlusLanguage.cpp:520
lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxVector.cpp:285
lldb_private::formatters::AddCXXSummary
void AddCXXSummary(TypeCategoryImpl::SharedPointer category_sp, CXXFunctionSummaryFormat::Callback funct, const char *description, ConstString type_name, TypeSummaryImpl::Flags flags, bool regex=false)
Add a summary that is implemented by a C++ callback.
Definition: FormattersHelpers.cpp:75
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
Log.h
lldb_private::formatters::LibcxxFunctionSummaryProvider
bool LibcxxFunctionSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:56
lldb_private::CPlusPlusNameParser::ParseAsFullName
llvm::Optional< ParsedName > ParseAsFullName()
Definition: CPlusPlusNameParser.cpp:50
lldb_private::TypeSummaryImpl::Flags::SetShowMembersOneLiner
Flags & SetShowMembersOneLiner(bool value=true)
Definition: TypeSummary.h:160
lldb_private::formatters::VectorTypeSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * VectorTypeSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: VectorType.cpp:288
lldb_private::formatters::LibcxxSmartPointerSummaryProvider
bool LibcxxSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:104
lldb_private::SyntheticChildren::Flags::SetFrontEndWantsDereference
Flags & SetFrontEndWantsDereference(bool value=true)
Definition: TypeSynthetic.h:215
LoadSystemFormatters
static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp)
Definition: CPlusPlusLanguage.cpp:1042
IsTrivialBasename
static bool IsTrivialBasename(const llvm::StringRef &basename)
Definition: CPlusPlusLanguage.cpp:142
lldb_private::ConstString
Definition: ConstString.h:40
MSVCUndecoratedNameParser.h
CxxStringTypes.h
lldb_private::ScriptSummaryFormat
Definition: TypeSummary.h:352
MSVCUndecoratedNameParser::ExtractContextAndIdentifier
static bool ExtractContextAndIdentifier(llvm::StringRef name, llvm::StringRef &context, llvm::StringRef &identifier)
Definition: MSVCUndecoratedNameParser.cpp:78
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
Base
lldb_private::formatters::Char8StringSummaryProvider
bool Char8StringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:97
lldb_private::formatters::BlockPointerSummaryProvider
bool BlockPointerSummaryProvider(ValueObject &, Stream &, const TypeSummaryOptions &)
Definition: BlockPointer.cpp:170
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb_private::CompilerType::IsTypedefType
bool IsTypedefType() const
Definition: CompilerType.cpp:230
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::formatters::LibcxxStringSummaryProviderASCII
bool LibcxxStringSummaryProviderASCII(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &summary_options)
Definition: LibCxx.cpp:779
lldb_private::formatters::LibcxxInitializerListSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxInitializerList.cpp:118
lldb_private::formatters::LibcxxBitsetSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: GenericBitset.cpp:142
lldb_private::formatters::LibcxxAtomicSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxAtomicSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxAtomic.cpp:146
lldb::eLanguageTypeObjC_plus_plus
@ eLanguageTypeObjC_plus_plus
Objective-C++.
Definition: lldb-enumerations.h:454
lldb_private::formatters::LibStdcppBitsetSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibStdcppBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: GenericBitset.cpp:134
lldb_private::TypeSummaryImpl::Flags::SetCascades
Flags & SetCascades(bool value=true)
Definition: TypeSummary.h:82
lldb_private::SyntheticChildren::SharedPointer
std::shared_ptr< SyntheticChildren > SharedPointer
Definition: TypeSynthetic.h:264
lldb_private::formatters::LibStdcppUniquePtrSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibStdcppUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcppUniquePointer.cpp:172
lldb_private::TypeSummaryImpl::Flags::SetSkipPointers
Flags & SetSkipPointers(bool value=true)
Definition: TypeSummary.h:95
lldb_private::TypeSummaryImpl::Flags::SetDontShowValue
Flags & SetDontShowValue(bool value=true)
Definition: TypeSummary.h:147
lldb_private::formatters::Char32StringSummaryProvider
bool Char32StringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:107
lldb_private::formatters::LibstdcppMapIteratorSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibstdcppMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcpp.cpp:153
lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:424
lldb_private::CompilerType::IsBlockPointerType
bool IsBlockPointerType(CompilerType *function_pointer_type_ptr=nullptr) const
Definition: CompilerType.cpp:134
lldb_private::formatters::LibStdcppWStringSummaryProvider
bool LibStdcppWStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcpp.cpp:281
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::formatters::LibcxxContainerSummaryProvider
bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:535
DataVisualization.h
lldb_private::formatters::LibcxxStdForwardListSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxList.cpp:430
lldb_private::formatters::WCharStringSummaryProvider
bool WCharStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:112
uint32_t
lldb_private::Language
Definition: Language.h:29
lldb_private::formatters::LibcxxUniquePtrSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxUniquePtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:475
lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:458
lldb_private::CPlusPlusLanguage::MethodName
Definition: CPlusPlusLanguage.h:28
lldb_private::formatters::LibStdcppSharedPtrSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibStdcppSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcpp.cpp:385
lldb_private::ValueObject::GetCompilerType
CompilerType GetCompilerType()
Definition: ValueObject.h:352
lldb_private::TypeSummaryImpl::SharedPointer
std::shared_ptr< TypeSummaryImpl > SharedPointer
Definition: TypeSummary.h:263
lldb_private::formatters::LibStdcppSmartPointerSummaryProvider
bool LibStdcppSmartPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibStdcpp.cpp:391
lldb_private::formatters::LibStdcppTupleSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibStdcppTupleSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcppTuple.cpp:108
lldb_private::formatters::LibcxxQueueFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxQueueFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxQueue.cpp:60
lldb_private::SymbolContext::module_sp
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SymbolContext.h:318
PluginManager.h
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
LibCxxAtomic.h
LLDB_LOG
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:242
lldb_private::formatters::LibcxxVariantFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxVariantFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp)
Definition: LibCxxVariant.cpp:249
lldb_private::CompilerType::GetTypedefedType
CompilerType GetTypedefedType() const
If the current object represents a typedef type, get the underlying type.
Definition: CompilerType.cpp:464
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::formatters::LibcxxUniquePointerSummaryProvider
bool LibcxxUniquePointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:147
lldb_private::formatters
Definition: CXXFunctionPointer.h:15
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
BlockPointer.h
lldb_private::formatters::Char16SummaryProvider
bool Char16SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CxxStringTypes.cpp:159
lldb_private::formatters::LibCxxAtomicSummaryProvider
bool LibCxxAtomicSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxxAtomic.cpp:71
LibCxx.h
lldb_private::CPlusPlusLanguage
Definition: CPlusPlusLanguage.h:24
lldb_private::CompilerType::GetMinimumLanguage
lldb::LanguageType GetMinimumLanguage()
Definition: CompilerType.cpp:298
lldb_private::Language::ImageListTypeScavenger
Definition: Language.h:57
lldb_private::SyntheticChildren::Flags::SetSkipPointers
Flags & SetSkipPointers(bool value=true)
Definition: TypeSynthetic.h:176
lldb_private::formatters::BlockPointerSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * BlockPointerSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: BlockPointer.cpp:202
ConstString.h
MSVCUndecoratedNameParser::IsMSVCUndecoratedName
static bool IsMSVCUndecoratedName(llvm::StringRef name)
Definition: MSVCUndecoratedNameParser.cpp:74
lldb_private::formatters::CXXFunctionPointerSummaryProvider
bool CXXFunctionPointerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: CXXFunctionPointer.cpp:22
lldb_private::formatters::LibStdcppVectorIteratorSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibStdcppVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibStdcpp.cpp:170
lldb_private::formatters::LibCxxVectorIteratorSyntheticFrontEndCreator
SyntheticChildrenFrontEnd * LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxx.cpp:370
lldb_private::StringSummaryFormat
Definition: TypeSummary.h:278
LLDB_PLUGIN_DEFINE
#define LLDB_PLUGIN_DEFINE(PluginName)
Definition: PluginManager.h:31
lldb_private::Log
Definition: Log.h:49
lldb_private::CPlusPlusLanguage::MethodName::IsValid
bool IsValid()
Definition: CPlusPlusLanguage.h:39
lldb_private::CXXSyntheticChildren
Definition: TypeSynthetic.h:358
lldb_private::formatters::LibcxxOptionalSummaryProvider
bool LibcxxOptionalSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options)
Definition: LibCxx.cpp:34
lldb_private::TypeSummaryImpl::Flags::SetHideItemNames
Flags & SetHideItemNames(bool value=true)
Definition: TypeSummary.h:173
lldb_private::SymbolFile::GetMangledNamesForFunction
virtual void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
Definition: SymbolFile.cpp:126
FormattersHelpers.h
CXXFunctionPointer.h
lldb
Definition: SBAddress.h:15
LibStdcpp.h
lldb_private::formatters::AddCXXSynthetic
void AddCXXSynthetic(TypeCategoryImpl::SharedPointer category_sp, CXXSyntheticChildren::CreateFrontEndCallback generator, const char *description, ConstString type_name, ScriptedSyntheticChildren::Flags flags, bool regex=false)
Add a synthetic that is implemented by a C++ callback.
Definition: FormattersHelpers.cpp:89
SymbolFile.h
lldb_private::SyntheticChildren::Flags::SetCascades
Flags & SetCascades(bool value=true)
Definition: TypeSynthetic.h:163
lldb_private::ValueObject::GetObjectRuntimeLanguage
virtual lldb::LanguageType GetObjectRuntimeLanguage()
Definition: ValueObject.h:373
lldb_private::formatters::LibcxxTupleFrontEndCreator
SyntheticChildrenFrontEnd * LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP)
Definition: LibCxxTuple.cpp:88
lldb_private::HardcodedFormatters::HardcodedSyntheticFinder
HardcodedFormatterFinders< SyntheticChildren > HardcodedSyntheticFinder
Definition: FormatClasses.h:41
lldb_private::TypeSummaryImpl::Flags::SetSkipReferences
Flags & SetSkipReferences(bool value=true)
Definition: TypeSummary.h:108