aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/LanguageRuntime/CPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/CPlusPlus')
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp5
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h13
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp29
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h19
4 files changed, 32 insertions, 34 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
index d556aae1c458..8aa803a8553e 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
@@ -1,4 +1,4 @@
-//===-- CPPLanguageRuntime.cpp
+//===-- CPPLanguageRuntime.cpp---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -20,7 +20,6 @@
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/UniqueCStringMap.h"
-#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContext.h"
@@ -44,7 +43,7 @@ CPPLanguageRuntime::~CPPLanguageRuntime() {}
CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
: LanguageRuntime(process) {}
-bool CPPLanguageRuntime::IsWhitelistedRuntimeValue(ConstString name) {
+bool CPPLanguageRuntime::IsAllowedRuntimeValue(ConstString name) {
return name == g_this;
}
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
index abdd79fcd7b9..5b00590e6301 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_CPPLanguageRuntime_h_
-#define liblldb_CPPLanguageRuntime_h_
+#ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
+#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
#include <vector>
@@ -69,7 +69,7 @@ public:
/// Obtain a ThreadPlan to get us into C++ constructs such as std::function.
///
/// \param[in] thread
- /// Curent thrad of execution.
+ /// Current thrad of execution.
///
/// \param[in] stop_others
/// True if other threads should pause during execution.
@@ -79,7 +79,7 @@ public:
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
bool stop_others) override;
- bool IsWhitelistedRuntimeValue(ConstString name) override;
+ bool IsAllowedRuntimeValue(ConstString name) override;
protected:
// Classes that inherit from CPPLanguageRuntime can see and modify these
CPPLanguageRuntime(Process *process);
@@ -90,9 +90,10 @@ private:
OperatorStringToCallableInfoMap CallableLookupCache;
- DISALLOW_COPY_AND_ASSIGN(CPPLanguageRuntime);
+ CPPLanguageRuntime(const CPPLanguageRuntime &) = delete;
+ const CPPLanguageRuntime &operator=(const CPPLanguageRuntime &) = delete;
};
} // namespace lldb_private
-#endif // liblldb_CPPLanguageRuntime_h_
+#endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 9efb021caa83..3ab32641d9c1 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -1,5 +1,4 @@
-//===-- ItaniumABILanguageRuntime.cpp --------------------------------------*-
-//C++ -*-===//
+//===-- ItaniumABILanguageRuntime.cpp -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,6 +8,7 @@
#include "ItaniumABILanguageRuntime.h"
+#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Mangled.h"
#include "lldb/Core/Module.h"
@@ -21,7 +21,6 @@
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeList.h"
@@ -41,6 +40,8 @@
using namespace lldb;
using namespace lldb_private;
+LLDB_PLUGIN_DEFINE_ADV(ItaniumABILanguageRuntime, CXXItaniumABI)
+
static const char *vtable_demangled_prefix = "vtable for ";
char ItaniumABILanguageRuntime::ID = 0;
@@ -73,9 +74,7 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
Symbol *symbol = sc.symbol;
if (symbol != nullptr) {
const char *name =
- symbol->GetMangled()
- .GetDemangledName(lldb::eLanguageTypeC_plus_plus)
- .AsCString();
+ symbol->GetMangled().GetDemangledName().AsCString();
if (name && strstr(name, vtable_demangled_prefix) == name) {
Log *log(
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
@@ -118,7 +117,7 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
if (class_types.GetSize() == 1) {
type_sp = class_types.GetTypeAtIndex(0);
if (type_sp) {
- if (ClangASTContext::IsCXXClassType(
+ if (TypeSystemClang::IsCXXClassType(
type_sp->GetForwardCompilerType())) {
LLDB_LOGF(
log,
@@ -150,7 +149,7 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
for (i = 0; i < class_types.GetSize(); i++) {
type_sp = class_types.GetTypeAtIndex(i);
if (type_sp) {
- if (ClangASTContext::IsCXXClassType(
+ if (TypeSystemClang::IsCXXClassType(
type_sp->GetForwardCompilerType())) {
LLDB_LOGF(
log,
@@ -238,7 +237,7 @@ bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
if (!type)
return true;
- if (ClangASTContext::AreTypesSame(in_value.GetCompilerType(), type)) {
+ if (TypeSystemClang::AreTypesSame(in_value.GetCompilerType(), type)) {
// The dynamic type we found was the same type, so we don't have a
// dynamic type here...
return false;
@@ -358,8 +357,7 @@ protected:
Mangled mangled(name);
if (mangled.GuessLanguage() == lldb::eLanguageTypeC_plus_plus) {
- ConstString demangled(
- mangled.GetDisplayDemangledName(lldb::eLanguageTypeC_plus_plus));
+ ConstString demangled(mangled.GetDisplayDemangledName());
demangled_any = true;
result.AppendMessageWithFormat("%s ---> %s\n", entry.c_str(),
demangled.GetCString());
@@ -420,12 +418,13 @@ lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginName() {
uint32_t ItaniumABILanguageRuntime::GetPluginVersion() { return 1; }
BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
- Breakpoint *bkpt, bool catch_bp, bool throw_bp) {
+ const BreakpointSP &bkpt, bool catch_bp, bool throw_bp) {
return CreateExceptionResolver(bkpt, catch_bp, throw_bp, false);
}
BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
- Breakpoint *bkpt, bool catch_bp, bool throw_bp, bool for_expressions) {
+ const BreakpointSP &bkpt, bool catch_bp, bool throw_bp,
+ bool for_expressions) {
// One complication here is that most users DON'T want to stop at
// __cxa_allocate_expression, but until we can do anything better with
// predicting unwinding the expression parser does. So we have two forms of
@@ -536,8 +535,8 @@ ValueObjectSP ItaniumABILanguageRuntime::GetExceptionObjectForThread(
if (!thread_sp->SafeToCallFunctions())
return {};
- ClangASTContext *clang_ast_context =
- ClangASTContext::GetScratch(m_process->GetTarget());
+ TypeSystemClang *clang_ast_context =
+ TypeSystemClang::GetScratch(m_process->GetTarget());
if (!clang_ast_context)
return {};
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
index 97cc81b8681f..d591527d9257 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_ItaniumABILanguageRuntime_h_
-#define liblldb_ItaniumABILanguageRuntime_h_
+#ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_ITANIUMABI_ITANIUMABILANGUAGERUNTIME_H
+#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_ITANIUMABI_ITANIUMABILANGUAGERUNTIME_H
#include <map>
#include <mutex>
@@ -66,9 +66,9 @@ public:
bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override;
- lldb::BreakpointResolverSP CreateExceptionResolver(Breakpoint *bkpt,
- bool catch_bp,
- bool throw_bp) override;
+ lldb::BreakpointResolverSP
+ CreateExceptionResolver(const lldb::BreakpointSP &bkpt,
+ bool catch_bp, bool throw_bp) override;
lldb::SearchFilterSP CreateExceptionSearchFilter() override;
@@ -81,10 +81,9 @@ public:
uint32_t GetPluginVersion() override;
protected:
- lldb::BreakpointResolverSP CreateExceptionResolver(Breakpoint *bkpt,
- bool catch_bp,
- bool throw_bp,
- bool for_expressions);
+ lldb::BreakpointResolverSP
+ CreateExceptionResolver(const lldb::BreakpointSP &bkpt,
+ bool catch_bp, bool throw_bp, bool for_expressions);
lldb::BreakpointSP CreateExceptionBreakpoint(bool catch_bp, bool throw_bp,
bool for_expressions,
@@ -114,4 +113,4 @@ private:
} // namespace lldb_private
-#endif // liblldb_ItaniumABILanguageRuntime_h_
+#endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_ITANIUMABI_ITANIUMABILANGUAGERUNTIME_H