blob: 596d2888dc856ef3710838046d66b36816300e74 [file] [log] [blame]
Eugene Zelenko05e0fc82015-10-22 00:45:41 +00001//===-- GoLanguageRuntime.h -------------------------------------*- C++ -*-===//
Ryan Brown2b56f862015-10-06 20:31:08 +00002//
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_GoLanguageRuntime_h_
11#define liblldb_GoLanguageRuntime_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/lldb-private.h"
18#include "lldb/Breakpoint/BreakpointResolver.h"
19#include "lldb/Target/LanguageRuntime.h"
20#include "lldb/Core/Value.h"
21
22namespace lldb_private {
23
24 class GoLanguageRuntime :
25 public lldb_private::LanguageRuntime
26 {
27 public:
Eugene Zelenko05e0fc82015-10-22 00:45:41 +000028 ~GoLanguageRuntime() override = default;
29
30 //------------------------------------------------------------------
31 // Static Functions
32 //------------------------------------------------------------------
33 static void
34 Initialize();
35
36 static void
37 Terminate();
38
39 static lldb_private::LanguageRuntime *
40 CreateInstance(Process *process, lldb::LanguageType language);
41
42 static lldb_private::ConstString
43 GetPluginNameStatic();
Ryan Brown2b56f862015-10-06 20:31:08 +000044
45 lldb::LanguageType
46 GetLanguageType() const override
47 {
48 return lldb::eLanguageTypeGo;
49 }
50
51 bool
52 GetObjectDescription(Stream &str, ValueObject &object) override
53 {
54 // TODO(ribrdb): Maybe call String() method?
55 return false;
56 }
57
58 bool
59 GetObjectDescription(Stream &str, Value &value, ExecutionContextScope *exe_scope) override
60 {
61 return false;
62 }
63
64 bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic,
65 TypeAndOrName &class_type_or_name, Address &address,
66 Value::ValueType &value_type) override;
67
68 bool CouldHaveDynamicValue(ValueObject &in_value) override;
69
70 lldb::BreakpointResolverSP
71 CreateExceptionResolver(Breakpoint *bkpt, bool catch_bp, bool throw_bp) override
72 {
73 return lldb::BreakpointResolverSP();
74 }
75
76 TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override;
77
78 //------------------------------------------------------------------
Ryan Brown2b56f862015-10-06 20:31:08 +000079 // PluginInterface protocol
80 //------------------------------------------------------------------
Bruce Mitchener7fa5cda2015-10-07 10:02:24 +000081 lldb_private::ConstString
82 GetPluginName() override;
Ryan Brown2b56f862015-10-06 20:31:08 +000083
Bruce Mitchener7fa5cda2015-10-07 10:02:24 +000084 uint32_t
85 GetPluginVersion() override;
Ryan Brown2b56f862015-10-06 20:31:08 +000086
87 private:
88 GoLanguageRuntime(Process *process) : lldb_private::LanguageRuntime(process) { } // Call CreateInstance instead.
89 };
90
91} // namespace lldb_private
92
Eugene Zelenko05e0fc82015-10-22 00:45:41 +000093#endif // liblldb_GoLanguageRuntime_h_