LLDB  mainline
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 
18 #include "lldb/lldb-private.h"
19 
20 namespace lldb_private {
21 
23 public:
25  Lambda = 0,
28  Invalid
29  };
30 
38  };
39 
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 
55  }
56 
57  static CPPLanguageRuntime *Get(Process &process) {
58  return llvm::cast_or_null<CPPLanguageRuntime>(
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:
87  llvm::StringMap<CPPLanguageRuntime::LibCppStdFunctionCallableInfo>;
88 
90 };
91 
92 } // namespace lldb_private
93 
94 #endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
lldb_private::CPPLanguageRuntime::ID
static char ID
Definition: CPPLanguageRuntime.h:43
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_symbol
Symbol callable_symbol
Definition: CPPLanguageRuntime.h:32
lldb_private::Value
Definition: Value.h:38
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase
LibCppStdFunctionCallableCase
Definition: CPPLanguageRuntime.h:24
lldb_private::Process
Definition: Process.h:341
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::CPPLanguageRuntime::isA
bool isA(const void *ClassID) const override
Definition: CPPLanguageRuntime.h:45
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
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::LanguageRuntime::isA
virtual bool isA(const void *ClassID) const
Definition: LanguageRuntime.h:173
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::CallableObject
@ CallableObject
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::Thread
Definition: Thread.h:60
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::FreeOrMemberFunction
@ FreeOrMemberFunction
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::Invalid
@ Invalid
PluginInterface.h
lldb_private::CPPLanguageRuntime::Get
static CPPLanguageRuntime * Get(Process &process)
Definition: CPPLanguageRuntime.h:57
lldb_private::LanguageRuntime
Definition: LanguageRuntime.h:60
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::classof
static bool classof(const LanguageRuntime *runtime)
Definition: CPPLanguageRuntime.h:49
lldb-private.h
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::member__f_pointer_value
lldb::addr_t member__f_pointer_value
Definition: CPPLanguageRuntime.h:35
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_case
LibCppStdFunctionCallableCase callable_case
Definition: CPPLanguageRuntime.h:36
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::CPPLanguageRuntime::CallableLookupCache
OperatorStringToCallableInfoMap CallableLookupCache
Definition: CPPLanguageRuntime.h:89
lldb_private::Address
Definition: Address.h:59
lldb_private::CPPLanguageRuntime::OperatorStringToCallableInfoMap
llvm::StringMap< CPPLanguageRuntime::LibCppStdFunctionCallableInfo > OperatorStringToCallableInfoMap
Definition: CPPLanguageRuntime.h:87
lldb_private::Process::GetLanguageRuntime
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition: Process.cpp:1513
LanguageRuntime.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::CPPLanguageRuntime::GetLanguageType
lldb::LanguageType GetLanguageType() const override
Definition: CPPLanguageRuntime.h:53
lldb_private::CPPLanguageRuntime::GetObjectDescription
bool GetObjectDescription(Stream &str, ValueObject &object) override
Definition: CPPLanguageRuntime.cpp:47
lldb_private::CPPLanguageRuntime::CPPLanguageRuntime
CPPLanguageRuntime(Process *process)
Definition: CPPLanguageRuntime.cpp:40
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo
Definition: CPPLanguageRuntime.h:31
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_address
Address callable_address
Definition: CPPLanguageRuntime.h:33
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableInfo::callable_line_entry
LineEntry callable_line_entry
Definition: CPPLanguageRuntime.h:34
lldb_private::CPPLanguageRuntime
Definition: CPPLanguageRuntime.h:22
lldb_private::LineEntry
Definition: LineEntry.h:20
lldb_private::CPPLanguageRuntime::LibCppStdFunctionCallableCase::Lambda
@ Lambda
lldb::eLanguageTypeC_plus_plus
@ eLanguageTypeC_plus_plus
ISO C++:1998.
Definition: lldb-enumerations.h:441