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 
35  lldb::addr_t member__f_pointer_value = 0u;
38  };
39 
41  FindLibCppStdFunctionCallableInfo(lldb::ValueObjectSP &valobj_sp);
42 
43  ~CPPLanguageRuntime() override;
44 
45  static char ID;
46 
47  bool isA(const void *ClassID) const override {
48  return ClassID == &ID || LanguageRuntime::isA(ClassID);
49  }
50 
51  static bool classof(const LanguageRuntime *runtime) {
52  return runtime->isA(&ID);
53  }
54 
57  }
58 
59  static CPPLanguageRuntime *Get(Process &process) {
60  return llvm::cast_or_null<CPPLanguageRuntime>(
62  }
63 
64  bool GetObjectDescription(Stream &str, ValueObject &object) override;
65 
66  bool GetObjectDescription(Stream &str, Value &value,
67  ExecutionContextScope *exe_scope) override;
68 
69  /// Obtain a ThreadPlan to get us into C++ constructs such as std::function.
70  ///
71  /// \param[in] thread
72  /// Current thrad of execution.
73  ///
74  /// \param[in] stop_others
75  /// True if other threads should pause during execution.
76  ///
77  /// \return
78  /// A ThreadPlan Shared pointer
79  lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
80  bool stop_others) override;
81 
82  bool IsAllowedRuntimeValue(ConstString name) override;
83 protected:
84  // Classes that inherit from CPPLanguageRuntime can see and modify these
85  CPPLanguageRuntime(Process *process);
86 
87 private:
89  llvm::StringMap<CPPLanguageRuntime::LibCppStdFunctionCallableInfo>;
90 
92 
93  CPPLanguageRuntime(const CPPLanguageRuntime &) = delete;
94  const CPPLanguageRuntime &operator=(const CPPLanguageRuntime &) = delete;
95 };
96 
97 } // namespace lldb_private
98 
99 #endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_CPLUSPLUS_CPPLANGUAGERUNTIME_H
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) override
Obtain a ThreadPlan to get us into C++ constructs such as std::function.
A line table entry class.
Definition: LineEntry.h:20
A class that represents a running process on the host machine.
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
virtual bool isA(const void *ClassID) const
lldb::LanguageType GetLanguageType() const override
bool isA(const void *ClassID) const override
LanguageType
Programming language type.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
bool IsAllowedRuntimeValue(ConstString name) override
Identify whether a name is a runtime value that should not be hidden by from the user interface...
A plug-in interface definition class for debugging a process.
Definition: Process.h:362
llvm::StringMap< CPPLanguageRuntime::LibCppStdFunctionCallableInfo > OperatorStringToCallableInfoMap
LibCppStdFunctionCallableInfo FindLibCppStdFunctionCallableInfo(lldb::ValueObjectSP &valobj_sp)
A section + offset based address class.
Definition: Address.h:59
static bool classof(const LanguageRuntime *runtime)
const CPPLanguageRuntime & operator=(const CPPLanguageRuntime &)=delete
uint64_t addr_t
Definition: lldb-types.h:83
A uniqued constant string class.
Definition: ConstString.h:40
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition: Process.cpp:1608
bool GetObjectDescription(Stream &str, ValueObject &object) override
static CPPLanguageRuntime * Get(Process &process)
OperatorStringToCallableInfoMap CallableLookupCache