LLDB
mainline
llvm-project
lldb
source
Plugins
LanguageRuntime
CPlusPlus
CPPLanguageRuntime.h
Go to the documentation of this file.
1
//===-- CPPLanguageRuntime.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_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
10
#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
11
12
#include <vector>
13
14
#include "llvm/ADT/StringMap.h"
15
16
#include "
lldb/Core/PluginInterface.h
"
17
#include "
lldb/Target/LanguageRuntime.h
"
18
#include "
lldb/lldb-private.h
"
19
20
namespace
lldb_private
{
21
22
class
CPPLanguageRuntime
:
public
LanguageRuntime
{
23
public
:
24
enum class
LibCppStdFunctionCallableCase
{
25
Lambda
= 0,
26
CallableObject
,
27
FreeOrMemberFunction
,
28
Invalid
29
};
30
31
struct
LibCppStdFunctionCallableInfo
{
32
Symbol
callable_symbol
;
33
Address
callable_address
;
34
LineEntry
callable_line_entry
;
35
lldb::addr_t
member_f_pointer_value
= 0u;
36
LibCppStdFunctionCallableCase
callable_case
=
37
LibCppStdFunctionCallableCase::Invalid
;
38
};
39
40
LibCppStdFunctionCallableInfo
41
FindLibCppStdFunctionCallableInfo
(lldb::ValueObjectSP &valobj_sp);
42
43
static
char
ID
;
44
45
bool
isA
(
const
void
*ClassID)
const override
{
46
return
ClassID == &
ID
||
LanguageRuntime::isA
(ClassID);
47
}
48
49
static
bool
classof
(
const
LanguageRuntime
*runtime) {
50
return
runtime->
isA
(&
ID
);
51
}
52
53
lldb::LanguageType
GetLanguageType
()
const override
{
54
return
lldb::eLanguageTypeC_plus_plus
;
55
}
56
57
static
CPPLanguageRuntime
*
Get
(
Process
&process) {
58
return
llvm::cast_or_null<CPPLanguageRuntime>(
59
process.
GetLanguageRuntime
(
lldb::eLanguageTypeC_plus_plus
));
60
}
61
62
bool
GetObjectDescription
(
Stream
&str,
ValueObject
&
object
)
override
;
63
64
bool
GetObjectDescription
(
Stream
&str,
Value
&value,
65
ExecutionContextScope
*exe_scope)
override
;
66
67
/// Obtain a ThreadPlan to get us into C++ constructs such as std::function.
68
///
69
/// \param[in] thread
70
/// Current thrad of execution.
71
///
72
/// \param[in] stop_others
73
/// True if other threads should pause during execution.
74
///
75
/// \return
76
/// A ThreadPlan Shared pointer
77
lldb::ThreadPlanSP
GetStepThroughTrampolinePlan
(
Thread
&thread,
78
bool
stop_others)
override
;
79
80
bool
IsAllowedRuntimeValue
(
ConstString
name)
override
;
81
protected
:
82
// Classes that inherit from CPPLanguageRuntime can see and modify these
83
CPPLanguageRuntime
(
Process
*process);
84
85
private
:
86
using
OperatorStringToCallableInfoMap
=
87
llvm::StringMap<CPPLanguageRuntime::LibCppStdFunctionCallableInfo>;
88
89
OperatorStringToCallableInfoMap
CallableLookupCache
;
90
};
91
92
}
// namespace lldb_private
93
94
#endif
// LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
LanguageRuntime.h
PluginInterface.h
lldb_private::Address
A section + offset based address class.
Definition:
Address.h:59
lldb_private::CPPLanguageRuntime
Definition:
CPPLanguageRuntime.h:22
lldb_private::CPPLanguageRuntime::classof
static bool classof(const LanguageRuntime *runtime)
Definition:
CPPLanguageRuntime.h:49
lldb_private::CPPLanguageRuntime::IsAllowedRuntimeValue
bool IsAllowedRuntimeValue(ConstString name) override
Identify whether a name is a runtime value that should not be hidden by from the user interface.
Definition:
CPPLanguageRuntime.cpp:43
lldb_private::CPPLanguageRuntime::OperatorStringToCallableInfoMap
llvm::StringMap< CPPLanguageRuntime::LibCppStdFunctionCallableInfo > OperatorStringToCallableInfoMap
Definition:
CPPLanguageRuntime.h:87
lldb_private::CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo
LibCppStdFunctionCallableInfo FindLibCppStdFunctionCallableInfo(lldb::ValueObjectSP &valobj_sp)
Definition:
CPPLanguageRuntime.cpp:100
lldb_private::CPPLanguageRuntime::GetStepThroughTrampolinePlan
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) override
Obtain a ThreadPlan to get us into C++ constructs such as std::function.
Definition:
CPPLanguageRuntime.cpp:340
lldb_private::CPPLanguageRuntime::isA
bool isA(const void *ClassID) const override
Definition:
CPPLanguageRuntime.h:45
lldb_private::CPPLanguageRuntime::Get
static CPPLanguageRuntime * Get(Process &process)
Definition:
CPPLanguageRuntime.h:57
lldb_private::CPPLanguageRuntime::GetLanguageType
lldb::LanguageType GetLanguageType() const override
Definition:
CPPLanguageRuntime.h:53
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase
LibCppStdFunctionCallableCase
Definition:
CPPLanguageRuntime.h:24
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::Lambda
@ Lambda
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::Invalid
@ Invalid
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::FreeOrMemberFunction
@ FreeOrMemberFunction
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::CallableObject
@ CallableObject
lldb_private::CPPLanguageRuntime::ID
static char ID
Definition:
CPPLanguageRuntime.h:43
lldb_private::CPPLanguageRuntime::CallableLookupCache
OperatorStringToCallableInfoMap CallableLookupCache
Definition:
CPPLanguageRuntime.h:89
lldb_private::CPPLanguageRuntime::GetObjectDescription
bool GetObjectDescription(Stream &str, ValueObject &object) override
Definition:
CPPLanguageRuntime.cpp:47
lldb_private::ConstString
A uniqued constant string class.
Definition:
ConstString.h:39
lldb_private::ExecutionContextScope
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
Definition:
ExecutionContextScope.h:32
lldb_private::LanguageRuntime
Definition:
LanguageRuntime.h:61
lldb_private::LanguageRuntime::isA
virtual bool isA(const void *ClassID) const
Definition:
LanguageRuntime.h:174
lldb_private::Process
A plug-in interface definition class for debugging a process.
Definition:
Process.h:333
lldb_private::Process::GetLanguageRuntime
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition:
Process.cpp:1516
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb_private::Symbol
Definition:
Symbol.h:31
lldb_private::Thread
Definition:
Thread.h:65
lldb_private::ValueObject
ValueObject:
Definition:
ValueObject.h:105
lldb_private::Value
Definition:
Value.h:38
lldb-private.h
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAttachInfo.h:14
lldb::LanguageType
LanguageType
Programming language type.
Definition:
lldb-enumerations.h:443
lldb::eLanguageTypeC_plus_plus
@ eLanguageTypeC_plus_plus
ISO C++:1998.
Definition:
lldb-enumerations.h:448
lldb::addr_t
uint64_t addr_t
Definition:
lldb-types.h:79
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo
Definition:
CPPLanguageRuntime.h:31
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_symbol
Symbol callable_symbol
Definition:
CPPLanguageRuntime.h:32
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::member_f_pointer_value
lldb::addr_t member_f_pointer_value
Definition:
CPPLanguageRuntime.h:35
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_line_entry
LineEntry callable_line_entry
Definition:
CPPLanguageRuntime.h:34
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_address
Address callable_address
Definition:
CPPLanguageRuntime.h:33
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_case
LibCppStdFunctionCallableCase callable_case
Definition:
CPPLanguageRuntime.h:36
lldb_private::LineEntry
A line table entry class.
Definition:
LineEntry.h:20
Generated on Wed May 31 2023 07:27:00 for LLDB by
1.9.6