LanguageRuntime.h revision d96df0a55f0a6e19af3d61d3f7ab5103ff96c543
1//===-- LanguageRuntime.h ---------------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef liblldb_LanguageRuntime_h_ 11#define liblldb_LanguageRuntime_h_ 12 13// C Includes 14// C++ Includes 15// Other libraries and framework includes 16// Project includes 17#include "lldb/lldb-public.h" 18#include "lldb/Breakpoint/BreakpointResolver.h" 19#include "lldb/Breakpoint/BreakpointResolverName.h" 20#include "lldb/Core/PluginInterface.h" 21#include "lldb/lldb-private.h" 22#include "lldb/Core/ValueObject.h" 23#include "lldb/Core/Value.h" 24#include "lldb/Target/ExecutionContextScope.h" 25 26class ExceptionBreakpointResolver; 27class ExceptionSearchFilter; 28 29namespace lldb_private { 30 31class LanguageRuntime : 32 public PluginInterface 33{ 34public: 35 virtual 36 ~LanguageRuntime(); 37 38 static LanguageRuntime* 39 FindPlugin (Process *process, lldb::LanguageType language); 40 41 virtual lldb::LanguageType 42 GetLanguageType () const = 0; 43 44 virtual bool 45 GetObjectDescription (Stream &str, ValueObject &object) = 0; 46 47 virtual bool 48 GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope) = 0; 49 50 // this call should return true if it could set the name and/or the type 51 virtual bool 52 GetDynamicTypeAndAddress (ValueObject &in_value, 53 lldb::DynamicValueType use_dynamic, 54 TypeAndOrName &class_type_or_name, 55 Address &address) = 0; 56 57 // This should be a fast test to determine whether it is likely that this value would 58 // have a dynamic type. 59 virtual bool 60 CouldHaveDynamicValue (ValueObject &in_value) = 0; 61 62 virtual void 63 SetExceptionBreakpoints () 64 { 65 } 66 67 virtual void 68 ClearExceptionBreakpoints () 69 { 70 } 71 72 virtual bool 73 ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason) 74 { 75 return false; 76 } 77 78 static lldb::BreakpointSP 79 CreateExceptionBreakpoint (Target &target, 80 lldb::LanguageType language, 81 bool catch_bp, 82 bool throw_bp, 83 bool is_internal = false); 84 85 static lldb::LanguageType 86 GetLanguageTypeFromString (const char *string); 87 88 static const char * 89 GetNameForLanguageType (lldb::LanguageType language); 90 91 Process * 92 GetProcess() 93 { 94 return m_process; 95 } 96 97protected: 98 //------------------------------------------------------------------ 99 // Classes that inherit from LanguageRuntime can see and modify these 100 //------------------------------------------------------------------ 101 friend class ExceptionBreakpointResolver; 102 friend class ExceptionSearchFilter; 103 104 virtual lldb::BreakpointResolverSP 105 CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp) = 0; 106 107 virtual lldb::SearchFilterSP 108 CreateExceptionSearchFilter (); 109 110 LanguageRuntime(Process *process); 111 Process *m_process; 112private: 113 DISALLOW_COPY_AND_ASSIGN (LanguageRuntime); 114}; 115 116} // namespace lldb_private 117 118#endif // liblldb_LanguageRuntime_h_ 119