LanguageRuntime.h revision e41494a9092e15192012a5e0a8a1ffd66c70b8bb
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/Core/PluginInterface.h"
19#include "lldb/lldb-private.h"
20#include "lldb/Core/ValueObject.h"
21#include "lldb/Core/Value.h"
22#include "lldb/Target/ExecutionContextScope.h"
23
24namespace lldb_private {
25
26class LanguageRuntime :
27    public PluginInterface
28{
29public:
30    virtual
31    ~LanguageRuntime();
32
33    static LanguageRuntime*
34    FindPlugin (Process *process, lldb::LanguageType language);
35
36    virtual lldb::LanguageType
37    GetLanguageType () const = 0;
38
39    virtual bool
40    GetObjectDescription (Stream &str, ValueObject &object) = 0;
41
42    virtual bool
43    GetObjectDescription (Stream &str, Value &value, ExecutionContextScope *exe_scope) = 0;
44
45    virtual bool
46    GetDynamicValue (ValueObject &in_value, lldb::TypeSP &type_sp, Address &address) = 0;
47
48    // This should be a fast test to determine whether it is likely that this value would
49    // have a dynamic type.
50    virtual bool
51    CouldHaveDynamicValue (ValueObject &in_value) = 0;
52
53    virtual void
54    SetExceptionBreakpoints ()
55    {
56    }
57
58    virtual void
59    ClearExceptionBreakpoints ()
60    {
61    }
62
63    virtual bool
64    ExceptionBreakpointsExplainStop (lldb::StopInfoSP stop_reason)
65    {
66        return false;
67    }
68protected:
69    //------------------------------------------------------------------
70    // Classes that inherit from LanguageRuntime can see and modify these
71    //------------------------------------------------------------------
72    LanguageRuntime(Process *process);
73    Process *m_process;
74private:
75    DISALLOW_COPY_AND_ASSIGN (LanguageRuntime);
76};
77
78} // namespace lldb_private
79
80#endif  // liblldb_LanguageRuntime_h_
81