]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/LanguageRuntime.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / tools / lldb / include / lldb / Target / LanguageRuntime.h
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
26 namespace lldb_private {
27
28 class LanguageRuntime :
29     public PluginInterface
30 {
31 public:
32     virtual
33     ~LanguageRuntime();
34     
35     static LanguageRuntime* 
36     FindPlugin (Process *process, lldb::LanguageType language);
37     
38     virtual lldb::LanguageType
39     GetLanguageType () const = 0;
40     
41     virtual bool
42     GetObjectDescription (Stream &str, ValueObject &object) = 0;
43     
44     virtual bool
45     GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope) = 0;
46     
47     // this call should return true if it could set the name and/or the type
48     virtual bool
49     GetDynamicTypeAndAddress (ValueObject &in_value, 
50                               lldb::DynamicValueType use_dynamic, 
51                               TypeAndOrName &class_type_or_name, 
52                               Address &address) = 0;
53     
54     // This should be a fast test to determine whether it is likely that this value would
55     // have a dynamic type.
56     virtual bool
57     CouldHaveDynamicValue (ValueObject &in_value) = 0;
58
59     virtual void
60     SetExceptionBreakpoints ()
61     {
62     }
63     
64     virtual void
65     ClearExceptionBreakpoints ()
66     {
67     }
68     
69     virtual bool
70     ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason)
71     {
72         return false;
73     }
74     
75     static lldb::BreakpointSP
76     CreateExceptionBreakpoint (Target &target,
77                                lldb::LanguageType language, 
78                                bool catch_bp, 
79                                bool throw_bp, 
80                                bool is_internal = false);
81                             
82     static lldb::LanguageType
83     GetLanguageTypeFromString (const char *string);
84     
85     static const char *
86     GetNameForLanguageType (lldb::LanguageType language);
87     
88     Process *
89     GetProcess()
90     {
91         return m_process;
92     }
93
94     virtual lldb::BreakpointResolverSP
95     CreateExceptionResolver (Breakpoint *bkpt, bool catch_bp, bool throw_bp) = 0;
96     
97     virtual lldb::SearchFilterSP
98     CreateExceptionSearchFilter ();
99
100 protected:
101     //------------------------------------------------------------------
102     // Classes that inherit from LanguageRuntime can see and modify these
103     //------------------------------------------------------------------
104     
105     LanguageRuntime(Process *process);
106     Process *m_process;
107 private:
108     DISALLOW_COPY_AND_ASSIGN (LanguageRuntime);
109 };
110
111 } // namespace lldb_private
112
113 #endif  // liblldb_LanguageRuntime_h_