LLDB mainline
Language.h
Go to the documentation of this file.
1//===-- Language.h --------------------------------------------------------===//
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#ifndef LLDB_TARGET_LANGUAGE_H
10#define LLDB_TARGET_LANGUAGE_H
11
12#include <functional>
13#include <memory>
14#include <optional>
15#include <set>
16#include <string>
17#include <vector>
18
21#include "lldb/Core/Mangled.h"
27#include "lldb/lldb-private.h"
28#include "lldb/lldb-public.h"
29#include "llvm/ADT/StringRef.h"
30#include "llvm/Support/FormatVariadic.h"
31
32namespace lldb_private {
33
35public:
37
38 static llvm::StringRef GetSettingName();
39
41};
42
43class Language : public PluginInterface {
44public:
46 public:
47 class Result {
48 public:
49 virtual bool IsValid() = 0;
50
51 virtual bool DumpToStream(Stream &stream,
52 bool print_help_if_available) = 0;
53
54 virtual ~Result() = default;
55 };
56
57 typedef std::set<std::unique_ptr<Result>> ResultSet;
58
59 virtual ~TypeScavenger() = default;
60
61 size_t Find(ExecutionContextScope *exe_scope, const char *key,
62 ResultSet &results, bool append = true);
63
64 protected:
65 TypeScavenger() = default;
66
67 virtual bool Find_Impl(ExecutionContextScope *exe_scope, const char *key,
68 ResultSet &results) = 0;
69 };
70
73 public:
75
76 bool IsValid() override { return m_compiler_type.IsValid(); }
77
78 bool DumpToStream(Stream &stream, bool print_help_if_available) override {
79 if (IsValid()) {
80 m_compiler_type.DumpTypeDescription(&stream);
81 stream.EOL();
82 return true;
83 }
84 return false;
85 }
86
87 ~Result() override = default;
88
89 private:
91 };
92
93 protected:
95
96 ~ImageListTypeScavenger() override = default;
97
98 // is this type something we should accept? it's usually going to be a
99 // filter by language + maybe some sugar tweaking
100 // returning an empty type means rejecting this candidate entirely;
101 // any other result will be accepted as a valid match
103
104 bool Find_Impl(ExecutionContextScope *exe_scope, const char *key,
105 ResultSet &results) override;
106 };
107
108 template <typename... ScavengerTypes>
110 public:
112 for (std::shared_ptr<TypeScavenger> scavenger : { std::shared_ptr<TypeScavenger>(new ScavengerTypes())... }) {
113 if (scavenger)
114 m_scavengers.push_back(scavenger);
115 }
116 }
117 protected:
118 bool Find_Impl(ExecutionContextScope *exe_scope, const char *key,
119 ResultSet &results) override {
120 const bool append = false;
121 for (auto& scavenger : m_scavengers) {
122 if (scavenger && scavenger->Find(exe_scope, key, results, append))
123 return true;
124 }
125 return false;
126 }
127 private:
128 std::vector<std::shared_ptr<TypeScavenger>> m_scavengers;
129 };
130
131 template <typename... ScavengerTypes>
133 public:
135 for (std::shared_ptr<TypeScavenger> scavenger : { std::shared_ptr<TypeScavenger>(new ScavengerTypes())... }) {
136 if (scavenger)
137 m_scavengers.push_back(scavenger);
138 }
139 }
140 protected:
141 bool Find_Impl(ExecutionContextScope *exe_scope, const char *key,
142 ResultSet &results) override {
143 const bool append = true;
144 bool success = false;
145 for (auto& scavenger : m_scavengers) {
146 if (scavenger)
147 success = scavenger->Find(exe_scope, key, results, append) || success;
148 }
149 return success;
150 }
151 private:
152 std::vector<std::shared_ptr<TypeScavenger>> m_scavengers;
153 };
154
160
161 ~Language() override;
162
163 static Language *FindPlugin(lldb::LanguageType language);
164
165 /// Returns the Language associated with the given file path or a nullptr
166 /// if there is no known language.
167 static Language *FindPlugin(llvm::StringRef file_path);
168
169 static Language *FindPlugin(lldb::LanguageType language,
170 llvm::StringRef file_path);
171
172 /// Returns the Language that registered \p scheme with
173 /// Mangled::RegisterManglingScheme(), or a nullptr if none did.
175
176 static llvm::Expected<lldb::LanguageType>
177 GetExceptionLanguageForLanguage(llvm::StringRef lang_name);
178 // return false from callback to stop iterating
179 static void ForEach(llvm::function_ref<IterationAction(Language *)> callback);
180
182
183 // Implement this function to return the user-defined entry point name
184 // for the language.
185 virtual llvm::StringRef GetUserEntryPointName() const { return {}; }
186
187 virtual bool IsTopLevelFunction(Function &function);
188
189 virtual bool IsSourceFile(llvm::StringRef file_path) const = 0;
190
192
194
196
199
200 virtual std::vector<FormattersMatchCandidate>
202 lldb::DynamicValueType use_dynamic);
203
204 virtual std::unique_ptr<TypeScavenger> GetTypeScavenger();
205
206 virtual const char *GetLanguageSpecificTypeLookupHelp();
207
209 std::string m_name;
210 lldb::FunctionNameType m_type;
211
212 public:
213 MethodNameVariant(std::string name, lldb::FunctionNameType type)
214 : m_name(std::move(name)), m_type(type) {}
215 llvm::StringRef GetName() const { return m_name; }
216 lldb::FunctionNameType GetType() const { return m_type; }
217 };
218 // If a language can have more than one possible name for a method, this
219 // function can be used to enumerate them. This is useful when doing name
220 // lookups.
221 virtual std::vector<Language::MethodNameVariant>
222 GetMethodNameVariants(llvm::StringRef method_name) const {
223 return std::vector<Language::MethodNameVariant>();
224 }
225
227 public:
229
230 MethodName(std::string full)
231 : m_full(std::move(full)), m_basename(), m_context(), m_arguments(),
233 m_parse_error(false) {}
234
235 virtual ~MethodName() {};
236
237 void Clear() {
238 m_full = {};
239 m_basename = llvm::StringRef();
240 m_context = llvm::StringRef();
241 m_arguments = llvm::StringRef();
242 m_qualifiers = llvm::StringRef();
243 m_return_type = llvm::StringRef();
244 m_scope_qualified.clear();
245 m_parsed = false;
246 m_parse_error = false;
247 }
248
249 bool IsValid() {
250 if (!m_parsed)
251 Parse();
252 if (m_parse_error)
253 return false;
254 return !m_full.empty();
255 }
256
257 const std::string &GetFullName() const { return m_full; }
258
259 llvm::StringRef GetBasename() {
260 if (!m_parsed)
261 Parse();
262 return m_basename;
263 }
264
265 llvm::StringRef GetContext() {
266 if (!m_parsed)
267 Parse();
268 return m_context;
269 }
270
271 llvm::StringRef GetArguments() {
272 if (!m_parsed)
273 Parse();
274 return m_arguments;
275 }
276
277 llvm::StringRef GetQualifiers() {
278 if (!m_parsed)
279 Parse();
280 return m_qualifiers;
281 }
282
283 llvm::StringRef GetReturnType() {
284 if (!m_parsed)
285 Parse();
286 return m_return_type;
287 }
288
289 std::string GetScopeQualifiedName() {
290 if (!m_parsed)
291 Parse();
292 return m_scope_qualified;
293 }
294
295 protected:
296 virtual void Parse() {
297 m_parsed = true;
298 m_parse_error = true;
299 }
300
301 std::string m_full; // Full name:
302 // "size_t lldb::SBTarget::GetBreakpointAtIndex(unsigned
303 // int) const"
304 llvm::StringRef m_basename; // Basename: "GetBreakpointAtIndex"
305 llvm::StringRef m_context; // Decl context: "lldb::SBTarget"
306 llvm::StringRef m_arguments; // Arguments: "(unsigned int)"
307 llvm::StringRef m_qualifiers; // Qualifiers: "const"
308 llvm::StringRef m_return_type; // Return type: "size_t"
309 std::string m_scope_qualified;
310 bool m_parsed = false;
311 bool m_parse_error = false;
312 };
313
314 virtual std::unique_ptr<Language::MethodName>
315 GetMethodName(llvm::StringRef name) const {
316 return std::make_unique<Language::MethodName>(name.str());
317 }
318
319 virtual std::pair<lldb::FunctionNameType, std::optional<ConstString>>
321 return std::pair{lldb::eFunctionNameTypeNone, std::nullopt};
322 };
323
324 /// Returns true iff the given symbol name is compatible with the mangling
325 /// scheme of this language.
326 ///
327 /// This function should only return true if there is a high confidence
328 /// that the name actually belongs to this language.
329 virtual bool SymbolNameFitsToLanguage(const Mangled &name) const {
330 return false;
331 }
332
333 /// How to demangle a name in DemangleSymbol().
335 /// Whether to compute the \c DemangledNameInfo too.
336 bool want_info = false;
337 };
338
339 /// A demangled name and, if requested, where its parts begin and end.
341 /// Empty if the name couldn't be demangled.
342 std::string name;
343 /// Only computed if DemangleOptions::want_info is true.
344 std::optional<DemangledNameInfo> info;
345 };
346
347 /// Demangle \p mangled, a name mangled with \p scheme, a scheme that this
348 /// language registered with Mangled::RegisterManglingScheme().
351 const DemangleOptions &options) const {
352 return {};
353 }
354
355 /// Parses mangled function names.
357 public:
358 virtual ~MangledNameParser() = default;
359
360 /// Parse a function name. Returns std::nullopt if \p mangled isn't a
361 /// function name that this parser understands.
362 virtual std::optional<Mangled::FunctionNameParts>
363 Parse(const Mangled &mangled) = 0;
364 };
365
366 /// Returns a parser for the names mangled with \p scheme, a scheme that this
367 /// language registered, or a nullptr if the symbol table should index them
368 /// by their demangled names.
369 virtual std::unique_ptr<MangledNameParser>
371 return nullptr;
372 }
373
374 /// An individual data formatter may apply to several types and cross language
375 /// boundaries. Each of those languages may want to customize the display of
376 /// values of said types by appending proper prefix/suffix information in
377 /// language-specific ways. This function returns that prefix and suffix.
378 ///
379 /// \param[in] type_hint
380 /// A StringRef used to determine what the prefix and suffix should be. It
381 /// is called a hint because some types may have multiple variants for which
382 /// the prefix and/or suffix may vary.
383 ///
384 /// \return
385 /// A std::pair<StringRef, StringRef>, the first being the prefix and the
386 /// second being the suffix. They may be empty.
387 virtual std::pair<llvm::StringRef, llvm::StringRef>
388 GetFormatterPrefixSuffix(llvm::StringRef type_hint);
389
390 // When looking up functions, we take a user provided string which may be a
391 // partial match to the full demangled name and compare it to the actual
392 // demangled name to see if it matches as much as the user specified. An
393 // example of this is if the user provided A::my_function, but the
394 // symbol was really B::A::my_function. We want that to be
395 // a match. But we wouldn't want this to match AnotherA::my_function. The
396 // user is specifying a truncated path, not a truncated set of characters.
397 // This function does a language-aware comparison for those purposes.
398 virtual bool DemangledNameContainsPath(llvm::StringRef path,
399 ConstString demangled) const;
400
401 // if a language has a custom format for printing variable declarations that
402 // it wants LLDB to honor it should return an appropriate closure here
404
405 virtual LazyBool IsLogicalTrue(ValueObject &valobj, Status &error);
406
407 // for a ValueObject of some "reference type", if the value points to the
408 // nil/null object, this method returns true
409 virtual bool IsNilReference(ValueObject &valobj);
410
411 /// Returns the summary string for ValueObjects for which IsNilReference() is
412 /// true.
413 virtual llvm::StringRef GetNilReferenceSummaryString() { return {}; }
414
415 // for a ValueObject of some "reference type", if the language provides a
416 // technique to decide whether the reference has ever been assigned to some
417 // object, this method will return true if such detection is possible, and if
418 // the reference has never been assigned
419 virtual bool IsUninitializedReference(ValueObject &valobj);
420
421 virtual bool GetFunctionDisplayName(const SymbolContext &sc,
422 const ExecutionContext *exe_ctx,
423 FunctionNameRepresentation representation,
424 Stream &s);
425
427 const ExecutionContext *exe_ctx,
429 Stream &s) {
430 return false;
431 }
432
433 virtual ConstString
435 if (ConstString demangled = mangled.GetDemangledName())
436 return demangled;
437
438 return mangled.GetMangledName();
439 }
440
442 return mangled.GetDemangledName();
443 }
444
445 virtual void GetExceptionResolverDescription(bool catch_on, bool throw_on,
446 Stream &s);
447
448 static void GetDefaultExceptionResolverDescription(bool catch_on,
449 bool throw_on, Stream &s);
450
451 // These are accessors for general information about the Languages lldb knows
452 // about:
453
454 static lldb::LanguageType
455 GetLanguageTypeFromString(const char *string) = delete;
456 static lldb::LanguageType GetLanguageTypeFromString(llvm::StringRef string);
457
458 /// Returns the internal LLDB name for the specified language. When presenting
459 /// the language name to users, use \ref GetDisplayNameForLanguageType
460 /// instead.
461 static const char *GetNameForLanguageType(lldb::LanguageType language);
462
463 /// Returns a user-friendly name for the specified language.
464 static llvm::StringRef
466
467 static void PrintAllLanguages(Stream &s, const char *prefix,
468 const char *suffix);
469
470 /// Prints to the specified stream 's' each language type that the
471 /// current target supports for expression evaluation.
472 ///
473 /// \param[out] s Stream to which the language types are written.
474 /// \param[in] prefix String that is prepended to the language type.
475 /// \param[in] suffix String that is appended to the language type.
477 llvm::StringRef prefix,
478 llvm::StringRef suffix);
479
480 // return false from callback to stop iterating
481 static void ForAllLanguages(
482 llvm::function_ref<IterationAction(lldb::LanguageType)> callback);
483
484 static bool LanguageIsCPlusPlus(lldb::LanguageType language);
485
486 static bool LanguageIsObjC(lldb::LanguageType language);
487
488 static bool LanguageIsC(lldb::LanguageType language);
489
490 /// Equivalent to \c LanguageIsC||LanguageIsObjC||LanguageIsCPlusPlus.
491 static bool LanguageIsCFamily(lldb::LanguageType language);
492
493 static bool LanguageIsFortran(lldb::LanguageType language);
494
495 static bool LanguageIsPascal(lldb::LanguageType language);
496
497 // return the primary language, so if LanguageIsC(l), return eLanguageTypeC,
498 // etc.
500
501 static std::set<lldb::LanguageType> GetSupportedLanguages();
502
506
508
509 // Given a mangled function name, calculates some alternative manglings since
510 // the compiler mangling may not line up with the symbol we are expecting.
511 virtual std::vector<ConstString>
513 return std::vector<ConstString>();
514 }
515
516 virtual ConstString
518 const SymbolContext &sym_ctx) const {
519 return ConstString();
520 }
521
522 virtual llvm::StringRef GetInstanceName() { return {}; }
523
524 /// Given a symbol context list of matches which supposedly represent the
525 /// same file and line number in a CU, erases those that should be ignored
526 /// when setting breakpoints by line (number or regex). Helpful for languages
527 /// that create split a single source-line into many functions (e.g. call
528 /// sites transformed by CoroSplitter).
529 virtual void
531
532 /// Returns a boolean indicating whether two symbol contexts are equal for the
533 /// purposes of frame comparison. If the plugin has no opinion, it should
534 /// return nullopt.
535 virtual std::optional<bool>
537 const SymbolContext &sc2) const {
538 return {};
539 }
540
541 virtual std::optional<bool> GetBooleanFromString(llvm::StringRef str) const;
542
543 /// Returns true if this Language supports exception breakpoints on throw via
544 /// a corresponding LanguageRuntime plugin.
545 virtual bool SupportsExceptionBreakpointsOnThrow() const { return false; }
546
547 /// Returns true if this Language supports exception breakpoints on catch via
548 /// a corresponding LanguageRuntime plugin.
549 virtual bool SupportsExceptionBreakpointsOnCatch() const { return false; }
550
551 /// Returns the keyword used for throw statements in this language, e.g.
552 /// Python uses \b raise. Defaults to \b throw.
553 virtual llvm::StringRef GetThrowKeyword() const { return "throw"; }
554
555 /// Returns the keyword used for catch statements in this language, e.g.
556 /// Python uses \b except. Defaults to \b catch.
557 virtual llvm::StringRef GetCatchKeyword() const { return "catch"; }
558
559 virtual FormatEntity::Entry GetFunctionNameFormat() const { return {}; }
560
561protected:
562 // Classes that inherit from Language can see and modify these
563
565
566private:
567 Language(const Language &) = delete;
568 const Language &operator=(const Language &) = delete;
569};
570
571} // namespace lldb_private
572
573namespace llvm {
574template <> struct format_provider<lldb::LanguageType> {
575 static void format(const lldb::LanguageType &language, llvm::raw_ostream &OS,
576 llvm::StringRef Options);
577};
578} // namespace llvm
579
580#endif // LLDB_TARGET_LANGUAGE_H
static llvm::raw_ostream & error(Stream &strm)
Generic representation of a type in a programming language.
A uniqued constant string class.
Definition ConstString.h:40
std::function< bool(llvm::StringRef, llvm::StringRef, const DumpValueObjectOptions &, Stream &)> DeclPrintingHelper
"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.
A class that describes a function.
Definition Function.h:386
HardcodedFormatterFinders< SyntheticChildren > HardcodedSyntheticFinder
HardcodedFormatterFinders< TypeSummaryImpl > HardcodedSummaryFinder
HardcodedFormatterFinders< TypeFormatImpl > HardcodedFormatFinder
static llvm::StringRef GetSettingName()
Definition Language.cpp:47
bool GetEnableFilterForLineBreakpoints() const
Definition Language.cpp:57
bool Find_Impl(ExecutionContextScope *exe_scope, const char *key, ResultSet &results) override
Definition Language.h:118
std::vector< std::shared_ptr< TypeScavenger > > m_scavengers
Definition Language.h:128
bool DumpToStream(Stream &stream, bool print_help_if_available) override
Definition Language.h:78
virtual CompilerType AdjustForInclusion(CompilerType &candidate)=0
bool Find_Impl(ExecutionContextScope *exe_scope, const char *key, ResultSet &results) override
Definition Language.cpp:542
Parses mangled function names.
Definition Language.h:356
virtual std::optional< Mangled::FunctionNameParts > Parse(const Mangled &mangled)=0
Parse a function name.
lldb::FunctionNameType GetType() const
Definition Language.h:216
MethodNameVariant(std::string name, lldb::FunctionNameType type)
Definition Language.h:213
const std::string & GetFullName() const
Definition Language.h:257
llvm::StringRef GetQualifiers()
Definition Language.h:277
llvm::StringRef GetReturnType()
Definition Language.h:283
virtual bool DumpToStream(Stream &stream, bool print_help_if_available)=0
std::set< std::unique_ptr< Result > > ResultSet
Definition Language.h:57
virtual bool Find_Impl(ExecutionContextScope *exe_scope, const char *key, ResultSet &results)=0
size_t Find(ExecutionContextScope *exe_scope, const char *key, ResultSet &results, bool append=true)
Definition Language.cpp:523
std::vector< std::shared_ptr< TypeScavenger > > m_scavengers
Definition Language.h:152
bool Find_Impl(ExecutionContextScope *exe_scope, const char *key, ResultSet &results) override
Definition Language.h:141
virtual bool IsSourceFile(llvm::StringRef file_path) const =0
static void PrintSupportedLanguagesForExpressions(Stream &s, llvm::StringRef prefix, llvm::StringRef suffix)
Prints to the specified stream 's' each language type that the current target supports for expression...
Definition Language.cpp:340
static LanguageSet GetLanguagesSupportingREPLs()
Definition Language.cpp:513
static LanguageSet GetLanguagesSupportingTypeSystems()
Definition Language.cpp:505
virtual std::optional< bool > GetBooleanFromString(llvm::StringRef str) const
Definition Language.cpp:613
virtual ConstString GetDisplayDemangledName(Mangled mangled) const
Definition Language.h:441
virtual std::vector< FormattersMatchCandidate > GetPossibleFormattersMatches(ValueObject &valobj, lldb::DynamicValueType use_dynamic)
Definition Language.cpp:242
virtual bool HandleFrameFormatVariable(const SymbolContext &sc, const ExecutionContext *exe_ctx, FormatEntity::Entry::Type type, Stream &s)
Definition Language.h:426
virtual bool SupportsExceptionBreakpointsOnCatch() const
Returns true if this Language supports exception breakpoints on catch via a corresponding LanguageRun...
Definition Language.h:549
virtual DemangledName DemangleSymbol(ConstString mangled, Mangled::ManglingScheme scheme, const DemangleOptions &options) const
Demangle mangled, a name mangled with scheme, a scheme that this language registered with Mangled::Re...
Definition Language.h:349
virtual lldb::TypeCategoryImplSP GetFormatters()
Definition Language.cpp:226
virtual llvm::StringRef GetInstanceName()
Definition Language.h:522
static void ForEach(llvm::function_ref< IterationAction(Language *)> callback)
Definition Language.cpp:151
virtual std::unique_ptr< MangledNameParser > CreateMangledNameParser(Mangled::ManglingScheme scheme) const
Returns a parser for the names mangled with scheme, a scheme that this language registered,...
Definition Language.h:370
static void ForAllLanguages(llvm::function_ref< IterationAction(lldb::LanguageType)> callback)
Definition Language.cpp:358
static Language * FindPlugin(lldb::LanguageType language)
Definition Language.cpp:86
static const char * GetNameForLanguageType(lldb::LanguageType language)
Returns the internal LLDB name for the specified language.
Definition Language.cpp:329
virtual bool SymbolNameFitsToLanguage(const Mangled &name) const
Returns true iff the given symbol name is compatible with the mangling scheme of this language.
Definition Language.h:329
virtual void FilterForLineBreakpoints(llvm::SmallVectorImpl< SymbolContext > &) const
Given a symbol context list of matches which supposedly represent the same file and line number in a ...
Definition Language.h:530
virtual DumpValueObjectOptions::DeclPrintingHelper GetDeclPrintingHelper()
Definition Language.cpp:582
virtual std::unique_ptr< Language::MethodName > GetMethodName(llvm::StringRef name) const
Definition Language.h:315
static LanguageProperties & GetGlobalLanguageProperties()
Definition Language.cpp:42
virtual LazyBool IsLogicalTrue(ValueObject &valobj, Status &error)
Definition Language.cpp:586
virtual ConstString GetDemangledFunctionNameWithoutArguments(Mangled mangled) const
Definition Language.h:434
virtual const char * GetLanguageSpecificTypeLookupHelp()
Definition Language.cpp:521
virtual bool GetFunctionDisplayName(const SymbolContext &sc, const ExecutionContext *exe_ctx, FunctionNameRepresentation representation, Stream &s)
Definition Language.cpp:594
virtual std::pair< llvm::StringRef, llvm::StringRef > GetFormatterPrefixSuffix(llvm::StringRef type_hint)
An individual data formatter may apply to several types and cross language boundaries.
Definition Language.cpp:570
virtual llvm::StringRef GetCatchKeyword() const
Returns the keyword used for catch statements in this language, e.g.
Definition Language.h:557
virtual llvm::StringRef GetThrowKeyword() const
Returns the keyword used for throw statements in this language, e.g.
Definition Language.h:553
static bool LanguageIsC(lldb::LanguageType language)
Definition Language.cpp:391
virtual lldb::LanguageType GetLanguageType() const =0
virtual HardcodedFormatters::HardcodedSummaryFinder GetHardcodedSummaries()
Definition Language.cpp:232
static void GetDefaultExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s)
Definition Language.cpp:606
virtual std::pair< lldb::FunctionNameType, std::optional< ConstString > > GetFunctionNameInfo(ConstString name) const
Definition Language.h:320
virtual bool SupportsExceptionBreakpointsOnThrow() const
Returns true if this Language supports exception breakpoints on throw via a corresponding LanguageRun...
Definition Language.h:545
virtual std::optional< bool > AreEqualForFrameComparison(const SymbolContext &sc1, const SymbolContext &sc2) const
Returns a boolean indicating whether two symbol contexts are equal for the purposes of frame comparis...
Definition Language.h:536
virtual std::vector< Language::MethodNameVariant > GetMethodNameVariants(llvm::StringRef method_name) const
Definition Language.h:222
virtual bool DemangledNameContainsPath(llvm::StringRef path, ConstString demangled) const
Definition Language.cpp:574
virtual std::vector< ConstString > GenerateAlternateFunctionManglings(const ConstString mangled) const
Definition Language.h:512
static bool LanguageIsCPlusPlus(lldb::LanguageType language)
Definition Language.cpp:366
static llvm::StringRef GetDisplayNameForLanguageType(lldb::LanguageType language)
Returns a user-friendly name for the specified language.
Definition Language.cpp:336
static Language * FindPluginForManglingScheme(Mangled::ManglingScheme scheme)
Returns the Language that registered scheme with Mangled::RegisterManglingScheme(),...
Definition Language.cpp:130
static lldb::LanguageType GetPrimaryLanguage(lldb::LanguageType language)
Definition Language.cpp:446
const Language & operator=(const Language &)=delete
virtual ConstString FindBestAlternateFunctionMangledName(const Mangled mangled, const SymbolContext &sym_ctx) const
Definition Language.h:517
static bool LanguageIsPascal(lldb::LanguageType language)
Definition Language.cpp:437
virtual bool IsNilReference(ValueObject &valobj)
Definition Language.cpp:590
virtual bool IsUninitializedReference(ValueObject &valobj)
Definition Language.cpp:592
virtual FormatEntity::Entry GetFunctionNameFormat() const
Definition Language.h:559
virtual llvm::StringRef GetNilReferenceSummaryString()
Returns the summary string for ValueObjects for which IsNilReference() is true.
Definition Language.h:413
static void PrintAllLanguages(Stream &s, const char *prefix, const char *suffix)
Definition Language.cpp:351
static llvm::Expected< lldb::LanguageType > GetExceptionLanguageForLanguage(llvm::StringRef lang_name)
Definition Language.cpp:183
virtual HardcodedFormatters::HardcodedSyntheticFinder GetHardcodedSynthetics()
Definition Language.cpp:237
virtual std::unique_ptr< TypeScavenger > GetTypeScavenger()
Definition Language.cpp:517
static bool LanguageIsFortran(lldb::LanguageType language)
Definition Language.cpp:423
static LanguageSet GetLanguagesSupportingTypeSystemsForExpressions()
Definition Language.cpp:509
virtual llvm::StringRef GetUserEntryPointName() const
Definition Language.h:185
virtual bool IsTopLevelFunction(Function &function)
Definition Language.cpp:224
virtual void GetExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s)
Definition Language.cpp:601
static lldb::LanguageType GetLanguageTypeFromString(const char *string)=delete
Language(const Language &)=delete
static bool LanguageIsCFamily(lldb::LanguageType language)
Equivalent to LanguageIsC||LanguageIsObjC||LanguageIsCPlusPlus.
Definition Language.cpp:403
static std::set< lldb::LanguageType > GetSupportedLanguages()
Definition Language.cpp:496
virtual HardcodedFormatters::HardcodedFormatFinder GetHardcodedFormats()
Definition Language.cpp:228
static bool LanguageIsObjC(lldb::LanguageType language)
Definition Language.cpp:381
A class that handles mangled names.
Definition Mangled.h:36
ConstString GetMangledName() const
Mangled name get accessor.
Definition Mangled.h:169
ConstString GetDemangledName() const
Demangled name get accessor.
Definition Mangled.cpp:238
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
size_t EOL()
Output and End of Line character to the stream.
Definition Stream.cpp:155
Defines a symbol context baton that can be handed other debug core functions.
A class that represents a running process on the host machine.
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
LanguageType
Programming language type.
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
How to demangle a name in DemangleSymbol().
Definition Language.h:334
bool want_info
Whether to compute the DemangledNameInfo too.
Definition Language.h:336
A demangled name and, if requested, where its parts begin and end.
Definition Language.h:340
std::optional< DemangledNameInfo > info
Only computed if DemangleOptions::want_info is true.
Definition Language.h:344
std::string name
Empty if the name couldn't be demangled.
Definition Language.h:342
static void format(const lldb::LanguageType &language, llvm::raw_ostream &OS, llvm::StringRef Options)
Definition Language.cpp:673