Eugene Zelenko | 05e0fc8 | 2015-10-22 00:45:41 +0000 | [diff] [blame] | 1 | //===-- GoLanguageRuntime.h -------------------------------------*- C++ -*-===// |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 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_GoLanguageRuntime_h_ |
| 11 | #define liblldb_GoLanguageRuntime_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | // Other libraries and framework includes |
| 16 | // Project includes |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 17 | #include "lldb/Breakpoint/BreakpointResolver.h" |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 18 | #include "lldb/Core/Value.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 19 | #include "lldb/Target/LanguageRuntime.h" |
| 20 | #include "lldb/lldb-private.h" |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 21 | |
| 22 | namespace lldb_private { |
Eugene Zelenko | 05e0fc8 | 2015-10-22 00:45:41 +0000 | [diff] [blame] | 23 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 24 | class GoLanguageRuntime : public lldb_private::LanguageRuntime { |
| 25 | public: |
| 26 | ~GoLanguageRuntime() override = default; |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 27 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 28 | //------------------------------------------------------------------ |
| 29 | // Static Functions |
| 30 | //------------------------------------------------------------------ |
| 31 | static void Initialize(); |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 32 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 33 | static void Terminate(); |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 34 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 35 | static lldb_private::LanguageRuntime * |
| 36 | CreateInstance(Process *process, lldb::LanguageType language); |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 37 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 38 | static lldb_private::ConstString GetPluginNameStatic(); |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 39 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 40 | lldb::LanguageType GetLanguageType() const override { |
| 41 | return lldb::eLanguageTypeGo; |
| 42 | } |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 43 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 44 | bool GetObjectDescription(Stream &str, ValueObject &object) override { |
| 45 | // TODO(ribrdb): Maybe call String() method? |
| 46 | return false; |
| 47 | } |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 48 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 49 | bool GetObjectDescription(Stream &str, Value &value, |
| 50 | ExecutionContextScope *exe_scope) override { |
| 51 | return false; |
| 52 | } |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 53 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 54 | bool GetDynamicTypeAndAddress(ValueObject &in_value, |
| 55 | lldb::DynamicValueType use_dynamic, |
| 56 | TypeAndOrName &class_type_or_name, |
| 57 | Address &address, |
| 58 | Value::ValueType &value_type) override; |
| 59 | |
| 60 | bool CouldHaveDynamicValue(ValueObject &in_value) override; |
| 61 | |
| 62 | lldb::BreakpointResolverSP CreateExceptionResolver(Breakpoint *bkpt, |
| 63 | bool catch_bp, |
| 64 | bool throw_bp) override { |
| 65 | return lldb::BreakpointResolverSP(); |
| 66 | } |
| 67 | |
| 68 | TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, |
| 69 | ValueObject &static_value) override; |
| 70 | |
| 71 | //------------------------------------------------------------------ |
| 72 | // PluginInterface protocol |
| 73 | //------------------------------------------------------------------ |
| 74 | lldb_private::ConstString GetPluginName() override; |
| 75 | |
| 76 | uint32_t GetPluginVersion() override; |
| 77 | |
| 78 | private: |
| 79 | GoLanguageRuntime(Process *process) |
| 80 | : lldb_private::LanguageRuntime(process) { |
| 81 | } // Call CreateInstance instead. |
| 82 | }; |
| 83 | |
Ryan Brown | 2b56f86 | 2015-10-06 20:31:08 +0000 | [diff] [blame] | 84 | } // namespace lldb_private |
| 85 | |
Eugene Zelenko | 05e0fc8 | 2015-10-22 00:45:41 +0000 | [diff] [blame] | 86 | #endif // liblldb_GoLanguageRuntime_h_ |