LLDB mainline
SBLanguageRuntime.cpp
Go to the documentation of this file.
1//===-- SBLanguageRuntime.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
13
14using namespace lldb;
15using namespace lldb_private;
16
19 LLDB_INSTRUMENT_VA(string);
20
21 return Language::GetLanguageTypeFromString(llvm::StringRef(string));
22}
23
24const char *
30
34
38
42
44 lldb::LanguageType language) {
45 if (Language *lang_plugin = Language::FindPlugin(language))
46 return lang_plugin->SupportsExceptionBreakpointsOnThrow();
47 return false;
48}
49
51 lldb::LanguageType language) {
52 if (Language *lang_plugin = Language::FindPlugin(language))
53 return lang_plugin->SupportsExceptionBreakpointsOnCatch();
54 return false;
55}
56
57const char *
59 if (Language *lang_plugin = Language::FindPlugin(language))
61 lang_plugin->GetThrowKeyword());
62 return nullptr;
63}
64
65const char *
67 if (Language *lang_plugin = Language::FindPlugin(language))
69 lang_plugin->GetCatchKeyword());
70 return nullptr;
71}
#define LLDB_INSTRUMENT_VA(...)
static bool LanguageIsObjC(lldb::LanguageType language)
Returns whether the given language is Obj-C or Obj-C++.
static bool LanguageIsCFamily(lldb::LanguageType language)
Returns whether the given language is any version of C, C++ or Obj-C.
static bool SupportsExceptionBreakpointsOnThrow(lldb::LanguageType language)
Returns whether the given language supports exception breakpoints on throw statements.
static bool SupportsExceptionBreakpointsOnCatch(lldb::LanguageType language)
Returns whether the given language supports exception breakpoints on catch statements.
static const char * GetNameForLanguageType(lldb::LanguageType language)
static const char * GetThrowKeywordForLanguage(lldb::LanguageType language)
Returns the keyword used for throw statements in the given language, e.g.
static bool LanguageIsCPlusPlus(lldb::LanguageType language)
Returns whether the given language is any version of C++.
static const char * GetCatchKeywordForLanguage(lldb::LanguageType language)
Returns the keyword used for catch statements in the given language, e.g.
static lldb::LanguageType GetLanguageTypeFromString(const char *string)
static Language * FindPlugin(lldb::LanguageType language)
Definition Language.cpp:84
static const char * GetNameForLanguageType(lldb::LanguageType language)
Returns the internal LLDB name for the specified language.
Definition Language.cpp:305
static bool LanguageIsCPlusPlus(lldb::LanguageType language)
Definition Language.cpp:342
static lldb::LanguageType GetLanguageTypeFromString(const char *string)=delete
static bool LanguageIsCFamily(lldb::LanguageType language)
Equivalent to LanguageIsC||LanguageIsObjC||LanguageIsCPlusPlus.
Definition Language.cpp:379
static bool LanguageIsObjC(lldb::LanguageType language)
Definition Language.cpp:357
const char * InternNonEmpty(llvm::StringRef str) const
Like Intern, but an empty string yields nullptr.
Definition StringPool.h:81
static StringPoolRef GetSystemPool()
The system pool. Only valid between Initialize and Terminate.
A class that represents a running process on the host machine.
LanguageType
Programming language type.