1 //===-- CPPLanguageRuntime.h ---------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_CPPLanguageRuntime_h_
11 #define liblldb_CPPLanguageRuntime_h_
16 // Other libraries and framework includes
18 #include "lldb/Core/PluginInterface.h"
19 #include "lldb/lldb-private.h"
20 #include "lldb/Target/LanguageRuntime.h"
22 namespace lldb_private {
24 class CPPLanguageRuntime :
25 public LanguageRuntime
46 m_type (eTypeInvalid),
52 MethodName (const ConstString &s) :
58 m_type (eTypeInvalid),
74 if (m_type == eTypeInvalid)
107 ConstString m_full; // Full name: "lldb::SBTarget::GetBreakpointAtIndex(unsigned int) const"
108 llvm::StringRef m_basename; // Basename: "GetBreakpointAtIndex"
109 llvm::StringRef m_context; // Decl context: "lldb::SBTarget"
110 llvm::StringRef m_arguments; // Arguments: "(unsigned int)"
111 llvm::StringRef m_qualifiers; // Qualifiers: "const"
118 ~CPPLanguageRuntime();
120 virtual lldb::LanguageType
121 GetLanguageType () const
123 return lldb::eLanguageTypeC_plus_plus;
127 IsVTableName (const char *name) = 0;
130 GetObjectDescription (Stream &str, ValueObject &object);
133 GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope);
136 IsCPPMangledName(const char *name);
138 // Extract C++ context and identifier from a string using heuristic matching (as opposed to
139 // CPPLanguageRuntime::MethodName which has to have a fully qualified C++ name with parens and arguments.
140 // If the name is a lone C identifier (e.g. C) or a qualified C identifier (e.g. A::B::C) it will return true,
141 // and identifier will be the identifier (C and C respectively) and the context will be "" and "A::B::" respectively.
142 // If the name fails the heuristic matching for a qualified or unqualified C/C++ identifier, then it will return false
143 // and identifier and context will be unchanged.
146 ExtractContextAndIdentifier (const char *name, llvm::StringRef &context, llvm::StringRef &identifier);
148 // in some cases, compilers will output different names for one same type. when that happens, it might be impossible
149 // to construct SBType objects for a valid type, because the name that is available is not the same as the name that
150 // can be used as a search key in FindTypes(). the equivalents map here is meant to return possible alternative names
151 // for a type through which a search can be conducted. Currently, this is only enabled for C++ but can be extended
152 // to ObjC or other languages if necessary
154 FindEquivalentNames(ConstString type_name, std::vector<ConstString>& equivalents);
157 //------------------------------------------------------------------
158 // Classes that inherit from CPPLanguageRuntime can see and modify these
159 //------------------------------------------------------------------
160 CPPLanguageRuntime(Process *process);
162 DISALLOW_COPY_AND_ASSIGN (CPPLanguageRuntime);
165 } // namespace lldb_private
167 #endif // liblldb_CPPLanguageRuntime_h_